]>
Commit | Line | Data |
---|---|---|
e6e31dd5 US |
1 | PHONY += deb-kmod deb-dkms deb-utils deb deb-local native-deb-local \ |
2 | native-deb-utils native-deb-kmod native-deb | |
e6c093dd | 3 | |
e6e31dd5 | 4 | native-deb-local: |
c9c0d073 BB |
5 | @(if test "${HAVE_DPKGBUILD}" = "no"; then \ |
6 | echo -e "\n" \ | |
7 | "*** Required util ${DPKGBUILD} missing. Please install the\n" \ | |
e921f650 | 8 | "*** package for your distribution which provides ${DPKGBUILD},\n" \ |
c9c0d073 | 9 | "*** re-run configure, and try again.\n"; \ |
e921f650 | 10 | exit 1; \ |
e6e31dd5 US |
11 | fi) |
12 | ||
13 | deb-local: native-deb-local | |
14 | @(if test "${HAVE_ALIEN}" = "no"; then \ | |
c9c0d073 BB |
15 | echo -e "\n" \ |
16 | "*** Required util ${ALIEN} missing. Please install the\n" \ | |
e921f650 | 17 | "*** package for your distribution which provides ${ALIEN},\n" \ |
c9c0d073 | 18 | "*** re-run configure, and try again.\n"; \ |
e921f650 | 19 | exit 1; \ |
46fb4783 RE |
20 | fi; \ |
21 | if test "${ALIEN_MAJOR}" = "8" && \ | |
22 | test "${ALIEN_MINOR}" = "95"; then \ | |
23 | if test "${ALIEN_POINT}" = "1" || \ | |
24 | test "${ALIEN_POINT}" = "2" || \ | |
25 | test "${ALIEN_POINT}" = "3"; then \ | |
26 | /bin/echo -e "\n" \ | |
27 | "*** Installed version of ${ALIEN} is known to be broken;\n" \ | |
28 | "*** attempting to generate debs will fail! See\n" \ | |
29 | "*** https://github.com/openzfs/zfs/issues/11650 for details.\n"; \ | |
30 | exit 1; \ | |
31 | fi; \ | |
32 | fi) | |
c9c0d073 | 33 | |
f3757573 | 34 | deb-kmod: deb-local rpm-kmod |
f3757573 BB |
35 | name=${PACKAGE}; \ |
36 | version=${VERSION}-${RELEASE}; \ | |
37 | arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \ | |
79c32704 | 38 | debarch=`$(DPKG) --print-architecture`; \ |
f3757573 | 39 | pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \ |
a54f92b4 | 40 | fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ |
f3757573 | 41 | $(RM) $$pkg1 |
7670f721 NG |
42 | |
43 | ||
44 | deb-dkms: deb-local rpm-dkms | |
45 | name=${PACKAGE}; \ | |
46 | version=${VERSION}-${RELEASE}; \ | |
47 | arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \ | |
79c32704 | 48 | debarch=`$(DPKG) --print-architecture`; \ |
7670f721 | 49 | pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \ |
a54f92b4 | 50 | fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ |
7670f721 | 51 | $(RM) $$pkg1 |
c9c0d073 | 52 | |
d0cea309 | 53 | deb-utils: deb-local rpm-utils-initramfs |
c9c0d073 | 54 | name=${PACKAGE}; \ |
f3757573 | 55 | version=${VERSION}-${RELEASE}; \ |
bd2f5ac9 | 56 | arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ |
79c32704 | 57 | debarch=`$(DPKG) --print-architecture`; \ |
c9c0d073 | 58 | pkg1=$${name}-$${version}.$${arch}.rpm; \ |
8434017a AR |
59 | pkg2=libnvpair3-$${version}.$${arch}.rpm; \ |
60 | pkg3=libuutil3-$${version}.$${arch}.rpm; \ | |
fe6babce BB |
61 | pkg4=libzfs5-$${version}.$${arch}.rpm; \ |
62 | pkg5=libzpool5-$${version}.$${arch}.rpm; \ | |
63 | pkg6=libzfs5-devel-$${version}.$${arch}.rpm; \ | |
c9b5cc8c | 64 | pkg7=$${name}-test-$${version}.$${arch}.rpm; \ |
a54f92b4 | 65 | pkg8=$${name}-dracut-$${version}.noarch.rpm; \ |
48511ea6 | 66 | pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \ |
b1fb4e1b DS |
67 | pkg10=`ls python3-pyzfs-$${version}.noarch.rpm 2>/dev/null`; \ |
68 | pkg11=`ls pam_zfs_key-$${version}.$${arch}.rpm 2>/dev/null`; \ | |
c34efbeb AR |
69 | ## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism |
70 | ## to do this, so we install a shim onto the path which calls the real | |
71 | ## dh_shlibdeps with the required arguments. | |
9109b89c | 72 | path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \ |
c34efbeb AR |
73 | echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \ |
74 | echo "`which dh_shlibdeps` -- \ | |
fe6babce | 75 | -xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \ |
c34efbeb AR |
76 | >> $${path_prepend}/dh_shlibdeps; \ |
77 | ## These -x arguments are passed to dpkg-shlibdeps, which exclude the | |
78 | ## Debianized packages from the auto-generated dependencies of the new debs, | |
79 | ## which should NOT be mixed with the alien-generated debs created here | |
80 | chmod +x $${path_prepend}/dh_shlibdeps; \ | |
81 | env PATH=$${path_prepend}:$${PATH} \ | |
79c32704 | 82 | fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \ |
48511ea6 | 83 | $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \ |
3ce3d305 | 84 | $$pkg8 $$pkg9 $$pkg10 $$pkg11 || exit 1; \ |
c34efbeb AR |
85 | $(RM) $${path_prepend}/dh_shlibdeps; \ |
86 | rmdir $${path_prepend}; \ | |
48511ea6 | 87 | $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \ |
3ce3d305 | 88 | $$pkg8 $$pkg9 $$pkg10 $$pkg11; |
c9c0d073 | 89 | |
7670f721 | 90 | deb: deb-kmod deb-dkms deb-utils |
e6e31dd5 US |
91 | |
92 | debian: | |
93 | cp -r contrib/debian debian; chmod +x debian/rules; | |
94 | ||
95 | native-deb-utils: native-deb-local debian | |
96 | cp contrib/debian/control debian/control; \ | |
97 | $(DPKGBUILD) -b -rfakeroot -us -uc; | |
98 | ||
99 | native-deb-kmod: native-deb-local debian | |
100 | sh scripts/make_gitrev.sh; \ | |
101 | fakeroot debian/rules override_dh_binary-modules; | |
102 | ||
103 | native-deb: native-deb-utils native-deb-kmod |