| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | #!/usr/bin/make -f | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | include /usr/share/dpkg/default.mk | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:31 +03:00
										 |  |  | VERSION := $(DEB_VERSION_UPSTREAM) | 
					
						
							|  |  |  | REVISION := $(shell echo $(DEB_VERSION) | cut -d- -f2) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-15 17:08:22 +03:00
										 |  |  | SPHINX_BUILD = $(shell dpkg -L python3-sphinx | grep -m 1 "/sphinx-build$$") | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:36 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | export DEB_BUILD_MAINT_OPTIONS = hardening=+all | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %: | 
					
						
							| 
									
										
										
										
											2020-05-13 20:59:13 +03:00
										 |  |  | 	dh $@ --with autoreconf,python3,sphinxdoc --parallel | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:31 +03:00
										 |  |  | adapt_meta_file: | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	@# Embed the downstream version in the module. | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:31 +03:00
										 |  |  | 	@sed \ | 
					
						
							|  |  |  | 	  -e 's/^Version:.*/Version:      $(VERSION)/' \ | 
					
						
							|  |  |  | 	  -e 's/^Release:.*/Release:      $(REVISION)/' \ | 
					
						
							|  |  |  | 	  -i.orig META | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:31 +03:00
										 |  |  | override_dh_autoreconf: adapt_meta_file | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	dh_autoreconf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | override_dh_auto_configure: | 
					
						
							|  |  |  | 	@# Build the userland, but don't build the kernel modules. | 
					
						
							|  |  |  | 	dh_auto_configure -- \ | 
					
						
							|  |  |  | 	  --bindir=/usr/bin \ | 
					
						
							|  |  |  | 	  --sbindir=/sbin \ | 
					
						
							| 
									
										
										
										
											2020-12-02 22:18:02 +03:00
										 |  |  | 	  --libdir=/lib/"$(DEB_HOST_MULTIARCH)" \ | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	  --with-udevdir=/lib/udev \ | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:29 +03:00
										 |  |  | 	  --with-zfsexecdir=/usr/lib/zfs-linux \ | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	  --enable-systemd \ | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:36 +03:00
										 |  |  | 	  --enable-pyzfs \ | 
					
						
							| 
									
										
										
										
											2020-05-13 20:59:09 +03:00
										 |  |  | 	  --with-python=python3 \ | 
					
						
							| 
									
										
										
										
											2020-12-02 22:18:08 +03:00
										 |  |  | 	  --with-pammoduledir='/lib/$(DEB_HOST_MULTIARCH)/security' \ | 
					
						
							| 
									
										
										
										
											2021-02-25 00:08:00 +03:00
										 |  |  | 	  --with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \ | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	  --with-systemdunitdir=/lib/systemd/system \ | 
					
						
							|  |  |  | 	  --with-systemdpresetdir=/lib/systemd/system-preset \ | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:33 +03:00
										 |  |  | 	  --with-systemdgeneratordir=/lib/systemd/system-generators \ | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	  --with-config=user | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-02 22:18:02 +03:00
										 |  |  | 	for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \ | 
					
						
							|  |  |  | 		basename "$$i" | grep _KVERS_ && continue ; \ | 
					
						
							|  |  |  | 		sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' "$$i" > "$${i%%.in}" ; \ | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | override_dh_auto_test: | 
					
						
							| 
									
										
										
										
											2021-02-25 00:08:02 +03:00
										 |  |  | override_dh_auto_test: | 
					
						
							|  |  |  | ifeq (amd64,$(DEB_HOST_ARCH)) | 
					
						
							|  |  |  | 	# Upstream provides an ABI guarantee that we validate here | 
					
						
							|  |  |  | 	$(MAKE) checkabi | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 	# The dh_auto_test rule is disabled because | 
					
						
							|  |  |  | 	# `make check` cannot run in an unprivileged build environment. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | override_dh_auto_install: | 
					
						
							|  |  |  | 	@# Install the utilities. | 
					
						
							|  |  |  | 	$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Use upstream's bash completion | 
					
						
							|  |  |  | 	install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \ | 
					
						
							|  |  |  | 		'$(CURDIR)/contrib/bash_completion.d/zfs' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Move from bin_dir to /usr/sbin | 
					
						
							|  |  |  | 	# Remove suffix (.py) as per policy 10.4 - Scripts | 
					
						
							|  |  |  | 	# https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts | 
					
						
							|  |  |  | 	mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/' | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:33 +03:00
										 |  |  | 	mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary' | 
					
						
							|  |  |  | 	mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat' | 
					
						
							|  |  |  | 	mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat' | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	@# Zed has dependencies outside of the system root. | 
					
						
							|  |  |  | 	mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-02 22:18:02 +03:00
										 |  |  | 	mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) | 
					
						
							|  |  |  | 	for i in `ls $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/*.so`; do \ | 
					
						
							|  |  |  | 		ln -s /lib/$(DEB_HOST_MULTIARCH)/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/`basename $${i}`; \ | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 		rm $${i}; \ | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions' | 
					
						
							|  |  |  | 	chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs' | 
					
						
							|  |  |  | 	chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:36 +03:00
										 |  |  | override_dh_python3: | 
					
						
							|  |  |  | 	dh_python3 -p python3-pyzfs | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | override_dh_makeshlibs: | 
					
						
							|  |  |  | 	dh_makeshlibs -a -V | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | override_dh_strip: | 
					
						
							|  |  |  | 	dh_strip --dbg-package=zfs-dbg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | override_dh_auto_clean: | 
					
						
							|  |  |  | 	find . -name .gitignore -delete | 
					
						
							|  |  |  | 	rm -rf zfs-$(DEB_VERSION_UPSTREAM) | 
					
						
							|  |  |  | 	dh_auto_clean | 
					
						
							|  |  |  | 	@if test -e META.orig; then mv META.orig META; fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-25 00:08:00 +03:00
										 |  |  | override_dh_install: | 
					
						
							|  |  |  | 	find debian/tmp/lib -name *.la -delete | 
					
						
							|  |  |  | 	dh_install | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-28 14:14:19 +03:00
										 |  |  | override_dh_missing: | 
					
						
							|  |  |  | 	dh_missing --fail-missing | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-24 00:11:36 +03:00
										 |  |  | override_dh_installdocs: | 
					
						
							|  |  |  | 	dh_installdocs | 
					
						
							|  |  |  | ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) | 
					
						
							|  |  |  | 	http_proxy='127.0.0.1:9' $(SPHINX_BUILD) -N -bhtml "$(CURDIR)/contrib/pyzfs/docs/source/" debian/pyzfs-doc/usr/share/doc/pyzfs-doc/html/ | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 17:26:24 +03:00
										 |  |  | # ------------ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | debian-copyright: | 
					
						
							|  |  |  | 	cme update dpkg-copyright -file debian/copyright.cme |