ports/116434: [MAINTAINER] sysutils/e2fsprogs: overhaul, prepare for new slave ports

Matthias Andree matthias.andree at gmx.de
Tue Sep 18 09:30:02 UTC 2007


>Number:         116434
>Category:       ports
>Synopsis:       [MAINTAINER] sysutils/e2fsprogs: overhaul, prepare for new slave ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 18 09:30:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 6.2-RELEASE-p7 i386
>Organization:
>Environment:
System: FreeBSD rho.emma.line.org 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #1: Fri Aug 31 14:58:52 CEST 2007
>Description:
Supersedes: ports/116286
Supersedes: ports/116230

Changes submitted by Alejandro Pulver in ports/116286:
- Turn NLS knob into an option
- Reformat things a bit
- Avoid building/installing things rather than removing them afterwards

Changes by maintainer:
- Support new e2fsprogs-libblkid slave port (ports/116231)
- Get rid of pkg-install, use @exec option unconditionally (Alejandro
  Pulver suggested a different approach that is wasteful if /sbin
  and ${PREFIX}/sbin are within the same filesystem)

Removed file(s):
- pkg-install

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- e2fsprogs-1.40.2_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/sysutils/e2fsprogs/Makefile /usr/home/emma/ports/sysutils/e2fsprogs/Makefile
--- /usr/ports/sysutils/e2fsprogs/Makefile	Mon Jul 23 11:36:34 2007
+++ /usr/home/emma/ports/sysutils/e2fsprogs/Makefile	Tue Sep 18 11:19:54 2007
@@ -7,7 +7,7 @@
 
 PORTNAME=	e2fsprogs
 PORTVERSION=	1.40.2
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_EXTENDED}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -15,30 +15,21 @@
 MAINTAINER?=	matthias.andree at gmx.de
 COMMENT?=	Utilities and library to manipulate ext2/ext3 filesystems
 
-.if !defined(WITHOUT_NLS)
-USE_GETTEXT=	yes
-.endif
-
 PATCH_STRIP=	-p1
+USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS?=	--disable-fsck --disable-e2initrd-helper \
-			'--with-ldopts=-L${LOCALBASE}/lib' \
-			--with-cc='${CC}' --with-linker='${LD}' \
-			--with-ccopts='${CFLAGS}' \
-			--with-root-prefix='${PREFIX}'
+CONFIGURE_ARGS+=--disable-fsck --disable-e2initrd-helper \
+		--with-cc='${CC}' --with-linker='${LD}' \
+		--with-ccopts='${CFLAGS}' \
+		--with-root-prefix='${PREFIX}'
 # for unknown reasons, the assembly bitops cause SIGSEGV.
 # _EXT2_USE_C_VERSIONS_ uses C bitops, these appear to work fine.
-CONFIGURE_ENV+=	CPPFLAGS='${CPPFLAGS} -I${WRKSRC}/lib -I${LOCALBASE}/include -D_EXT2_USE_C_VERSIONS_'
-.if defined(WITHOUT_NLS)
-CONFIGURE_ARGS+=	--disable-nls
-PLIST_SUB=	NLS="@comment "
-.else
-MAKE_ARGS+=	STATIC_LIBS="../lib/libext2fs.a ../lib/libcom_err.a ../lib/libblkid.a  \
-		../lib/libuuid.a ${LOCALBASE}/lib/libintl.a ${LOCALBASE}/lib/libiconv.a"
-PLIST_SUB=	NLS=""
-.endif
-USE_LDCONFIG=	yes
-PKGDEINSTALL=	${PKGINSTALL}
+CONFIGURE_ENV+=	CPPFLAGS='${CPPFLAGS} -I${WRKSRC}/lib \
+		-I${LOCALBASE}/include -D_EXT2_USE_C_VERSIONS_'
+
+MAKE_ARGS+=	LDFLAGS='${LDFLAGS} -L${LOCALBASE}/lib'
+
+OPTIONS=	NLS "Enable national language support" on
 
 .if !defined(MASTERDIR)
 MAN1=	chattr.1 lsattr.1
@@ -48,15 +39,6 @@
 	fsck.ext2.8 fsck.ext3.8 mkfs.ext2.8 mkfs.ext3.8 \
 	findfs.8 blkid.8 logsave.8 fsck_ext2fs.8
 
-pre-build:
-	@${ECHO_CMD} "-------------------------------------------------------------"
-.if defined(WITHOUT_NLS)
-	@${ECHO_CMD} "National language support disabled, -DWITHOUT_NLS in effect. "
-.else
-	@${ECHO_CMD} "Use -DWITHOUT_NLS to build without national language support."
-.endif
-	@${ECHO_CMD} "-------------------------------------------------------------"
-
 post-extract:
 	${CHMOD} u+w ${WRKSRC}/po/*.po ${WRKSRC}/po/*.pot \
 		${WRKSRC}/${CONFIGURE_SCRIPT}
@@ -64,43 +46,59 @@
 
 .include <bsd.port.pre.mk>
 
+.if defined(WITHOUT_NLS)
+CONFIGURE_ARGS+=--disable-nls
+PLIST_SUB=	NLS="@comment "
+.else
+USE_GETTEXT=	yes
+MAKE_ARGS+=	STATIC_LIBS="../lib/libext2fs.a ../lib/libcom_err.a \
+		../lib/libblkid.a  ../lib/libuuid.a \
+		${LOCALBASE}/lib/libintl.a ${LOCALBASE}/lib/libiconv.a"
+PLIST_SUB=	NLS=""
+.endif
+
 post-patch:
-	${REINPLACE_CMD} -E -e 's:\$$\(libdir\)/pkgconfig:${PREFIX}/libdata/pkgconfig:' \
+	${REINPLACE_CMD} -E -e \
+		's:\$$\(libdir\)/pkgconfig:${PREFIX}/libdata/pkgconfig:' \
 		${WRKSRC}/lib/*/Makefile.in
-	@: # disable uuidgen
-	${REINPLACE_CMD} \
-		-e 's/^\(UPROGS.*\) uuidgen\(.*\)/\1\2/' \
-		-e 's/^\(UMANPAGES.*\) uuidgen.1\(.*\)/\1\2/' \
+	@: # disable uuidgen and filefrag
+	${REINPLACE_CMD} -E -e \
+		's/^(UPROGS.*) uuidgen(.*)/\1\2/; \
+		 s/^(UMANPAGES.*) uuidgen.1(.*)/\1\2/; \
+		 s/^(USPROGS.*) filefrag(.*)/\1\2/; \
+		 s/filefrag\.8 //' \
 		${WRKSRC}/misc/Makefile.in
+	@: # don't build/install libext2fs.info
+	${REINPLACE_CMD} -e 's/ install-doc-libs$$//' ${WRKSRC}/Makefile.in
 
 .if ${MASTERDIR} == ${.CURDIR}
 post-build:
 .if !defined(WITHOUT_NLS)
 	cd ${WRKSRC}/po && ${MAKE} update-gmo
 .endif
-	${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -s -static ${LIBS} -o ${WRKSRC}/fsck_ext2fs ${FILESDIR}/fsck_ext2fs.c
+	${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -s -static ${LIBS} \
+		-o ${WRKSRC}/fsck_ext2fs ${FILESDIR}/fsck_ext2fs.c
 	cd ${WRKSRC}/tests && ${MAKE} check
 # While the ${MAKE} check can take a minute on an end user's system, the
 # correctness of tools such as e2fsck is critical to the health of the
 # file systems.  The upstream is not using any *BSD as his development
 # system, and therefore let's exercise due diligence in running the self-
 # test on each and every system and not just package building hosts.
-# There have been subtle failures induced by Linux-isms in the past,
-# and every release I've packaged introduced some minor regressions.
-# -- Matthias Andree, package maintainer, 2006-06-12
+# There have been subtle failures induced by Linux-isms in the past.
+# -- Matthias Andree, package maintainer, 2007-09-18
 
 post-install:
-	${RM} ${PREFIX}/sbin/filefrag
-	${RM} ${PREFIX}/man/man8/filefrag.8
-	${RM} ${PREFIX}/info/libext2fs.info.gz
 	${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${PREFIX}/sbin/
+	@: # install into /sbin since we might need e2fsck early on
+	${LN} ${PREFIX}/sbin/fsck_ext2fs /sbin/ 2>/dev/null || \
+		${INSTALL_PROGRAM} ${PREFIX}/sbin/fsck_ext2fs /sbin/
+	${LN} ${PREFIX}/sbin/e2fsck /sbin/ 2>/dev/null || \
+		${INSTALL_PROGRAM} ${PREFIX}/sbin/e2fsck /sbin/
 	${INSTALL_MAN} ${FILESDIR}/fsck_ext2fs.8 ${PREFIX}/man/man8/
 	[ -f ${PREFIX}/etc/mke2fs.conf ] || \
-		${CP} -p ${PREFIX}/etc/mke2fs.conf.dist ${PREFIX}/etc/mke2fs.conf
-	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-	@${ECHO_MSG}
-	@${CAT} ${PKGMESSAGE}
-	@${ECHO_MSG}
+		${CP} -p ${PREFIX}/etc/mke2fs.conf.dist \
+			${PREFIX}/etc/mke2fs.conf
+	@${ECHO_MSG} ; ${CAT} ${PKGMESSAGE} ; ${ECHO_MSG}
 .endif
 
 .include <bsd.port.post.mk>
diff -ruN --exclude=CVS /usr/ports/sysutils/e2fsprogs/pkg-install /usr/home/emma/ports/sysutils/e2fsprogs/pkg-install
--- /usr/ports/sysutils/e2fsprogs/pkg-install	Mon Jun 12 14:13:08 2006
+++ /usr/home/emma/ports/sysutils/e2fsprogs/pkg-install	Thu Jan  1 01:00:00 1970
@@ -1,79 +0,0 @@
-# $FreeBSD: ports/sysutils/e2fsprogs/pkg-install,v 1.1 2006/06/12 12:13:08 pav Exp $
-#
-# ports/sysutils/e2fsprogs/pkg-install - (C) 2006 by Matthias Andree
-# redistributable under the modified BSD license
-#
-# ask() and yesno() based on ports/mail/postfix/pkg-install
-
-PKG_PREFIX=${PKG_PREFIX:=/usr/local}
-BATCH=${BATCH:=no}
-
-ask() {
-        local question default answer
-
-        question=$1
-        default=$2
-        if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then
-                read -p "${question} [${default}]? " answer
-        fi
-        if [ x${answer} = x ]; then
-                answer=${default}
-        fi
-        echo ${answer}
-}
-
-yesno() {
-        local question default answer
-
-        question=$1
-        default=$2
-        while :; do
-                answer=$(ask "${question}" "${default}")
-                case "${answer}" in
-                        [Yy][Ee][SsPp]|[Yy])  return 0;;
-                        [Nn]|[Nn][Oo])  return 1;;
-                esac
-                echo "Please answer yes or no."
-        done
-}
-
-if [ "x$2" = xPOST-INSTALL ] && [ -z "${PACKAGE_BUILDING}" ]; then
-	cat <<_EOF
-
-To have your ext2 and ext3 filesystems fsck'ed correctly without explicitly
-invoking the fsck_ext2fs utility installed by this port you will need to
-create links or copy the fsck utilities installed by this port in/to /sbin, e.g.
-
-ln -f "${PKG_PREFIX}/sbin/fsck_ext2fs" /sbin/ 2>/dev/null \\
-  || install -m755 "${PKG_PREFIX}/sbin/fsck_ext2fs" /sbin/
-ln -f "${PKG_PREFIX}/sbin/e2fsck" /sbin/e2fsck 2>/dev/null \\
-  || install -m755 "${PKG_PREFIX}/sbin/e2fsck" /sbin/e2fsck
-
-IMPORTANT: you also need to repeat the steps above after a port upgrade!
-
-_EOF
-
-	if yesno "Shall I create the links now?" yes ; then
-		echo "Installing /sbin/fsck_ext2fs and /sbin/e2fsck."
-		ln -f "${PKG_PREFIX}/sbin/fsck_ext2fs" /sbin/ 2>/dev/null \
-		  || install -m755 "${PKG_PREFIX}/sbin/fsck_ext2fs" /sbin/
-		ln -f "${PKG_PREFIX}/sbin/e2fsck" /sbin/e2fsck 2>/dev/null \
-		  || install -m755 "${PKG_PREFIX}/sbin/e2fsck" /sbin/e2fsck
-	fi
-fi
-
-if [ "x$2" = xDEINSTALL ] ; then
-	cat <<_EOF
-
-If you are deinstalling the e2fsprogs port for good, rather than upgrading it,
-remember to remove the files you may have installed into /sbin, example:
-
-rm -f /sbin/fsck_ext2fs /sbin/e2fsck
-
-_EOF
-
-	if yesno "Shall I remove the links now?" yes ; then
-		echo "Removing /sbin/fsck_ext2fs and /sbin/e2fsck."
-		rm -f /sbin/fsck_ext2fs /sbin/e2fsck
-	fi
-fi
diff -ruN --exclude=CVS /usr/ports/sysutils/e2fsprogs/pkg-message /usr/home/emma/ports/sysutils/e2fsprogs/pkg-message
--- /usr/ports/sysutils/e2fsprogs/pkg-message	Mon Jun 12 14:13:08 2006
+++ /usr/home/emma/ports/sysutils/e2fsprogs/pkg-message	Tue Sep 18 11:02:47 2007
@@ -1,3 +1,7 @@
+===========================================================================
+
 Note: this is a modified version of the e2fsprogs package, not the official
 package. Report all building and run-time trouble that originates in the
 package to the port maintainer, <matthias.andree at gmx.de>.
+
+===========================================================================
diff -ruN --exclude=CVS /usr/ports/sysutils/e2fsprogs/pkg-plist /usr/home/emma/ports/sysutils/e2fsprogs/pkg-plist
--- /usr/ports/sysutils/e2fsprogs/pkg-plist	Wed Jul  4 13:32:35 2007
+++ /usr/home/emma/ports/sysutils/e2fsprogs/pkg-plist	Tue Sep 18 10:57:20 2007
@@ -15,6 +15,9 @@
 sbin/fsck.ext2
 sbin/fsck.ext3
 sbin/fsck_ext2fs
+ at exec ln -f %D/sbin/e2fsck /sbin 2>/dev/null || cp -p %D/sbin/e2fsck /sbin
+ at exec ln -f %D/sbin/fsck_ext2fs /sbin 2>/dev/null || cp -p %D/sbin/fsck_ext2fs /sbin
+ at unexec rm -f /sbin/fsck_ext2fs /sbin/e2fsck
 sbin/logsave
 sbin/mke2fs
 sbin/mkfs.ext2
--- e2fsprogs-1.40.2_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list