From 93a93e9a3b53c1a73142a305ea1f8136846942ee Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 22 Dec 2021 14:08:05 +0000 Subject: gentoo resync : 22.12.2021 --- sys-fs/zfs/Manifest | 15 +- sys-fs/zfs/files/2.1.2-musl-tests.patch | 58 ++++++ sys-fs/zfs/files/2.1.2-openrc-vendor.patch | 42 ++++ sys-fs/zfs/files/2.1.2-scrub-timers.patch | 147 ++++++++++++++ sys-fs/zfs/zfs-0.8.6-r1.ebuild | 246 ----------------------- sys-fs/zfs/zfs-0.8.6-r2.ebuild | 246 +++++++++++++++++++++++ sys-fs/zfs/zfs-2.0.6-r1.ebuild | 8 +- sys-fs/zfs/zfs-2.1.1-r5.ebuild | 303 ---------------------------- sys-fs/zfs/zfs-2.1.2-r1.ebuild | 304 +++++++++++++++++++++++++++++ sys-fs/zfs/zfs-9999.ebuild | 11 +- 10 files changed, 817 insertions(+), 563 deletions(-) create mode 100644 sys-fs/zfs/files/2.1.2-musl-tests.patch create mode 100644 sys-fs/zfs/files/2.1.2-openrc-vendor.patch create mode 100644 sys-fs/zfs/files/2.1.2-scrub-timers.patch delete mode 100644 sys-fs/zfs/zfs-0.8.6-r1.ebuild create mode 100644 sys-fs/zfs/zfs-0.8.6-r2.ebuild delete mode 100644 sys-fs/zfs/zfs-2.1.1-r5.ebuild create mode 100644 sys-fs/zfs/zfs-2.1.2-r1.ebuild (limited to 'sys-fs/zfs') diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest index fd5db0e00da8..c9a9350056b8 100644 --- a/sys-fs/zfs/Manifest +++ b/sys-fs/zfs/Manifest @@ -1,12 +1,15 @@ AUX 2.0.4-scrub-timers.patch 2873 BLAKE2B 40986e258ddc3c5b4dfdebc8c2126fbb2c0ff9ac947700fa30c547795612fb98b2778f364ee10ec47c05a6837c4d4129918a6efe7cf3ab5854910e1892a3e348 SHA512 0e557974fe8992a7b0e6c15e46fac55d265e469aa13f85e85b0abe449b5fe2e8c51cf56510863fa2e33c060f2b38c0c43a910a740172ef1d4c42c0aa85e04ab9 +AUX 2.1.2-musl-tests.patch 1923 BLAKE2B 0029cba42b7914166cec894e30730f205f2c1508dd7f0c46b2567c365b5c6daa1d65cfc9ede9180f4831c924760b6a9a9ac81972e991c439148ad21bfcb3dfda SHA512 be96efa5b0b407388fe4f0066c5516a1b882bb158376d072373d6c73f2dc1414a61eda925fa12a0708d15e5c791c590f4b83809262d21e2160a0d931e608ab80 +AUX 2.1.2-openrc-vendor.patch 1469 BLAKE2B d8c20bbeee95db8eb4c26e6d5b1798e89c3b152c03ddc852dea6810fb170f70e77a200bdbda00953a792d05467f268260ccfcc1d1b20576bfb21c65fde6e93df SHA512 ae5709acef0531146f7ac020fd4038dc76f99dd43c8322b3934522c2e74f90d60106c30de679cb9aaaa3f6ece00ed93e490c0787e573fc0871c30d73842ea04e +AUX 2.1.2-scrub-timers.patch 4260 BLAKE2B 1921e617aa97cb45a60b9f9649adb9ce2ea01a834e452c2af43360b04174ca92a8d2bf1b6e6ad7ebdeff97b82499cadcd996ecde2986d2f05102358f63d2a2d9 SHA512 f12865ebb649c7bba90e5f4ba2f901bb49c9d9d7d71d80bfa7402316773132a8a12ddd77de4bb60007aa5c5c050472d9bded410893a9ae5d9a9e87e0d2f03a40 AUX bash-completion-sudo.patch 905 BLAKE2B 92e58ff097893436d589f7df0134e09d2e0699ae82618c4c14caf4b26cb466367a5372d7e0a030aa857d024e3db0faef4bb5fa32c54f41f0d4766693a95ba5ab SHA512 e53c79401f4c634a94af27b2f88a40440b68a4c192fd1944668786650aaa0f1f08dff851dca5b9666ce8bba1f0e2b7cb195314cd9d1314c9bab1194d03122319 DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 3a83303b016ec4259c286af8a9ceb281829d26508d411df91dd94193bca8c3155ef0ba63604e95f6add5f0c6cf6d100b0f567efc33b6c484c9ff811924da6ccd SHA512 52a5576eed21868b2a3d63d05d3d8c35b5e59ee88c7ddab1dc070644539f9acd56bde43ba5e965ad951a6d50a014fb429a7977d2ab1a2bfcadd92ea78dd57bf8 DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a SHA512 123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c -DIST zfs-2.1.1.tar.gz 34836374 BLAKE2B 09ee6bd30e8266342bd975454086049c3fd9142e7dacfe52166575c20e3c92688f9b457d75b2a2068fc281e65f78e1d47450545504cdf8bc31e23663545d7800 SHA512 b69ce764a9f7438ec2c90f86be02abfd684c67cd38de876374e3e6f4b2f82a75d86fa70205def2ba454ad27e52ec8d955ebc4ba456e91d397129a54ea849c19c -DIST zfs-2.1.1.tar.gz.asc 195 BLAKE2B d886e7dc74270228f98dfc5ca85bbbe897d5a87a5ae8bbfde28e2af1b36218227bc9f1b5902e97beebe160a298857d6e4673829d87cd8039332dc1858cfcffc0 SHA512 d76956b5c1bd547a319e70dd33d50beae39f65fca54532731426d2ef209385a556c51b3936051f75bc3800623c42da5b8d279c51f501a896f5fdfb7b4ed7fb94 -EBUILD zfs-0.8.6-r1.ebuild 6507 BLAKE2B f43f8cb39ab74e8ab1abef2e42a9c859eeefb27a0c0f301235bcac75d4a865d94d98d9c05762ab18a04e9e981c626734e6d9ee01224c5af711179e06b385bf0a SHA512 12733f40599722d4ff1390f6044b9bbe3e4a4596b84ce922b59c785ff440d5951e2fa7505cd9e5f4b9193b40d88d8e30f99e1c8b83678cff36c796f2014ca42c -EBUILD zfs-2.0.6-r1.ebuild 8342 BLAKE2B 837fb68deaecc8923cbf780bd0600cdbc0207fa765ba00084041886cde246fa0b680c824d19f5e7705da52acbec8ae34ea5f0e9318aa274c61720c671cd01f32 SHA512 10dfd698fd0fd149ab8a1ecfb468240f9a797e8c0536a242da4a948a0de3045c4608a40f685013d78a35f2c1a5fc675b2da48a0f329ecaff74b537ee35943d4c -EBUILD zfs-2.1.1-r5.ebuild 8521 BLAKE2B 1ba53dcecbd12d37e83466fe87b96414e273522c459a89ce021288347cdd6bd33c82cc56c9d96777097c2238657c2e624487c2e0d8427b7be52a992cf33b294e SHA512 ca4c86fb5d4ac37ebb5ba5f5b827abae90d5140df3c3f2abb146c37c9d9d85defb9006ad25c762023fa7d2d02798c8e05a0af1bf31265e99c4d2cfe0a2037b91 -EBUILD zfs-9999.ebuild 8446 BLAKE2B f5803888ba025451f15285f1f27ee55a9945e40a09b5a5caffed47ca0fe648df46f5f9a393253f465db9878a310949f4b2b7cf4f014b119175ec9d55e324b04f SHA512 bca04d73af011baa972df8085eda617d9baeddea86f29f0b1b74f1b9dc166476070ef0aae2863daeeba49ad7f3d9a959f5a2680bc69232e26cf4ad0bb813305b +DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584 SHA512 3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102 +DIST zfs-2.1.2.tar.gz.asc 836 BLAKE2B 8f5666f5c3d7016a4d79191f42d0a220fe8c654a0d64e3da3b575644fe52c83dcb9f9ef49ba0553771a127bba44e2802f1d366a7a38f670e73612deef76755c3 SHA512 da6bfccd19a249a6891f5e1de6c4b332e98ce4f125f638c046b9cedac3fd79c56a99dd9a620105a40741e5f04b382f5d5996b56cbe576fb268b31e57e0fed6eb +EBUILD zfs-0.8.6-r2.ebuild 6508 BLAKE2B 8751f1d3dda492fbdea68898ef30390c90df7cec9fe47a589916cf7beddf7bfa486f14c39ecd35f9ae1abce78435934a70ff761cc789b3ef2fdf5ca840102988 SHA512 e7fe2f7ca4a44aa4cf6f71642c8da4d581d4f7fd80466b688e5f6404920fab93ce110554858477a9705e6a434ed097e3a7b97ab0b77da663227c18c1e623c330 +EBUILD zfs-2.0.6-r1.ebuild 8342 BLAKE2B dad25c713d73cf005157d8112d1006d849f0fb23f8ac3622d126d0e6e6565f46fb2ca390ff797038cf638179bf3321b61494d9e0eac956e11f00cc22ef374041 SHA512 269cc5deecf2778c49db1e61a4dd0b83e5efb34b52c28008cb1967233a596f5de7163a810a2ab1cf634df53cd48557cecbf960f3bc8e37a348370796d0563944 +EBUILD zfs-2.1.2-r1.ebuild 8595 BLAKE2B 83c3496d1d9b21a76294445155e5c6090124ba364c953965d5d5a31499b94ddd73440387178044850725caaa37f5bfcaae20abf57ec940f76664a829b849b0b3 SHA512 5f5894ee61c06a8be07ce4aaca11f1a21657901df0c95877151505383f85bcd1a19da1894323ca4df14c42fa546da159cc3541c8d756d8f3bce8553e40bf347e +EBUILD zfs-9999.ebuild 8583 BLAKE2B 7a7c9f0c247bee1230969f16e82c62ae92a9d88f9c4682e2cdcf0a41a80eb9bbd6e3aa638d6b06fb620f0f8bdd918c07fa59f8644aeb1898f1c5eebb012ac897 SHA512 6efc5e8a87e1c53efe92c6c6bf8066e497b6d6ad404b4829104799d3398a9aa38a23de60e04b4d472de3450bea1a6c61bdb924af53e957f95e803e4e69a40733 MISC metadata.xml 1001 BLAKE2B 8e94a0d8e1afff064b3f8e4a7e3e6d34ad12d5fa550df2f3371b1593b0938b3ea0dbfdcd2e40023f4e91bbe12cf1f3633d92977e4f5b4ee10b56d5040f065f90 SHA512 fc7ba310676715f5daa59b30107560f9ba61cc7dc79eb74ff866e4c8f36bd6a414474a216f5c833dc46c6426e4c80a6672b488fab4178a0c00a47b0de1caf6eb diff --git a/sys-fs/zfs/files/2.1.2-musl-tests.patch b/sys-fs/zfs/files/2.1.2-musl-tests.patch new file mode 100644 index 000000000000..3d2c563f8c51 --- /dev/null +++ b/sys-fs/zfs/files/2.1.2-musl-tests.patch @@ -0,0 +1,58 @@ +From 123c87b3c2d75636da79f57a4b0ed60d2a3133a8 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev +Date: Mon, 20 Dec 2021 12:25:11 -0800 +Subject: [PATCH] zfs-test/mmap_seek: fix build on musl + +it needs linux/fs.h for SEEK_DATA and friends + +without linux/fs.h: + +``` +mmap_seek.c +mmap_seek.c: In function 'seek_data': +mmap_seek.c:37:40: error: 'SEEK_DATA' undeclared (first use in this function); +did you mean 'SEEK_SET'? + 37 | off_t data_offset = lseek(fd, offset, SEEK_DATA); +``` + +also it needs sys/sysmacros.h for P2ROUNDUP +without it: + +``` +mmap_seek.c: In function 'main': +mmap_seek.c:122:19: warning: +implicit declaration of function 'P2ROUNDUP' [-Wimplicit-function-declaration] + 122 | seek_hole(fd, 0, P2ROUNDUP(file_size / 2, block_size)); + | ^~~~~~~~~ +powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.o: in function `main': +mmap_seek.c:(.text.startup+0x1b8): undefined reference to `P2ROUNDUP' +powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x1d8): + undefined reference to `P2ROUNDUP' +powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x21c): + undefined reference to `P2ROUNDUP' +collect2: error: ld returned 1 exit status +make[5]: *** [Makefile:754: mmap_seek] Error 1 +``` + +Closes: https://github.com/openzfs/zfs/pull/12891 +Signed-off-by: Georgy Yakovlev +--- + tests/zfs-tests/cmd/mmap_seek/mmap_seek.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c +index f476e1dba9a..bb36527aafe 100644 +--- a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c ++++ b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c +@@ -29,7 +29,11 @@ + #include + #include + #include ++#include + #include ++#ifdef __linux__ ++#include ++#endif + + static void + seek_data(int fd, off_t offset, off_t expected) diff --git a/sys-fs/zfs/files/2.1.2-openrc-vendor.patch b/sys-fs/zfs/files/2.1.2-openrc-vendor.patch new file mode 100644 index 000000000000..abe222aa5b84 --- /dev/null +++ b/sys-fs/zfs/files/2.1.2-openrc-vendor.patch @@ -0,0 +1,42 @@ +From 6ef28c526ba7199a3740407d764b6505618ca8ba Mon Sep 17 00:00:00 2001 +From: Peter Levine +Date: Fri, 29 Oct 2021 18:34:37 -0400 +Subject: [PATCH] Set DEFAULT_INIT_SHELL to /sbin/openrc-run for Gentoo and + Alpine + +Gentoo and Alpine always set the rc init scripts' shebang to +#!/sbin/openrc-run, whether or not openrc is installed. + +Reviewed-by: Brian Behlendorf +Signed-off-by: Peter Levine +Closes #12683 +Closes #12692 +--- + config/zfs-build.m4 | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 +index 27041c054c2..ec4a2026bf5 100644 +--- a/config/zfs-build.m4 ++++ b/config/zfs-build.m4 +@@ -564,15 +564,11 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ + *) DEFAULT_INIT_SCRIPT=lsb ;; + esac + +- # On gentoo, it's possible that OpenRC isn't installed. Check if +- # /sbin/openrc-run exists, and if not, fall back to generic defaults. +- +- DEFAULT_INIT_SHELL="/bin/sh" +- AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [ +- AS_IF([test -x "/sbin/openrc-run"], +- [DEFAULT_INIT_SHELL="/sbin/openrc-run"], +- [DEFAULT_INIT_SCRIPT=lsb]) +- ]) ++ case "$VENDOR" in ++ gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";; ++ alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";; ++ *) DEFAULT_INIT_SHELL="/bin/sh" ;; ++ esac + + AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL]) + AC_SUBST(DEFAULT_INIT_SCRIPT) diff --git a/sys-fs/zfs/files/2.1.2-scrub-timers.patch b/sys-fs/zfs/files/2.1.2-scrub-timers.patch new file mode 100644 index 000000000000..f1c5b5699f62 --- /dev/null +++ b/sys-fs/zfs/files/2.1.2-scrub-timers.patch @@ -0,0 +1,147 @@ +From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev +Date: Sat, 22 May 2021 22:27:39 -0700 +Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers + +timers can be enabled as follows: + +systemctl enable zfs-scrub-weekly@rpool.timer --now +systemctl enable zfs-scrub-monthly@datapool.timer --now + +Each timer will pull in zfs-scrub@${poolname}.service, which is not +schedule-specific. + +Signed-off-by: Georgy Yakovlev +--- + etc/systemd/system/.gitignore | 1 + + etc/systemd/system/Makefile.am | 5 ++++- + etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ + etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ + etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ + 5 files changed, 43 insertions(+), 1 deletion(-) + create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in + create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in + create mode 100644 etc/systemd/system/zfs-scrub@.service.in + +diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am +index c374a52ac..5e65e1db4 100644 +--- a/etc/systemd/system/Makefile.am ++++ b/etc/systemd/system/Makefile.am +@@ -12,7 +12,10 @@ systemdunit_DATA = \ + zfs-volume-wait.service \ + zfs-import.target \ + zfs-volumes.target \ +- zfs.target ++ zfs.target \ ++ zfs-scrub-monthly@.timer \ ++ zfs-scrub-weekly@.timer \ ++ zfs-scrub@.service + + SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) + +diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in +new file mode 100644 +index 000000000..903068468 +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in +@@ -0,0 +1,12 @@ ++[Unit] ++Description=Monthly zpool scrub timer for %i ++Documentation=man:zpool-scrub(8) ++ ++[Timer] ++OnCalendar=monthly ++Persistent=true ++RandomizedDelaySec=1h ++Unit=zfs-scrub@%i.service ++ ++[Install] ++WantedBy=timers.target +diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in +new file mode 100644 +index 000000000..ede699500 +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in +@@ -0,0 +1,12 @@ ++[Unit] ++Description=Weekly zpool scrub timer for %i ++Documentation=man:zpool-scrub(8) ++ ++[Timer] ++OnCalendar=weekly ++Persistent=true ++RandomizedDelaySec=1h ++Unit=zfs-scrub@%i.service ++ ++[Install] ++WantedBy=timers.target +diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in +new file mode 100644 +index 000000000..c04ac292a +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub@.service.in +@@ -0,0 +1,14 @@ ++[Unit] ++Description=zpool scrub on %i ++Documentation=man:zpool-scrub(8) ++Requires=zfs.target ++After=zfs.target ++ConditionACPower=true ++ConditionPathIsDirectory=/sys/module/zfs ++ ++[Service] ++ExecStart=/bin/sh -c '\ ++if @sbindir@/zpool status %i | grep "scrub in progress"; then\ ++exec @sbindir@/zpool wait -t scrub %i;\ ++else exec @sbindir@/zpool scrub -w %i; fi' ++ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' +-- +2.34.1 + +From 4bac4eae0345fb322337b66a9b4923e9f3f52b0f Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev +Date: Fri, 29 Oct 2021 21:40:50 -0700 +Subject: [PATCH 2/2] zpool-scrub.8: add PERIODIC SCRUB section + +Signed-off-by: Georgy Yakovlev +--- + man/man8/zpool-scrub.8 | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/man/man8/zpool-scrub.8 b/man/man8/zpool-scrub.8 +index 768f71539..69ae825b6 100644 +--- a/man/man8/zpool-scrub.8 ++++ b/man/man8/zpool-scrub.8 +@@ -116,8 +116,29 @@ scanned at 100M/s, and 68.4M of that file data has been + scrubbed sequentially at 10.0M/s. + .El + .El ++.Sh PERIODIC SCRUB ++On machines using systemd, scrub timers can be enabled on per-pool basis. ++.Nm weekly ++and ++.Nm monthly ++timer units are provided. ++.Bl -tag -width Ds ++.It Xo ++.Xc ++.Nm systemctl ++.Cm enable ++.Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer ++.Cm --now ++.It Xo ++.Xc ++.Nm systemctl ++.Cm enable ++.Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer ++.Cm --now ++.El + . + .Sh SEE ALSO ++.Xr systemd.timer 5 , + .Xr zpool-iostat 8 , + .Xr zpool-resilver 8 , + .Xr zpool-status 8 +-- +2.34.1 + diff --git a/sys-fs/zfs/zfs-0.8.6-r1.ebuild b/sys-fs/zfs/zfs-0.8.6-r1.ebuild deleted file mode 100644 index b21a59267cb9..000000000000 --- a/sys-fs/zfs/zfs-0.8.6-r1.ebuild +++ /dev/null @@ -1,246 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_SETUPTOOLS=manual -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]] ; then - inherit git-r3 linux-mod - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" -else - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${P}/${P}.tar.gz" - KEYWORDS="amd64 arm64 ppc64" -fi - -LICENSE="BSD-2 CDDL MIT" -SLOT="0/2" # just libzfs soname major for now. possible candidates: libuutil, libzpool, libnvpair -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc - sys-apps/util-linux - sys-libs/zlib - virtual/awk - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - ) -" - -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -src_prepare() { - default - - if [[ ${PV} == "9999" ]]; then - eautoreconf - else - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-systemd - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" - $(use_enable debug) - $(use_enable nls) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - CONFIG_SHELL="${EPREFIX}/bin/bash" econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core - - use test-suite || rm -rf "${ED}/usr/share/zfs" - - find "${ED}/" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "root on zfs requires initramfs to boot" - elog "the following packages known to provide one and tested on regular basis:" - elog " sys-kernel/dracut" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/lib/systemd/system-preset/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/sys-fs/zfs/zfs-0.8.6-r2.ebuild b/sys-fs/zfs/zfs-0.8.6-r2.ebuild new file mode 100644 index 000000000000..df9295794bab --- /dev/null +++ b/sys-fs/zfs/zfs-0.8.6-r2.ebuild @@ -0,0 +1,246 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_SETUPTOOLS=manual +PYTHON_COMPAT=( python3_{7,8,9} ) + +inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info systemd udev usr-ldscript + +DESCRIPTION="Userland utilities for ZFS Linux kernel module" +HOMEPAGE="https://github.com/openzfs/zfs" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 linux-mod + EGIT_REPO_URI="https://github.com/openzfs/zfs.git" +else + SRC_URI="https://github.com/openzfs/${PN}/releases/download/${P}/${P}.tar.gz" + KEYWORDS="amd64 arm64 ppc64" +fi + +LICENSE="BSD-2 CDDL MIT" +SLOT="0/2" # just libzfs soname major for now. possible candidates: libuutil, libzpool, libnvpair +IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" + +DEPEND=" + net-libs/libtirpc:= + sys-apps/util-linux + sys-libs/zlib + virtual/awk + virtual/libudev:= + dev-libs/openssl:0= + !minimal? ( ${PYTHON_DEPS} ) + python? ( + virtual/python-cffi[${PYTHON_USEDEP}] + ) +" + +BDEPEND="virtual/awk + virtual/pkgconfig + nls? ( sys-devel/gettext ) + python? ( + dev-python/setuptools[${PYTHON_USEDEP}] + ) +" + +RDEPEND="${DEPEND} + !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) + !prefix? ( virtual/udev ) + sys-fs/udev-init-scripts + virtual/awk + dist-kernel? ( virtual/dist-kernel:= ) + rootfs? ( + app-arch/cpio + app-misc/pax-utils + !" + eerror " Block devices --->" + eerror " [X] Loopback device support" + fi + fi + fi + fi +} + +src_prepare() { + default + + if [[ ${PV} == "9999" ]]; then + eautoreconf + else + # Set revision number + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" + fi + + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_prepare + popd >/dev/null || die + fi + + # prevent errors showing up on zfs-mount stop, #647688 + # openrc will unmount all filesystems anyway. + sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die +} + +src_configure() { + use custom-cflags || strip-flags + use minimal || python_setup + + local myconf=( + --bindir="${EPREFIX}/bin" + --enable-shared + --enable-systemd + --enable-sysvinit + --localstatedir="${EPREFIX}/var" + --sbindir="${EPREFIX}/sbin" + --with-config=user + --with-dracutdir="${EPREFIX}/usr/lib/dracut" + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + --with-udevdir="$(get_udevdir)" + --with-systemdunitdir="$(systemd_get_systemunitdir)" + --with-systemdpresetdir="$(systemd_get_systempresetdir)" + $(use_enable debug) + $(use_enable nls) + $(use_enable python pyzfs) + --disable-static + $(usex minimal --without-python --with-python="${EPYTHON}") + ) + + CONFIG_SHELL="${EPREFIX}/bin/bash" econf "${myconf[@]}" +} + +src_compile() { + default + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_compile + popd >/dev/null || die + fi +} + +src_install() { + default + + gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core + + use test-suite || rm -rf "${ED}/usr/share/zfs" + + find "${ED}/" -name '*.la' -delete || die + + dobashcomp contrib/bash_completion.d/zfs + bashcomp_alias zfs zpool + + # strip executable bit from conf.d file + fperms 0644 /etc/conf.d/zfs + + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_install + popd >/dev/null || die + fi + + # enforce best available python implementation + use minimal || python_fix_shebang "${ED}/bin" +} + +pkg_postinst() { + # we always need userspace utils in sync with zfs-kmod + # so force initrd update for userspace as well, to avoid + # situation when zfs-kmod trigger initrd rebuild before + # userspace component is rebuilt + # KV_* variables are provided by linux-info.eclass + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + + if use rootfs; then + if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then + elog "root on zfs requires initramfs to boot" + elog "the following packages known to provide one and tested on regular basis:" + elog " sys-kernel/dracut" + elog " sys-kernel/genkernel" + fi + fi + + if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then + einfo "Adding ${P} to the module database to ensure that the" + einfo "kernel modules and userland utilities stay in sync." + update_moduledb + fi + + if systemd_is_booted || has_version sys-apps/systemd; then + einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" + einfo "for default zfs systemd service configuration" + else + [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ + einfo "You should add zfs-import to the boot runlevel." + [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ + einfo "You should add zfs-mount to the boot runlevel." + [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ + einfo "You should add zfs-share to the default runlevel." + [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ + einfo "You should add zfs-zed to the default runlevel." + fi +} + +pkg_postrm() { + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then + remove_moduledb + fi +} diff --git a/sys-fs/zfs/zfs-2.0.6-r1.ebuild b/sys-fs/zfs/zfs-2.0.6-r1.ebuild index c955a9a96516..b90eb7e6aea6 100644 --- a/sys-fs/zfs/zfs-2.0.6-r1.ebuild +++ b/sys-fs/zfs/zfs-2.0.6-r1.ebuild @@ -37,7 +37,7 @@ SLOT="0/4" IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" DEPEND=" - net-libs/libtirpc + net-libs/libtirpc:= sys-apps/util-linux sys-libs/zlib virtual/libudev:= @@ -58,7 +58,7 @@ BDEPEND="virtual/awk " if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" + BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" fi # awk is used for some scripts, completions, and the Dracut module @@ -206,7 +206,7 @@ src_configure() { --with-pamconfigsdir="${EPREFIX}/unwanted_files" --with-pammoduledir="$(getpam_mod_dir)" --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" + --with-systemdpresetdir="$(systemd_get_systempresetdir)" --with-vendor=gentoo $(use_enable debug) $(use_enable nls) @@ -281,7 +281,7 @@ pkg_postinst() { fi if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/lib/systemd/system-preset/50-zfs.preset" + einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" einfo "for default zfs systemd service configuration" else [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ diff --git a/sys-fs/zfs/zfs-2.1.1-r5.ebuild b/sys-fs/zfs/zfs-2.1.1-r5.ebuild deleted file mode 100644 index 2f2920a75e08..000000000000 --- a/sys-fs/zfs/zfs-2.1.1-r5.ebuild +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_SETUPTOOLS=manual -PYTHON_COMPAT=( python3_{8,9,10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" -else - VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/lib/systemd/system-preset/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/sys-fs/zfs/zfs-2.1.2-r1.ebuild b/sys-fs/zfs/zfs-2.1.2-r1.ebuild new file mode 100644 index 000000000000..a5b0419a7ed8 --- /dev/null +++ b/sys-fs/zfs/zfs-2.1.2-r1.ebuild @@ -0,0 +1,304 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_SETUPTOOLS=manual +PYTHON_COMPAT=( python3_{8,9,10} ) + +inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript + +DESCRIPTION="Userland utilities for ZFS Linux kernel module" +HOMEPAGE="https://github.com/openzfs/zfs" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 linux-mod + EGIT_REPO_URI="https://github.com/openzfs/zfs.git" +else + VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc + inherit verify-sig + + MY_P="${P/_rc/-rc}" + SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" + SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" + S="${WORKDIR}/${P%_rc?}" + + if [[ ${PV} != *_rc* ]]; then + KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv" + fi +fi + +LICENSE="BSD-2 CDDL MIT" +# just libzfs soname major for now. +# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. +# see libsoversion_check() below as well +SLOT="0/5" +IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" + +DEPEND=" + net-libs/libtirpc:= + sys-apps/util-linux + sys-libs/zlib + virtual/libudev:= + dev-libs/openssl:0= + !minimal? ( ${PYTHON_DEPS} ) + pam? ( sys-libs/pam ) + python? ( + virtual/python-cffi[${PYTHON_USEDEP}] + ) +" + +BDEPEND="virtual/awk + virtual/pkgconfig + nls? ( sys-devel/gettext ) + python? ( + dev-python/setuptools[${PYTHON_USEDEP}] + || ( + dev-python/packaging[${PYTHON_USEDEP}] + dev-python/distlib[${PYTHON_USEDEP}] + ) + ) +" + +if [[ ${PV} != "9999" ]] ; then + BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" +fi + +# awk is used for some scripts, completions, and the Dracut module +RDEPEND="${DEPEND} + !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) + !prefix? ( virtual/udev ) + sys-fs/udev-init-scripts + virtual/awk + dist-kernel? ( virtual/dist-kernel:= ) + rootfs? ( + app-arch/cpio + app-misc/pax-utils + !" + eerror " Block devices --->" + eerror " [X] Loopback device support" + fi + fi + fi + fi +} + +libsoversion_check() { + local bugurl libzfs_sover + bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" + + libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ + | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" + libzfs_sover="${libzfs_sover%%:*}" + + if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then + echo + eerror "BUG BUG BUG BUG BUG BUG BUG BUG" + eerror "ebuild subslot does not match libzfs soversion!" + eerror "libzfs soversion: ${libzfs_sover}" + eerror "ebuild value: $(ver_cut 2 ${SLOT})" + eerror "This is a bug in the ebuild, please use the following URL to report it" + eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" + echo + # we want to abort for releases, but just print a warning for live ebuild + # to keep package installable + [[ ${PV} == "9999" ]] || die + fi +} + +src_prepare() { + default + libsoversion_check + + # Run unconditionally (bug #792627) + eautoreconf + + if [[ ${PV} != "9999" ]]; then + # Set revision number + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" + fi + + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_prepare + popd >/dev/null || die + fi + + # prevent errors showing up on zfs-mount stop, #647688 + # openrc will unmount all filesystems anyway. + sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die +} + +src_configure() { + use custom-cflags || strip-flags + use minimal || python_setup + + local myconf=( + --bindir="${EPREFIX}/bin" + --enable-shared + --enable-sysvinit + --localstatedir="${EPREFIX}/var" + --sbindir="${EPREFIX}/sbin" + --with-config=user + --with-dracutdir="${EPREFIX}/usr/lib/dracut" + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + --with-udevdir="$(get_udevdir)" + --with-pamconfigsdir="${EPREFIX}/unwanted_files" + --with-pammoduledir="$(getpam_mod_dir)" + --with-systemdunitdir="$(systemd_get_systemunitdir)" + --with-systemdpresetdir="$(systemd_get_systempresetdir)" + --with-vendor=gentoo + # Building zfs-mount-generator.c on musl breaks as strndupa + # isn't available. But systemd doesn't support musl anyway, so + # just disable building it. + $(use_enable !elibc_musl systemd) + $(use_enable debug) + $(use_enable nls) + $(use_enable pam) + $(use_enable python pyzfs) + --disable-static + $(usex minimal --without-python --with-python="${EPYTHON}") + ) + + econf "${myconf[@]}" +} + +src_compile() { + default + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_compile + popd >/dev/null || die + fi +} + +src_install() { + default + + gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool + + use pam && { rm -rv "${ED}/unwanted_files" || die ; } + + use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } + + find "${ED}" -name '*.la' -delete || die + + dobashcomp contrib/bash_completion.d/zfs + bashcomp_alias zfs zpool + + # strip executable bit from conf.d file + fperms 0644 /etc/conf.d/zfs + + if use python; then + pushd contrib/pyzfs >/dev/null || die + distutils-r1_src_install + popd >/dev/null || die + fi + + # enforce best available python implementation + use minimal || python_fix_shebang "${ED}/bin" +} + +pkg_postinst() { + # we always need userspace utils in sync with zfs-kmod + # so force initrd update for userspace as well, to avoid + # situation when zfs-kmod trigger initrd rebuild before + # userspace component is rebuilt + # KV_* variables are provided by linux-info.eclass + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + + if use rootfs; then + if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then + elog "Root on zfs requires an initramfs to boot" + elog "The following packages provide one and are tested on a regular basis:" + elog " sys-kernel/dracut" + elog " sys-kernel/genkernel" + fi + fi + + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then + einfo "Adding ${P} to the module database to ensure that the" + einfo "kernel modules and userland utilities stay in sync." + update_moduledb + fi + + if systemd_is_booted || has_version sys-apps/systemd; then + einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" + einfo "for default zfs systemd service configuration" + else + [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ + einfo "You should add zfs-import to the boot runlevel." + [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ + einfo "You should add zfs-mount to the boot runlevel." + [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ + einfo "You should add zfs-share to the default runlevel." + [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ + einfo "You should add zfs-zed to the default runlevel." + fi +} + +pkg_postrm() { + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then + remove_moduledb + fi +} diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild index 2349a5a20d00..9a69934d3bb9 100644 --- a/sys-fs/zfs/zfs-9999.ebuild +++ b/sys-fs/zfs/zfs-9999.ebuild @@ -37,7 +37,7 @@ SLOT="0/5" IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" DEPEND=" - net-libs/libtirpc + net-libs/libtirpc:= sys-apps/util-linux sys-libs/zlib virtual/libudev:= @@ -62,7 +62,7 @@ BDEPEND="virtual/awk " if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" + BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" fi # awk is used for some scripts, completions, and the Dracut module @@ -78,6 +78,7 @@ RDEPEND="${DEPEND} !