summaryrefslogtreecommitdiff
path: root/libadm/debian/rules
blob: e07a3dfd9e0fb4c4ddfaddd8b943512381404966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
export DH_VERBOSE = 1

# libs having "install_h" target to install headers:
libs_headers := \

# All libraries to build and to package.
# Order is important:
libs := $(libs_headers) \
	libadm


unpack: unpack-stamp
unpack-stamp:
	dh_testdir
	dh_illumos_gate --build \
		$(libs:%=usr/src/lib/%) \
		usr/src/head/note.h \
		usr/src/head/pkginfo.h \
		usr/src/head/pkglocs.h \
		usr/src/head/devmgmt.h \
		usr/src/head/pkgstrct.h \
		usr/src/head/valtools.h \


	# 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/usr/include \
		debian/tmp$$DEB_LIBDIR_32 \
		debian/tmp$$DEB_LIBDIR_64 \
		debian/tmp$$DEB_USRLIBDIR_32 \
		debian/tmp$$DEB_USRLIBDIR_64
	touch $@

headers-stamp: patch-stamp dirs-stamp
	cp usr/src/head/*.h \
		usr/src/lib/libadm/inc/*.h \
		debian/tmp/usr/include/
	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: patch-stamp dirs-stamp headers-stamp
	dh_illumos_make $(libs:%=usr/src/lib/%)
	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_gencontrol
	dh_md5sums
	dh_builddeb
	touch $@

clean: unpatch
	dh_testdir
	dh_testroot
	dh_clean
	rm -rf usr .pc