From 14e733a6bb4b99ae6fbbab6cb9d6b133583daabb Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sat, 1 Oct 2022 16:34:10 +0200 Subject: [PATCH] sysutils/e2fsprogs: 1/2 rename to -core, strip FLAVORS and /sbin This is the first commit that renames e2fsprogs to e2fsprogs-core, makes the necessary changes to Makefiles, strips the FLAVORs that determined how to link or copy to /sbin. The latter feature will be placed into a new e2fsprogs port that just copies two files to /sbin. A followup 2/2 commit will then add the new e2fsprogs port. This is done so that Git can properly track the rename. While here, switch from FreeBSD's dd to GNU coreutils's dd in an attempt to fix sporadic m_offset self-test failures. --- misc/e2fsprogs-libblkid/Makefile | 4 +- misc/e2fsprogs-libuuid/Makefile | 4 +- sysutils/Makefile | 2 +- .../{e2fsprogs => e2fsprogs-core}/Makefile | 80 +++++-------------- .../{e2fsprogs => e2fsprogs-core}/distinfo | 0 .../files/extrapatch-e2fsck_sigcatcher.c | 0 .../files/extrapatch-no-sbrk | 0 .../files/fix-ss_err.h.sed | 0 .../files/fsck_ext2fs.8 | 0 .../files/fsck_ext2fs.c | 0 .../files/patch-CVE-2022-1304 | 0 .../files/patch-ZZZ-g8535250a | 0 .../files/patch-e2fsck__unix.c | 0 .../files/patch-lib__uuid__gen_uuid.c | 0 .../files/patch-lib_blkid_devname.c | 0 .../files/patch-lib_et_com__err.3 | 0 .../files/patch-lib_support_plausible.c | 0 .../files/patch-lib_support_sort__r.h | 0 .../files/patch-misc__Makefile.in | 0 .../files/patch-misc_blkid.8.in | 0 .../files/patch-misc_e2fuzz.c | 0 .../files/patch-tests_Makefile.in | 0 .../files/unwanted | 0 .../{e2fsprogs => e2fsprogs-core}/pkg-descr | 0 .../{e2fsprogs => e2fsprogs-core}/pkg-install | 0 .../{e2fsprogs => e2fsprogs-core}/pkg-message | 0 .../{e2fsprogs => e2fsprogs-core}/pkg-plist | 2 - 27 files changed, 23 insertions(+), 69 deletions(-) rename sysutils/{e2fsprogs => e2fsprogs-core}/Makefile (83%) rename sysutils/{e2fsprogs => e2fsprogs-core}/distinfo (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/extrapatch-e2fsck_sigcatcher.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/extrapatch-no-sbrk (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/fix-ss_err.h.sed (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/fsck_ext2fs.8 (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/fsck_ext2fs.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-CVE-2022-1304 (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-ZZZ-g8535250a (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-e2fsck__unix.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-lib__uuid__gen_uuid.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-lib_blkid_devname.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-lib_et_com__err.3 (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-lib_support_plausible.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-lib_support_sort__r.h (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-misc__Makefile.in (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-misc_blkid.8.in (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-misc_e2fuzz.c (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/patch-tests_Makefile.in (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/files/unwanted (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/pkg-descr (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/pkg-install (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/pkg-message (100%) rename sysutils/{e2fsprogs => e2fsprogs-core}/pkg-plist (98%) diff --git a/misc/e2fsprogs-libblkid/Makefile b/misc/e2fsprogs-libblkid/Makefile index 8dfd267d7a051..40e8a7e25a150 100644 --- a/misc/e2fsprogs-libblkid/Makefile +++ b/misc/e2fsprogs-libblkid/Makefile @@ -1,4 +1,4 @@ -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= misc devel PKGNAMESUFFIX= -libblkid @@ -11,7 +11,7 @@ LIB_DEPENDS= libuuid.so:misc/e2fsprogs-libuuid CONFIGURE_ARGS= --enable-elf-shlibs --disable-libuuid --enable-libblkid -MASTERDIR= ${.CURDIR}/../../sysutils/e2fsprogs +MASTERDIR= ${.CURDIR}/../../sysutils/e2fsprogs-core MAKE_ARGS= LIB_SUBDIRS=lib/blkid LDFLAGS_SHLIB=-L${LOCALBASE}/lib USE_LDCONFIG= yes ALL_TARGET= libs diff --git a/misc/e2fsprogs-libuuid/Makefile b/misc/e2fsprogs-libuuid/Makefile index 5783954bc643c..98e76cf896a39 100644 --- a/misc/e2fsprogs-libuuid/Makefile +++ b/misc/e2fsprogs-libuuid/Makefile @@ -1,4 +1,4 @@ -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= misc devel PKGNAMESUFFIX= -libuuid @@ -10,7 +10,7 @@ LICENSE_FILE= ${INSTALL_WRKSRC}/COPYING CONFIGURE_ARGS= --enable-elf-shlibs --enable-libuuid OPTIONS_EXCLUDE= NLS -MASTERDIR= ${.CURDIR}/../../sysutils/e2fsprogs +MASTERDIR= ${.CURDIR}/../../sysutils/e2fsprogs-core MAKE_ARGS= LIB_SUBDIRS=lib/uuid USE_LDCONFIG= yes ALL_TARGET= libs diff --git a/sysutils/Makefile b/sysutils/Makefile index 2215340b6e446..0e98641d3346b 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -325,7 +325,7 @@ SUBDIR += dwatch-gource SUBDIR += dwatch-json SUBDIR += dwatch-pwsnoop - SUBDIR += e2fsprogs + SUBDIR += e2fsprogs-core SUBDIR += e2tools SUBDIR += ebsnvme-id SUBDIR += ec2-scripts diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs-core/Makefile similarity index 83% rename from sysutils/e2fsprogs/Makefile rename to sysutils/e2fsprogs-core/Makefile index 87a1e2cb7836e..484310867d132 100644 --- a/sysutils/e2fsprogs/Makefile +++ b/sysutils/e2fsprogs-core/Makefile @@ -1,19 +1,6 @@ -# heavily modified by: Matthias Andree -# -# 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.5 -PORTREVISION?= 4 +PORTREVISION?= 5 CATEGORIES?= sysutils MASTER_SITES= KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION} @@ -49,6 +36,7 @@ CONFIGURE_ARGS?=--disable-fsck \ --libdir='${PREFIX}/lib/e2fsprogs/' \ --includedir='${PREFIX}/include/e2fsprogs/' \ --with-root-prefix='${PREFIX}' \ + DD=${LOCALBASE}/bin/gdd \ 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: @@ -56,7 +44,7 @@ CPPFLAGS+= -I${WRKSRC}/lib -I${LOCALBASE}/include # -D_EXT2_USE_C_VERSIONS MAKE_ARGS+= pkgconfigdir='${PREFIX}/libdata/pkgconfig' MAKE_ENV+= CHECK_CMD=@true -CONFLICTS_INSTALL= e2fsprogs e2fsprogs-nobootfsck e2fsprogs-roothardlinks +CONFLICTS_INSTALL= e2fsprogs-nobootfsck e2fsprogs-roothardlinks PORTSCOUT= ignore:1 # cannot handle the version in the directory @@ -83,6 +71,9 @@ BASHTESTS_DESC= Enable tests that require the GNU bash shell LIBUNWIND_DESC= Backtrace with libunwind (do set WITH_DEBUG_PORTS+=${PKGORIGIN}!) FUSEFS_CONFIGURE_ENABLE= fuse2fs +FUSEFS_USES= fuse + +NLS_USES= gettext iconv:build BUILD_DEPENDS+= gdd:sysutils/coreutils BASHTESTS_BUILD_DEPENDS= ${BASH_CMD}:shells/bash @@ -114,10 +105,7 @@ MAKE_ARGS+= V=1 .include .if ${MASTERDIR} == ${.CURDIR} -FLAVORS= default nobootfsck roothardlinks -FLAVOR?= ${FLAVORS:[1]} -nobootfsck_PKGNAMESUFFIX= -nobootfsck -roothardlinks_PKGNAMESUFFIX= -roothardlinks +PKGNAMESUFFIX= -core .endif . if ! empty(ARCH:Mpowerpc*) @@ -127,14 +115,6 @@ roothardlinks_PKGNAMESUFFIX= -roothardlinks USES+= compiler:c11 . endif -.if ${PORT_OPTIONS:MFUSEFS} -USES+= fuse -.endif - -.if ${PORT_OPTIONS:MNLS} -USES+= gettext iconv:build -.endif - .if empty(PORT_OPTIONS:MNOTESTS) && ${MASTERDIR} == ${.CURDIR} USES+= perl5 USE_PERL5= build @@ -158,15 +138,17 @@ EXTRA_PATCHES+= ${FILESDIR}/extrapatch-no-sbrk .endif # d_fallocate_blkmap appears to fail on some systems for unknown reasons. +# m_offset sometimes failes, a make clean and re-build usually fixes this. Reason unknown. post-patch:: +.if !empty(DISTFILES) @${REINPLACE_CMD} -E -e 's/md5sum ([^ ]*)/printf "%s %s\\n" $$(md5 -q \1) \1/' \ -e "s/ == 0/ = 0/" -e "s/tar x$$/tar xf -/" -e "s/\/gdd/" \ ${WRKSRC}/tests/[a-z]_*/script @${REINPLACE_CMD} -e 's///' ${WRKSRC}/*/*.c @${REINPLACE_CMD} -e 's,/etc/blkid.tab,${ETCDIR}/blkid.tab,' ${WRKSRC}/misc/blkid* ${WRKSRC}/lib/blkid/blkidP.h @${REINPLACE_CMD} -E -e 's/__GNUC_PREREQ\>/__GNUC_PREREQ__/' ${WRKSRC}/*/*/*.[ch] ${WRKSRC}/*/*.c -.if empty(PORT_OPTIONS:MALLTESTS) -. for i in \ +. if empty(PORT_OPTIONS:MALLTESTS) +. for i in \ d_fallocate_blkmap \ f_baddir \ f_bbfile \ @@ -203,14 +185,15 @@ post-patch:: u_dryrun \ u_mke2fs_opt_offset @${MV} ${WRKSRC}/tests/${i} ${WRKSRC}/tests/disabled_test-${i} -. endfor -.endif -.if ${PORT_OPTIONS:MBASHTESTS} +. endfor +. endif +. if ${PORT_OPTIONS:MBASHTESTS} ${REINPLACE_CMD} -e 's}^SHELL *=.*}SHELL = ${_CHECK_SHELL}}' ${WRKSRC}/MCONFIG.in -.else -. for i in f_large_dir +. else +. for i in f_large_dir @${MV} ${WRKSRC}/tests/${i} ${WRKSRC}/tests/disabled_test-${i} -. endfor +. endfor +. endif .endif ############################################################## @@ -219,12 +202,6 @@ post-patch:: .if ${MASTERDIR} == ${.CURDIR} # NOTE: The previous .if block goes all the way to the end of the file. -.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 @@ -319,28 +296,7 @@ post-build: .endif post-install: - # pkg workaround time again; - # the whole purpose of this dance is to move the necessities for - # /etc/fstab fsck'ing into /sbin, and symlink to these guys - # 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 - # 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 ${LN} -fs e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext2 ${LN} -fs e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext3 ${LN} -fs e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext4 diff --git a/sysutils/e2fsprogs/distinfo b/sysutils/e2fsprogs-core/distinfo similarity index 100% rename from sysutils/e2fsprogs/distinfo rename to sysutils/e2fsprogs-core/distinfo diff --git a/sysutils/e2fsprogs/files/extrapatch-e2fsck_sigcatcher.c b/sysutils/e2fsprogs-core/files/extrapatch-e2fsck_sigcatcher.c similarity index 100% rename from sysutils/e2fsprogs/files/extrapatch-e2fsck_sigcatcher.c rename to sysutils/e2fsprogs-core/files/extrapatch-e2fsck_sigcatcher.c diff --git a/sysutils/e2fsprogs/files/extrapatch-no-sbrk b/sysutils/e2fsprogs-core/files/extrapatch-no-sbrk similarity index 100% rename from sysutils/e2fsprogs/files/extrapatch-no-sbrk rename to sysutils/e2fsprogs-core/files/extrapatch-no-sbrk diff --git a/sysutils/e2fsprogs/files/fix-ss_err.h.sed b/sysutils/e2fsprogs-core/files/fix-ss_err.h.sed similarity index 100% rename from sysutils/e2fsprogs/files/fix-ss_err.h.sed rename to sysutils/e2fsprogs-core/files/fix-ss_err.h.sed diff --git a/sysutils/e2fsprogs/files/fsck_ext2fs.8 b/sysutils/e2fsprogs-core/files/fsck_ext2fs.8 similarity index 100% rename from sysutils/e2fsprogs/files/fsck_ext2fs.8 rename to sysutils/e2fsprogs-core/files/fsck_ext2fs.8 diff --git a/sysutils/e2fsprogs/files/fsck_ext2fs.c b/sysutils/e2fsprogs-core/files/fsck_ext2fs.c similarity index 100% rename from sysutils/e2fsprogs/files/fsck_ext2fs.c rename to sysutils/e2fsprogs-core/files/fsck_ext2fs.c diff --git a/sysutils/e2fsprogs/files/patch-CVE-2022-1304 b/sysutils/e2fsprogs-core/files/patch-CVE-2022-1304 similarity index 100% rename from sysutils/e2fsprogs/files/patch-CVE-2022-1304 rename to sysutils/e2fsprogs-core/files/patch-CVE-2022-1304 diff --git a/sysutils/e2fsprogs/files/patch-ZZZ-g8535250a b/sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a similarity index 100% rename from sysutils/e2fsprogs/files/patch-ZZZ-g8535250a rename to sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a diff --git a/sysutils/e2fsprogs/files/patch-e2fsck__unix.c b/sysutils/e2fsprogs-core/files/patch-e2fsck__unix.c similarity index 100% rename from sysutils/e2fsprogs/files/patch-e2fsck__unix.c rename to sysutils/e2fsprogs-core/files/patch-e2fsck__unix.c diff --git a/sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c b/sysutils/e2fsprogs-core/files/patch-lib__uuid__gen_uuid.c similarity index 100% rename from sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c rename to sysutils/e2fsprogs-core/files/patch-lib__uuid__gen_uuid.c diff --git a/sysutils/e2fsprogs/files/patch-lib_blkid_devname.c b/sysutils/e2fsprogs-core/files/patch-lib_blkid_devname.c similarity index 100% rename from sysutils/e2fsprogs/files/patch-lib_blkid_devname.c rename to sysutils/e2fsprogs-core/files/patch-lib_blkid_devname.c diff --git a/sysutils/e2fsprogs/files/patch-lib_et_com__err.3 b/sysutils/e2fsprogs-core/files/patch-lib_et_com__err.3 similarity index 100% rename from sysutils/e2fsprogs/files/patch-lib_et_com__err.3 rename to sysutils/e2fsprogs-core/files/patch-lib_et_com__err.3 diff --git a/sysutils/e2fsprogs/files/patch-lib_support_plausible.c b/sysutils/e2fsprogs-core/files/patch-lib_support_plausible.c similarity index 100% rename from sysutils/e2fsprogs/files/patch-lib_support_plausible.c rename to sysutils/e2fsprogs-core/files/patch-lib_support_plausible.c diff --git a/sysutils/e2fsprogs/files/patch-lib_support_sort__r.h b/sysutils/e2fsprogs-core/files/patch-lib_support_sort__r.h similarity index 100% rename from sysutils/e2fsprogs/files/patch-lib_support_sort__r.h rename to sysutils/e2fsprogs-core/files/patch-lib_support_sort__r.h diff --git a/sysutils/e2fsprogs/files/patch-misc__Makefile.in b/sysutils/e2fsprogs-core/files/patch-misc__Makefile.in similarity index 100% rename from sysutils/e2fsprogs/files/patch-misc__Makefile.in rename to sysutils/e2fsprogs-core/files/patch-misc__Makefile.in diff --git a/sysutils/e2fsprogs/files/patch-misc_blkid.8.in b/sysutils/e2fsprogs-core/files/patch-misc_blkid.8.in similarity index 100% rename from sysutils/e2fsprogs/files/patch-misc_blkid.8.in rename to sysutils/e2fsprogs-core/files/patch-misc_blkid.8.in diff --git a/sysutils/e2fsprogs/files/patch-misc_e2fuzz.c b/sysutils/e2fsprogs-core/files/patch-misc_e2fuzz.c similarity index 100% rename from sysutils/e2fsprogs/files/patch-misc_e2fuzz.c rename to sysutils/e2fsprogs-core/files/patch-misc_e2fuzz.c diff --git a/sysutils/e2fsprogs/files/patch-tests_Makefile.in b/sysutils/e2fsprogs-core/files/patch-tests_Makefile.in similarity index 100% rename from sysutils/e2fsprogs/files/patch-tests_Makefile.in rename to sysutils/e2fsprogs-core/files/patch-tests_Makefile.in diff --git a/sysutils/e2fsprogs/files/unwanted b/sysutils/e2fsprogs-core/files/unwanted similarity index 100% rename from sysutils/e2fsprogs/files/unwanted rename to sysutils/e2fsprogs-core/files/unwanted diff --git a/sysutils/e2fsprogs/pkg-descr b/sysutils/e2fsprogs-core/pkg-descr similarity index 100% rename from sysutils/e2fsprogs/pkg-descr rename to sysutils/e2fsprogs-core/pkg-descr diff --git a/sysutils/e2fsprogs/pkg-install b/sysutils/e2fsprogs-core/pkg-install similarity index 100% rename from sysutils/e2fsprogs/pkg-install rename to sysutils/e2fsprogs-core/pkg-install diff --git a/sysutils/e2fsprogs/pkg-message b/sysutils/e2fsprogs-core/pkg-message similarity index 100% rename from sysutils/e2fsprogs/pkg-message rename to sysutils/e2fsprogs-core/pkg-message diff --git a/sysutils/e2fsprogs/pkg-plist b/sysutils/e2fsprogs-core/pkg-plist similarity index 98% rename from sysutils/e2fsprogs/pkg-plist rename to sysutils/e2fsprogs-core/pkg-plist index a0e5ddf05f4f8..2a94557177273 100644 --- a/sysutils/e2fsprogs/pkg-plist +++ b/sysutils/e2fsprogs-core/pkg-plist @@ -1,5 +1,3 @@ -%%ROOTSBIN%%/sbin/e2fsck -%%ROOTSBIN%%/sbin/fsck_ext2fs bin/chattr bin/e2fsprogs-compile_et %%FUSEFS%%bin/fuse2fs