* Michael Tokarev [2010-05-14 17:06 +0400]:
> It's been over 12 years already since cfdisk is built against
> libslang.  It can be built either againt libncurses or libslang.
> The interface it shows is basically the same.

Since September ncurses is built with --with-termlib.  As result of
this, only two programs (both part of util-linux) that depend on
libncurses* or libslang* remain in essential:

  * cfdisk (see quote above) depends on libslang.so.2.

  * pg (similar to more, but origin is SysV and not BSD) depends on
    libncurses.so.5.


The suggested switch of cfdisk to libslang had been done 2.17.2-3 but
reverted later due to the lack of a ncurses udeb.  Upstream's build
system does not offer to build two versions of cfdisk, one with slang
and one with ncurses, to be address this problem.  I wrote a patch to
add such an option against Debian's 2.20.1-4 (attached), but maintaining
a diff against upstreams build system is not reasonable and indeed it
does not apply cleanly against upstream's HEAD.

If I get upstream to accept a patch that enables optionally building
a cfdisk against slang and an other one against ncurses, would you use
this feature and thus remove libslang2 from essential (it could also be
removed from base if this happens)?


libncurses5 could also be removed essential, if cfdisk will use ncurses
in future, this would result in two steps:

  * move pg to, for example, bsdmainutils.  bsdmainutils depends on
    libncurses5 anyway and pg is marked as LEGACY by POSIX since 1997.
    more can be used instead of pg, so I see no need for it to stay in
    essential.

  * build a new package cfdisk with priority required.  util-linux would
    initially depend on it to ensure that it is installed whilst
    dist-upgrading.  After the releasing Wheezy, the dependency could be
    made a recommendation, but the priority of the new package cfdisk
    should in my opinion not be changed.


The reason for linking cfdisk against ncurses even if it cfdisk would
not be in essential anymore is that libslang2 is rarely used but
libncurses is used by many packages.


Given that I am able to convince bsdmainutils' maintainer to move pg to
bsdmainutils, would you drop it from util-linux?

What do you think about the suggested new package cfdisk?


Regards
Carsten
diff -u util-linux-2.20.1/configure util-linux-2.20.1/configure
diff -u util-linux-2.20.1/configure.ac util-linux-2.20.1/configure.ac
--- util-linux-2.20.1/configure.ac
+++ util-linux-2.20.1/configure.ac
@@ -593,7 +593,7 @@
 AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
 
 use_slang=no
-if test "x$with_slang" = xyes; then
+if test "x$with_slang" = xyes || test "x$enable_cfdisk_slang" = xyes; then
   AC_CHECK_HEADERS([slang.h slang/slang.h])
   AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
                    [use_slang=yes], [], [
@@ -607,7 +607,7 @@
     AC_MSG_ERROR([slang selected but slcurses.h not found])
   fi
 fi
-AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
+AM_CONDITIONAL(USE_SLANG, test "x$with_slang" = xyes)
 
 
 AC_ARG_WITH([utempter],
@@ -1017,6 +1017,12 @@
 AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
 
 
+AC_ARG_ENABLE([cfdisk_slang],
+  AS_HELP_STRING([--enable-cfdisk-slang], [build cfdisk-slang]),
+  [], enable_cfdisk_slang=no
+)
+AM_CONDITIONAL(BUILD_CFDISK_SLANG, test "x$enable_cfdisk_slang" = xyes)
+
 
 AC_ARG_ENABLE([elvtune],
   AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
diff -u util-linux-2.20.1/fdisk/Makefile.in util-linux-2.20.1/fdisk/Makefile.in
diff -u util-linux-2.20.1/debian/rules util-linux-2.20.1/debian/rules
--- util-linux-2.20.1/debian/rules
+++ util-linux-2.20.1/debian/rules
@@ -33,7 +33,7 @@
 version := $(shell sed -e '1{;s|^util-linux (\(.*\))\ .*|\1|;q;}' debian/changelog)
 Upstream := $(shell sed 's/^.*(\(.*\)-.*).*/\1/; q' debian/changelog)
 
-CONFOPTS= --enable-raw --enable-rdev --with-slang --enable-ddate --enable-line
+CONFOPTS= --enable-raw --enable-rdev --enable-cfdisk-slang --enable-ddate --enable-line
 CONFOPTS += --libdir=/lib/$(DEB_HOST_MULTIARCH) --libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
 ifeq ($(DEB_HOST_ARCH_OS),linux)
 CONFOPTS += --with-selinux --enable-libmount-mount --enable-partx
@@ -158,8 +158,10 @@
 	#
 	cd debian; if [ -f util-linux/sbin/fdisk ]; then \
 	    ln util-linux/sbin/*fdisk fdisk-udeb/usr/sbin/; \
-	    S=fdisk-udeb/usr/sbin/cfdisk; if [ -f $$S ]; then mv $$S cfdisk-udeb/usr/sbin/; fi; \
+	    rm -f fdisk-udeb/usr/sbin/cfdisk; \
+	    S=util-linux/sbin/cfdisk-slang; if [ -f $$S ]; then mv $$S cfdisk-udeb/usr/sbin/cfdisk; fi; \
 	fi
+	rm -f debian/util-linux/sbin/cfdisk-slang
 	if [ -d debian/cfdisk-udeb ]; then \
 		cd debian/util-linux-locales && find usr/share/locale -type f | while read x; do ln $$x ../cfdisk-udeb/$$x; done \
 	fi
diff -u util-linux-2.20.1/debian/changelog util-linux-2.20.1/debian/changelog
--- util-linux-2.20.1/debian/changelog
+++ util-linux-2.20.1/debian/changelog
@@ -1,3 +1,11 @@
+util-linux (2.20.1-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Switch utils-linux's cfdisk, but not the udeb's cfdisk, from slang2 to
+    ncurses5.  Closes: #581631
+
+ -- Carsten Hey <cars...@debian.org>  Wed, 07 Mar 2012 19:49:03 +0100
+
 util-linux (2.20.1-4) unstable; urgency=low
 
   [Michał Kułach]
only in patch2:
unchanged:
--- util-linux-2.20.1.orig/fdisk/cfdisk.c
+++ util-linux-2.20.1/fdisk/cfdisk.c
@@ -65,6 +65,13 @@
 #include <getopt.h>
 #include <fcntl.h>
 
+#ifndef CFDISK_USE_SLANG
+#undef HAVE_SLANG_H
+#undef HAVE_SLANG_SLANG_H
+#undef HAVE_SLCURSES_H
+#undef HAVE_SLANG_SLCURSES_H
+#endif
+
 #ifdef HAVE_SLANG_H
 #include <slang.h>
 #elif defined(HAVE_SLANG_SLANG_H)
only in patch2:
unchanged:
--- util-linux-2.20.1.orig/fdisk/Makefile.am
+++ util-linux-2.20.1/fdisk/Makefile.am
@@ -57,6 +57,7 @@
 dist_man_MANS += cfdisk.8
 cfdisk_SOURCES = cfdisk.c $(fdisk_common)
 cfdisk_CFLAGS = $(cflags_blkid)
+cfdisk_CPPFLAGS = -DCFDISK_USE_SLANG $(AM_CPPFLAGS)
 cfdisk_LDADD = -lslang $(ldadd_blkid)
 else
 if HAVE_NCURSES
@@ -64,10 +65,19 @@
 dist_man_MANS += cfdisk.8
 cfdisk_SOURCES = cfdisk.c $(fdisk_common)
 cfdisk_CFLAGS = $(cflags_blkid)
+cfdisk_CPPFLAGS = $(AM_CPPFLAGS)
 cfdisk_LDADD = @NCURSES_LIBS@ $(ldadd_blkid)
 endif
 endif
 
+if BUILD_CFDISK_SLANG
+sbin_PROGRAMS += cfdisk-slang
+cfdisk_slang_SOURCES = cfdisk.c $(fdisk_common)
+cfdisk_slang_CFLAGS = $(cflags_blkid)
+cfdisk_slang_CPPFLAGS = -DCFDISK_USE_SLANG $(AM_CPPFLAGS)
+cfdisk_slang_LDADD = -lslang $(ldadd_blkid)
+endif
+
 endif # !ARCH_SPARC
 endif # !ARCH_M68K
 

Reply via email to