sysutils/e2fsprogs: sync with upstream

Taken from: FreeBSD
This commit is contained in:
Franco Fichtner 2021-08-05 08:36:35 +02:00
parent 973a43e364
commit b4f3cba3c6
4 changed files with 46 additions and 24 deletions

View file

@ -1,7 +1,19 @@
# Created by: Maxim Sobolev <sobomax@FreeBSD.org>
# heavily modified by: Matthias Andree <mandree@FreeBSD.org>
#
# supported FLAVORS= default nobootfsck roothardlinks
# FLAVORS explained:
# default - install e2fsck fsck_ext2fs into /sbin and symlink from PREFIX
# - requires that / is writable
#
# roothardlinks - install e2fsck fsck_ext2fs into /sbin and hardlink from PREFIX
# - requires that / is writable and the same file system as PREFIX
#
# nobootfsck - does not install into /sbin, but will be unable to fsck
# ext2/ext3/ext4 file systems at boot, before PREFIX is mounted
PORTNAME= e2fsprogs
PORTVERSION= 1.46.2
PORTVERSION= 1.46.3
PORTREVISION?= 0
CATEGORIES?= sysutils
MASTER_SITES= KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION}
@ -37,7 +49,6 @@ CONFIGURE_ARGS?=--disable-fsck \
--libdir='${PREFIX}/lib/e2fsprogs/' \
--includedir='${PREFIX}/include/e2fsprogs/' \
--with-root-prefix='${PREFIX}' \
--without-included-gettext \
LDFLAGS='${LDFLAGS} -L${LOCALBASE}/lib -Wl,--rpath -Wl,${LOCALBASE}/lib/e2fsprogs'
CONFIGURE_ENV?= LIBS='-Wl,--as-needed ${LIBS} -lexecinfo -lelf'
# apparently HAVE_PTHREAD_H checks go missing if the FUSEFS option is unset, force it:
@ -99,6 +110,13 @@ MAKE_ARGS+= V=1
.include <bsd.port.options.mk>
.if ${MASTERDIR} == ${.CURDIR}
FLAVORS= default nobootfsck roothardlinks
FLAVOR?= ${FLAVORS:[1]}
nobootfsck_PKGNAMESUFFIX= -nobootfsck
roothardlinks_PKGNAMESUFFIX= -roothardlinks
.endif
. if ! empty(ARCH:Mpowerpc*)
# Fix powerpc64/powerpc SIGSEGV,
# see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231570 (ppc64)
@ -198,7 +216,13 @@ post-patch::
.if ${MASTERDIR} == ${.CURDIR}
# NOTE: The previous .if block goes all the way to the end of the file.
.if !empty(PORT_OPTIONS:MNOTESTS) && (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1200000 || ((${ARCH} != i386) && (${ARCH} != amd64)))
.if ${FLAVOR} == nobootfsck
PLIST_SUB+= ROOTSBIN="@comment "
.else
PLIST_SUB+= ROOTSBIN=""
.endif
.if !empty(PORT_OPTIONS:MNOTESTS) && (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1400000 || ((${ARCH} != i386) && (${ARCH} != amd64)))
BROKEN= it was not tested on your system by the maintainer; you must run self-tests
.endif
@ -296,13 +320,22 @@ post-install:
# in the regular hierarchy, normally $PREFIX/sbin. Hard links may
# crash the install if /usr[/local] is a separate file system from /,
# and pkg 1.15.4 can't automatically unroll or install relative symlinks.
.if ${FLAVOR} != nobootfsck
${MKDIR} ${STAGEDIR}/sbin
${MV} -f ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}/sbin/ # from INSTALL_TARGET
${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}/sbin/ # from port
# according to TPH 6.1.1 Handling Symbolic Links, these are to be absolute,
# yet stage-qa warns about these on 2020-09-16:
# according to TPH 6.1.1 Handling Symbolic Links, these are to be absolute
# for the default FLAVOR, yet stage-qa warns about these on 2020-09-16.
. if ${FLAVOR} == roothardlinks
${LN} -f ${STAGEDIR}/sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
${LN} -f ${STAGEDIR}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/
. else
${LN} -fs /sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
${LN} -fs /sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/
. endif
.else
${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
.endif
# these are made hardlinks to symlinks - -P avoids following them to /sbin:
${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext2
${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext3

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1615412280
SHA256 (e2fsprogs-1.46.2.tar.xz) = 23aa093295c94e71ef1be490c4004871c5b01d216a8cb4d111fa6c0aac354168
SIZE (e2fsprogs-1.46.2.tar.xz) = 7020552
TIMESTAMP = 1628091626
SHA256 (e2fsprogs-1.46.3.tar.xz) = 86d1580facdd49f2e0e6b027e26b1e6c48af538762dc40aeed2a87153c1f11b7
SIZE (e2fsprogs-1.46.3.tar.xz) = 7024896

View file

@ -6,18 +6,6 @@ MODE="$2" # PRE-INSTALL, POST-INSTALL, DEINSTALL, POST-DEINSTALL
case "$MODE" in
POST-INSTALL)
# try to replace the e2fsck and its wrapper, fsck_ext2fs,
# symbolic links by hard links if possible (pkg ships them as symlinks)
d1=${PKG_ROOTDIR}/sbin/ ; dev1=$(stat -Lf %Xd "$d1")
d2=${PKG_ROOTDIR}${PKG_PREFIX}/sbin/ ; dev2=$(stat -Lf %Xd "$d2")
if [ "$dev1" = "$dev2" ] && [ "$(realpath "$d1")" != "$(realpath "$d2")" ]; then
for i in e2fsck fsck_ext2fs ; do
ln -fhP ${d1}${i} ${d2}${i}
done
for i in ext2 ext3 ext4 ; do
ln -fhP ${d2}e2fsck ${d2}fsck.$i
done
fi
#
# install configuration file and update config files from
# old "ext4dev" to current "ext4" name.
@ -59,20 +47,21 @@ POST-INSTALL)
cp -p ${PKG_PREFIX}/etc/mke2fs.conf.dist \
${PKG_PREFIX}/etc/mke2fs.conf
fi
;;
DEINSTALL)
if cmp -s ${PKG_PREFIX}/etc/mke2fs.conf \
${PKG_PREFIX}/etc/mke2fs.conf.dist
then
rm -f ${PKG_PREFIX}/etc/mke2fs.conf
else
elif [ "_${PKG_UPGRADE-upgrade}" = _upgrade ] ; then
echo "If and only if you are deleting e2fsprogs forever,"
echo "remember to delete ${PKG_PREFIX}/etc/mke2fs.conf."
fi
# e2fsck.conf is no longer part of the distribution, but still supported,
# => no pkg-list @sample line possible
# and no reference e2fsck.conf.sample or e2fsck.conf.dist is available
if test -f ${PKG_PREFIX}/etc/e2fsck.conf
if test -f ${PKG_PREFIX}/etc/e2fsck.conf -a "_${PKG_UPGRADE-upgrade}" = _upgrade
then
echo "If and only if you are deleting e2fsprogs forever,"
echo "remember to delete ${PKG_PREFIX}/etc/e2fsck.conf."

View file

@ -1,5 +1,5 @@
/sbin/e2fsck
/sbin/fsck_ext2fs
%%ROOTSBIN%%/sbin/e2fsck
%%ROOTSBIN%%/sbin/fsck_ext2fs
bin/chattr
bin/e2fsprogs-compile_et
%%FUSEFS%%bin/fuse2fs