summaryrefslogtreecommitdiff
path: root/debian/rules
blob: e7f690bd5c0979c9f1a129c905babcaa4c537744 (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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

binary binary-arch binary-indep: binary-stamp
build build-arch build-indep:
install: install-stamp

mf-define := -m debian/db/etc/name_to_major

mf-define += -D i386_ONLY= -D ARCH=i386 -a i386
ifeq (illumos-amd64,$(DEB_HOST_ARCH))
mf-define += -D ARCH64=amd64
else
$(error $(DEB_HOST_ARCH) is not supported)
endif

.PHONY: newdb
# This target is not used in ordinary build,
# it can be helpful when doing major updates
newdb: unpack-illumos-stamp
	rm -rf newdb
	mkdir -p newdb
	find usr/src/pkg/manifests -type f -name \*.mf | \
		debian/drivers.pl $(mf-define) -r newdb
unpack-illumos-stamp:
	dh_illumos_gate usr/src/pkg/manifests
	touch $@

install-stamp:
	dh_testdir
	rm -rf debian/driverdb
	mkdir -p debian/driverdb/usr/share/driverdb
	cp -r debian/db/* debian/driverdb/usr/share/driverdb/
	find debian/driverdb/usr/share/driverdb -type f -print -exec gzip -f -9 {} \;
	dh_installdirs
	dh_install
	dh_installdocs
	dh_installexamples
	dh_installchangelogs
	dh_link
	touch $@

binary-stamp: install-stamp
	dh_testdir
	dh_testroot
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb -- -Zxz
	touch $@

clean:
	dh_testdir
	dh_clean
	rm -rf usr newdb