blob: a77ee7b910cf0c357e6a50b7bc8288f74e3fdd7d (
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
106
107
108
109
110
111
|
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
export DH_VERBOSE = 1
VERSION := $(shell dpkg-parsechangelog | perl -ne '/Version:\s+(.+)-[^-]+/ && print $$1')
%:
dh $@
# 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
BUILD = build-tree
ROOT = $(BUILD)/root
ILLUMOS_GATE = illumos-gate
$(ILLUMOS_GATE):
dh_illumos_gate --checkout --destdir=$(ILLUMOS_GATE)
.PHONY: create-orig
create-orig: $(ILLUMOS_GATE)
dh_illumos_gate --create-orig --build \
$(ILLUMOS_GATE)/usr/src/cmd/stat/common/statcommon.h \
$(ILLUMOS_GATE)/usr/src/cmd/stat/common/timestamp.c \
$(ILLUMOS_GATE)/usr/src/common/list/list.c \
$(ILLUMOS_GATE)/usr/src/common/zfs \
$(ILLUMOS_GATE)/usr/src/lib/fm/topo/libtopo/common/libtopo.h \
$(ILLUMOS_GATE)/usr/src/lib/libadm/common/fulldevnm.c \
$(ILLUMOS_GATE)/usr/src/lib/libadm/common/rdwr_vtoc.c \
$(ILLUMOS_GATE)/usr/src/lib/libshare/common/libshare.h \
$(ILLUMOS_GATE)/usr/src/man/man1m/zdb.1m \
$(ILLUMOS_GATE)/usr/src/man/man1m/zfs.1m \
$(ILLUMOS_GATE)/usr/src/man/man1m/zpool.1m \
$(ILLUMOS_GATE)/usr/src/uts/common/Makefile.files \
$(ILLUMOS_GATE)/usr/src/uts/common/fs/zfs \
$(cmd:%=$(ILLUMOS_GATE)/usr/src/cmd/%) \
$(libs:%=$(ILLUMOS_GATE)/usr/src/lib/%) \
test-orig: create-orig
./debian/rules clean
rm -rf usr .pc
tar xf ../zfsutils_$(VERSION).orig.tar.xz --strip=1
quilt push -a
./debian/rules build
fakeroot ./debian/rules binary
override_dh_auto_configure:
dh_illumos_gate --configure --destdir=$(BUILD) --root=$(ROOT)
override_dh_auto_build:
. $(BUILD)/usr/env.sh; mkdir -p \
$$ROOT/usr/include \
$$ROOT/usr/include/fm \
$$ROOT$$DEB_LIBDIR_32 \
$$ROOT$$DEB_LIBDIR_64 \
$$ROOT$$DEB_USRLIBDIR_32 \
$$ROOT$$DEB_USRLIBDIR_64 \
$$ROOT/usr/bin \
$$ROOT/sbin \
$$ROOT/usr/lib/fs/zfs \
$$ROOT/usr/sbin
dh_illumos_make $(libs_headers:%=$(BUILD)/usr/src/lib/%) -t install_h
# Only error codes:
cp $(BUILD)/usr/src/lib/libshare/common/libshare.h \
$(ROOT)/usr/include/
# For dlopen(), fuck!
cp $(BUILD)/usr/src/lib/fm/topo/libtopo/common/libtopo.h \
$(ROOT)/usr/include/fm/
dh_illumos_make $(BUILD)/usr/src/common/mapfiles
dh_illumos_make $(patsubst %,$(BUILD)/usr/src/lib/%,$(libs))
dh_illumos_make --native $(patsubst %,$(BUILD)/usr/src/cmd/%,$(cmd))
override_dh_auto_install:
rm -rf debian/tmp
cp -a $(ROOT) debian/tmp
# 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)
override_dh_makeshlibs:
dh_makeshlibs -- -c4
override_dh_auto_clean:
rm -rf $(BUILD)
|