xref: /freebsd/sys/contrib/openzfs/config/deb.am (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1PHONY += deb-kmod deb-dkms deb-utils deb deb-local
2
3deb-local:
4	@(if test "${HAVE_DPKGBUILD}" = "no"; then \
5		echo -e "\n" \
6	"*** Required util ${DPKGBUILD} missing.  Please install the\n" \
7	"*** package for your distribution which provides ${DPKGBUILD},\n" \
8	"*** re-run configure, and try again.\n"; \
9		exit 1; \
10	fi; \
11	if test "${HAVE_ALIEN}" = "no"; then \
12		echo -e "\n" \
13	"*** Required util ${ALIEN} missing.  Please install the\n" \
14	"*** package for your distribution which provides ${ALIEN},\n" \
15	"*** re-run configure, and try again.\n"; \
16		exit 1; \
17	fi)
18
19deb-kmod: deb-local rpm-kmod
20	name=${PACKAGE}; \
21	version=${VERSION}-${RELEASE}; \
22	arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
23	debarch=`$(DPKG) --print-architecture`; \
24	pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
25	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
26	$(RM) $$pkg1
27
28
29deb-dkms: deb-local rpm-dkms
30	name=${PACKAGE}; \
31	version=${VERSION}-${RELEASE}; \
32	arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
33	debarch=`$(DPKG) --print-architecture`; \
34	pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
35	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
36	$(RM) $$pkg1
37
38deb-utils: deb-local rpm-utils-initramfs
39	name=${PACKAGE}; \
40	version=${VERSION}-${RELEASE}; \
41	arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
42	debarch=`$(DPKG) --print-architecture`; \
43	pkg1=$${name}-$${version}.$${arch}.rpm; \
44	pkg2=libnvpair3-$${version}.$${arch}.rpm; \
45	pkg3=libuutil3-$${version}.$${arch}.rpm; \
46	pkg4=libzfs4-$${version}.$${arch}.rpm; \
47	pkg5=libzpool4-$${version}.$${arch}.rpm; \
48	pkg6=libzfs4-devel-$${version}.$${arch}.rpm; \
49	pkg7=$${name}-test-$${version}.$${arch}.rpm; \
50	pkg8=$${name}-dracut-$${version}.noarch.rpm; \
51	pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
52	pkg10=`ls python*-pyzfs-$${version}* | tail -1`; \
53## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
54## to do this, so we install a shim onto the path which calls the real
55## dh_shlibdeps with the required arguments.
56	path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
57	echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
58	echo "`which dh_shlibdeps` -- \
59	 -xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
60	 >> $${path_prepend}/dh_shlibdeps; \
61## These -x arguments are passed to dpkg-shlibdeps, which exclude the
62## Debianized packages from the auto-generated dependencies of the new debs,
63## which should NOT be mixed with the alien-generated debs created here
64	chmod +x $${path_prepend}/dh_shlibdeps; \
65	env PATH=$${path_prepend}:$${PATH} \
66	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
67	    $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
68	    $$pkg8 $$pkg9 $$pkg10 || exit 1; \
69	$(RM) $${path_prepend}/dh_shlibdeps; \
70	rmdir $${path_prepend}; \
71	$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
72	    $$pkg8 $$pkg9 $$pkg10;
73
74deb: deb-kmod deb-dkms deb-utils
75