summaryrefslogtreecommitdiff
path: root/dladm/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'dladm/debian/rules')
-rwxr-xr-xdladm/debian/rules116
1 files changed, 116 insertions, 0 deletions
diff --git a/dladm/debian/rules b/dladm/debian/rules
new file mode 100755
index 0000000..cf2006a
--- /dev/null
+++ b/dladm/debian/rules
@@ -0,0 +1,116 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/architecture.mk
+export DH_VERBOSE = 1
+
+# libs having "install_h" target to install headers:
+libs_headers := \
+libdladm \
+
+# All libraries to build and to package.
+# Order is important:
+libs := $(libs_headers) \
+
+cmd := dladm dlmgmtd flowadm flowstat
+
+
+unpack: unpack-stamp
+unpack-stamp:
+ dh_testdir
+ dh_illumos_gate --build \
+ $(libs:%=usr/src/lib/%) \
+ $(cmd:%=usr/src/cmd/%) \
+ usr/src/man/man1m/dladm.1m \
+ usr/src/man/man1m/dlmgmtd.1m \
+ usr/src/man/man1m/flowadm.1m
+
+ # Not used and buggy:
+ 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:
+ . usr/env.sh; mkdir -p \
+ debian/tmp$$DEB_LIBDIR_32 \
+ debian/tmp$$DEB_LIBDIR_64 \
+ debian/tmp$$DEB_USRLIBDIR_32 \
+ debian/tmp$$DEB_USRLIBDIR_64 \
+ debian/tmp/lib/svc/manifest/network \
+ debian/tmp/lib/svc/method \
+ debian/tmp/sbin \
+ debian/tmp/usr/include \
+ debian/tmp/usr/sbin
+ touch $@
+
+headers-stamp: patch-stamp dirs-stamp
+ dh_illumos_make $(libs_headers:%=usr/src/lib/%) -t install_h
+ touch $@
+
+install install install-arch install-indep: 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: patch-stamp dirs-stamp headers-stamp
+ # libncurses workaround:
+ # libcurses.so is a linker script for GNU ld.
+ # The linker we have to use (SunOS ld) does not understand it.
+ # So we create symbolic links for libncurses.so.5 under debian/tmp.
+ # Also note that we've patched usr/lib/libdladm/Makefile.com to
+ # explicitly link with libtinfo
+ ln -sf /lib32/libncurses.so.5 debian/tmp/usr/lib32/libcurses.so
+ ln -sf /lib/$(DEB_HOST_MULTIARCH)/libncurses.so.5 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcurses.so
+ dh_illumos_make $(libs:%=usr/src/lib/%)
+ dh_illumos_make --native $(cmd:%=usr/src/cmd/%)
+ 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_link
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs -- -c4
+ dh_installdeb
+ dh_shlibdeps
+ dh_strip
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+ touch $@
+
+clean: unpatch
+ dh_testdir
+ dh_testroot
+ dh_clean
+ rm -rf usr .pc
+