#!/usr/bin/make -f include /usr/share/dpkg/architecture.mk export DH_VERBOSE = 1 # libdiskmgt needs libzfs for data structures and dlopen() # zpool is linked to libdiskmgt. # zfsutils seems to be the only consumer of libdiskmgt # (other is fdisk), so we build libdiskmgt here. libs_headers := \ libzfs_core \ libzfs \ libdiskmgt \ libzpool libs := \ $(libs_headers) cmd := \ zpool \ ztest \ zinject \ zdb \ zfs unpack: unpack-stamp unpack-stamp: dh_testdir dh_illumos_gate --build \ $(cmd:%=usr/src/cmd/%) \ $(libs:%=usr/src/lib/%) \ usr/src/common/zfs/\* \ usr/src/lib/fm/topo/libtopo/common/libtopo.h \ usr/src/lib/libshare/common/libshare.h \ usr/src/uts/common/Makefile.files \ usr/src/uts/common/fs/zfs \ usr/src/lib/libadm/common/rdwr_vtoc.c \ usr/src/lib/libadm/common/fulldevnm.c \ usr/src/cmd/stat/common/timestamp.c \ usr/src/cmd/stat/common/statcommon.h \ usr/src/common/list/list.c \ usr/src/man/man1m/zpool.1m \ usr/src/man/man1m/zfs.1m \ usr/src/man/man1m/zdb.1m # Buggy and unused: echo > usr/src/Makefile.msg.targ touch $@ patch: patch-stamp patch-stamp: unpack-stamp dh_testdir [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2 touch $@ unpatch: dh_testdir [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt pop -a -f || test $$? = 2 rm -f patch-stamp dirs-stamp: unpack-stamp . usr/env.sh; mkdir -p \ debian/tmp/usr/include \ debian/tmp/usr/include/fm \ debian/tmp$$DEB_LIBDIR_32 \ debian/tmp$$DEB_LIBDIR_64 \ debian/tmp$$DEB_USRLIBDIR_32 \ debian/tmp$$DEB_USRLIBDIR_64 \ debian/tmp/usr/bin \ debian/tmp/sbin \ debian/tmp/usr/lib/fs/zfs \ debian/tmp/usr/sbin touch $@ mapfiles-stamp: patch-stamp dh_illumos_make usr/src/common/mapfiles touch $@ headers-stamp: patch-stamp dirs-stamp dh_illumos_make $(libs_headers:%=usr/src/lib/%) -t install_h # Only error codes: cp usr/src/lib/libshare/common/libshare.h debian/tmp/usr/include/ # For dlopen(), fuck! cp usr/src/lib/fm/topo/libtopo/common/libtopo.h \ debian/tmp/usr/include/fm/ touch $@ cmd-stamp: lib-stamp dirs-stamp mapfiles-stamp headers-stamp patch-stamp dh_illumos_make --native $(cmd:%=usr/src/cmd/%) touch $@ lib-stamp: dirs-stamp mapfiles-stamp headers-stamp patch-stamp dh_illumos_make $(libs:%=usr/src/lib/%) touch $@ install: install-stamp install-stamp: build-stamp # Move dev symlink from /lib into /usr/lib: for l in `find debian/tmp/lib32 -maxdepth 1 -type l -name \*.so`; do \ ln -sf `readlink -f $$l` debian/tmp/usr/lib32/`basename $$l`; \ rm $$l; \ done for l in `find debian/tmp/lib/$(DEB_HOST_MULTIARCH) -maxdepth 1 -type l -name \*.so`; do \ ln -sf `readlink -f $$l` debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/`basename $$l`; \ rm $$l; \ done # Make symlinks relative: symlinks -c debian/tmp/usr/lib32 symlinks -c debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) touch $@ build build-arch build-indep: build-stamp build-stamp: lib-stamp cmd-stamp touch $@ binary binary-arch binary-indep: binary-stamp binary-stamp: install-stamp dh_testdir dh_testroot dh_installdirs dh_install dh_installman dh_installdocs dh_installexamples dh_installchangelogs dh_bash-completion dh_link dh_compress dh_fixperms dh_makeshlibs -- -c4 dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb touch $@ clean: unpatch dh_testdir dh_testroot dh_clean rm -rf usr