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
|
|
|
PHONY += deb-kmod deb-dkms deb-utils deb deb-local
|
|
|
|
|
2010-08-26 22:22:58 +04:00
|
|
|
deb-local:
|
|
|
|
@(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; \
|
2010-08-26 22:22:58 +04:00
|
|
|
fi; \
|
|
|
|
if test "${HAVE_ALIEN}" = "no"; then \
|
|
|
|
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; \
|
pyzfs: python3 support (build system)
Almost all of the Python code in the respository has been updated
to be compatibile with Python 2.6, Python 3.4, or newer. The only
exceptions are arc_summery3.py which requires Python 3, and pyzfs
which requires at least Python 2.7. This allows us to maintain a
single version of the code and support most default versions of
python. This change does the following:
* Sets the default shebang for all Python scripts to python3. If
only Python 2 is available, then at install time scripts which
are compatible with Python 2 will have their shebangs replaced
with /usr/bin/python. This is done for compatibility until
Python 2 goes end of life. Since only the installed versions
are changed this means Python 3 must be installed on the system
for test-runner when testing in-tree.
* Added --with-python=<2|3|3.4,etc> configure option which sets
the PYTHON environment variable to target a specific python
version. By default the newest installed version of Python
will be used or the preferred distribution version when
creating pacakges.
* Fixed --enable-pyzfs configure checks so they are run when
--enable-pyzfs=check and --enable-pyzfs=yes.
* Enabled pyzfs for Python 3.4 and newer, which is now supported.
* Renamed pyzfs package to python<VERSION>-pyzfs and updated to
install in the appropriate site location. For example, when
building with --with-python=3.4 a python34-pyzfs will be
created which installs in /usr/lib/python3.4/site-packages/.
* Renamed the following python scripts according to the Fedora
guidance for packaging utilities in /bin
- dbufstat.py -> dbufstat
- arcstat.py -> arcstat
- arc_summary.py -> arc_summary
- arc_summary3.py -> arc_summary3
* Updated python-cffi package name. On CentOS 6, CentOS 7, and
Amazon Linux it's called python-cffi, not python2-cffi. For
Python3 it's called python3-cffi or python3x-cffi.
* Install one version of arc_summary. Depending on the version
of Python available install either arc_summary2 or arc_summary3
as arc_summary. The user output is only slightly different.
Reviewed-by: John Ramsden <johnramsden@riseup.net>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8096
2018-10-31 19:22:59 +03:00
|
|
|
pkg10=`ls python*-pyzfs-$${version}* | tail -1`; \
|
2022-03-19 02:54:50 +03:00
|
|
|
pkg11=pam_zfs_key-$${version}.$${arch}.rpm; \
|
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`; \
|
2017-07-07 20:45:17 +03:00
|
|
|
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
|
|
|
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; \
|
|
|
|
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
|