2022-12-14 04:33:05 +03:00
|
|
|
PHONY += deb-kmod deb-dkms deb-utils deb deb-local native-deb-local \
|
|
|
|
native-deb-utils native-deb-kmod native-deb
|
Fix parallel make srpm
When building srpm using make -j, each of the recursive makes invoked to
build srpm-{dkms,kmod,utils} will build the dist target. This is both
unnecessary, and also has a very good chance of breaking when they race
trying to build gitrev.
Fix this by make dist a prerequisite of srpm-{dkms,kmod,utils} instead
of srpm-common, so that it will be done once before invoking the
recursive makes.
Also, gitrev is not really required for make dist, so instead of adding
it to BUILT_SOURCES, just add it as a prerequisite of the all target.
Mark the individual package targets as PHONY.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10564
2020-07-14 00:24:07 +03:00
|
|
|
|
2022-12-14 04:33:05 +03:00
|
|
|
native-deb-local:
|
2010-08-26 22:22:58 +04:00
|
|
|
@(if test "${HAVE_DPKGBUILD}" = "no"; then \
|
|
|
|
echo -e "\n" \
|
|
|
|
"*** Required util ${DPKGBUILD} missing. Please install the\n" \
|
2018-02-15 23:58:23 +03:00
|
|
|
"*** package for your distribution which provides ${DPKGBUILD},\n" \
|
2010-08-26 22:22:58 +04:00
|
|
|
"*** re-run configure, and try again.\n"; \
|
2018-02-15 23:58:23 +03:00
|
|
|
exit 1; \
|
2022-12-14 04:33:05 +03:00
|
|
|
fi)
|
|
|
|
|
|
|
|
deb-local: native-deb-local
|
|
|
|
@(if test "${HAVE_ALIEN}" = "no"; then \
|
2010-08-26 22:22:58 +04:00
|
|
|
echo -e "\n" \
|
|
|
|
"*** Required util ${ALIEN} missing. Please install the\n" \
|
2018-02-15 23:58:23 +03:00
|
|
|
"*** package for your distribution which provides ${ALIEN},\n" \
|
2010-08-26 22:22:58 +04:00
|
|
|
"*** re-run configure, and try again.\n"; \
|
2018-02-15 23:58:23 +03:00
|
|
|
exit 1; \
|
2021-04-09 00:37:51 +03:00
|
|
|
fi; \
|
|
|
|
if test "${ALIEN_MAJOR}" = "8" && \
|
|
|
|
test "${ALIEN_MINOR}" = "95"; then \
|
|
|
|
if test "${ALIEN_POINT}" = "1" || \
|
|
|
|
test "${ALIEN_POINT}" = "2" || \
|
|
|
|
test "${ALIEN_POINT}" = "3"; then \
|
|
|
|
/bin/echo -e "\n" \
|
|
|
|
"*** Installed version of ${ALIEN} is known to be broken;\n" \
|
|
|
|
"*** attempting to generate debs will fail! See\n" \
|
|
|
|
"*** https://github.com/openzfs/zfs/issues/11650 for details.\n"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi)
|
2010-08-26 22:22:58 +04:00
|
|
|
|
2013-02-18 00:10:17 +04:00
|
|
|
deb-kmod: deb-local rpm-kmod
|
|
|
|
name=${PACKAGE}; \
|
|
|
|
version=${VERSION}-${RELEASE}; \
|
|
|
|
arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
2018-01-18 21:15:41 +03:00
|
|
|
debarch=`$(DPKG) --print-architecture`; \
|
2013-02-18 00:10:17 +04:00
|
|
|
pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
|
2019-07-09 19:28:05 +03:00
|
|
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
|
2013-02-18 00:10:17 +04:00
|
|
|
$(RM) $$pkg1
|
2017-10-15 23:00:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
deb-dkms: deb-local rpm-dkms
|
|
|
|
name=${PACKAGE}; \
|
|
|
|
version=${VERSION}-${RELEASE}; \
|
|
|
|
arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
2018-01-18 21:15:41 +03:00
|
|
|
debarch=`$(DPKG) --print-architecture`; \
|
2017-10-15 23:00:44 +03:00
|
|
|
pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
|
2019-07-09 19:28:05 +03:00
|
|
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
|
2017-10-15 23:00:44 +03:00
|
|
|
$(RM) $$pkg1
|
2010-08-26 22:22:58 +04:00
|
|
|
|
2020-09-12 18:22:07 +03:00
|
|
|
deb-utils: deb-local rpm-utils-initramfs
|
2010-08-26 22:22:58 +04:00
|
|
|
name=${PACKAGE}; \
|
2013-02-18 00:10:17 +04:00
|
|
|
version=${VERSION}-${RELEASE}; \
|
2011-06-16 23:14:33 +04:00
|
|
|
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
2018-01-18 21:15:41 +03:00
|
|
|
debarch=`$(DPKG) --print-architecture`; \
|
2010-08-26 22:22:58 +04:00
|
|
|
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
2020-11-20 03:25:24 +03:00
|
|
|
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
|
|
|
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
2021-04-02 02:53:05 +03:00
|
|
|
pkg4=libzfs5-$${version}.$${arch}.rpm; \
|
|
|
|
pkg5=libzpool5-$${version}.$${arch}.rpm; \
|
|
|
|
pkg6=libzfs5-devel-$${version}.$${arch}.rpm; \
|
2014-05-17 15:20:59 +04:00
|
|
|
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
2019-07-09 19:28:05 +03:00
|
|
|
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
2015-07-24 15:49:03 +03:00
|
|
|
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
2022-04-20 23:43:42 +03:00
|
|
|
pkg10=`ls python3-pyzfs-$${version}.noarch.rpm 2>/dev/null`; \
|
|
|
|
pkg11=`ls pam_zfs_key-$${version}.$${arch}.rpm 2>/dev/null`; \
|
2017-07-07 20:45:17 +03:00
|
|
|
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
|
|
|
|
## to do this, so we install a shim onto the path which calls the real
|
|
|
|
## dh_shlibdeps with the required arguments.
|
2020-12-03 21:01:16 +03:00
|
|
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
2022-12-29 12:59:12 +03:00
|
|
|
echo "#!$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
2017-07-07 20:45:17 +03:00
|
|
|
echo "`which dh_shlibdeps` -- \
|
2021-04-02 02:53:05 +03:00
|
|
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \
|
2017-07-07 20:45:17 +03:00
|
|
|
>> $${path_prepend}/dh_shlibdeps; \
|
|
|
|
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
|
|
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
|
|
|
## which should NOT be mixed with the alien-generated debs created here
|
|
|
|
chmod +x $${path_prepend}/dh_shlibdeps; \
|
2022-12-29 12:56:39 +03:00
|
|
|
env "PATH=$${path_prepend}:$${PATH}" \
|
2018-01-18 21:15:41 +03:00
|
|
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
|
2015-07-24 15:49:03 +03:00
|
|
|
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
2022-03-19 02:54:50 +03:00
|
|
|
$$pkg8 $$pkg9 $$pkg10 $$pkg11 || exit 1; \
|
2017-07-07 20:45:17 +03:00
|
|
|
$(RM) $${path_prepend}/dh_shlibdeps; \
|
|
|
|
rmdir $${path_prepend}; \
|
2015-07-24 15:49:03 +03:00
|
|
|
$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
2022-03-19 02:54:50 +03:00
|
|
|
$$pkg8 $$pkg9 $$pkg10 $$pkg11;
|
2010-08-26 22:22:58 +04:00
|
|
|
|
2017-10-15 23:00:44 +03:00
|
|
|
deb: deb-kmod deb-dkms deb-utils
|
2022-12-14 04:33:05 +03:00
|
|
|
|
|
|
|
debian:
|
|
|
|
cp -r contrib/debian debian; chmod +x debian/rules;
|
|
|
|
|
|
|
|
native-deb-utils: native-deb-local debian
|
|
|
|
cp contrib/debian/control debian/control; \
|
|
|
|
$(DPKGBUILD) -b -rfakeroot -us -uc;
|
|
|
|
|
|
|
|
native-deb-kmod: native-deb-local debian
|
|
|
|
sh scripts/make_gitrev.sh; \
|
|
|
|
fakeroot debian/rules override_dh_binary-modules;
|
|
|
|
|
|
|
|
native-deb: native-deb-utils native-deb-kmod
|