summaryrefslogtreecommitdiff
path: root/onbld/debian/rules
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-12-04 14:42:49 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-12-04 14:42:49 +0300
commit50a438f2fc0dc09eb2c7e8c666ed6189cdba5826 (patch)
tree7928cc410ecb1e608a524239b8c434119902ecc5 /onbld/debian/rules
parent5a8e0256ecf276956faab99e62d6c7118eb04ef5 (diff)
downloadillumos-packaging-50a438f2fc0dc09eb2c7e8c666ed6189cdba5826.tar.gz
onbld (5.10.18.git.2a44663-1)
Diffstat (limited to 'onbld/debian/rules')
-rwxr-xr-xonbld/debian/rules157
1 files changed, 68 insertions, 89 deletions
diff --git a/onbld/debian/rules b/onbld/debian/rules
index 3b128b1..e52229c 100755
--- a/onbld/debian/rules
+++ b/onbld/debian/rules
@@ -1,73 +1,78 @@
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
+VERSION := $(shell dpkg-parsechangelog | perl -ne '/Version:\s+(.+)-[^-]+/ && print $$1')
export DH_VERBOSE = 1
-unpack: unpack-stamp
-unpack-stamp:
- dh_testdir
- dh_illumos_gate --build \
- usr/src/tools \
- usr/src/lib/libctf \
- usr/src/common/ctf \
- usr/src/uts/common/sys/ctf.h \
- usr/src/uts/common/sys/ctf_api.h \
- usr/src/uts/common/sys/multiboot.h
-
- # install into debian/tmp:
- echo 'export TOOLS_PROTO="$$ROOT"' >> usr/env.sh
- echo 'export SAVEARGS=' >> usr/env.sh
- sed -i '/^TOOLS_PROTO=/d' usr/bldenv.sh
- 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/usr/include/sys \
- 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
- dh_illumos_make usr/src/lib/libctf -t install_h
- cp usr/src/uts/common/sys/*.h debian/tmp/usr/include/sys/
- touch $@
-
-
-install build build-arch build-indep: build-stamp
-build-stamp: patch-stamp headers-stamp dirs-stamp
- # ctfstabs needs libctf, libctf needs ctfconvert
- # We've disabled ctfstabs via patch to build all tools
- # not requiring libctf, then build libctf, then - ctfstabs:
-
- # libncurses.so is actually linker script
+%:
+ dh $@
+
+
+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/tools \
+ $(ILLUMOS_GATE)/usr/src/lib/libctf \
+ $(ILLUMOS_GATE)/usr/src/common/ctf \
+ $(ILLUMOS_GATE)/usr/src/uts/common/sys/ctf.h \
+ $(ILLUMOS_GATE)/usr/src/uts/common/sys/ctf_api.h \
+ $(ILLUMOS_GATE)/usr/src/uts/common/sys/multiboot.h
+
+test-orig: create-orig
+ ./debian/rules clean
+ rm -rf usr .pc
+ tar xf ../onbld_$(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/sys \
+ $(ROOT)$$DEB_LIBDIR_32 \
+ $(ROOT)$$DEB_LIBDIR_64 \
+ $(ROOT)$$DEB_USRLIBDIR_32 \
+ $(ROOT)$$DEB_USRLIBDIR_64
+
+ dh_illumos_make $(BUILD)/usr/src/lib/libctf -t install_h
+ cp usr/src/uts/common/sys/*.h $(ROOT)/usr/include/sys/
+
+ # libncurses.so is actually a linker script
# and sunld does not understand it,
# but we do not need sunld here ;-)
- sed -i -r 's/.*(export +LD_ALTEXEC.*)/#\1/' usr/env.sh
- dh_illumos_make --no-onbld --native usr/src/tools
+ sed -i -r 's/.*(export +LD_ALTEXEC.*)/#\1/' $(BUILD)/usr/env.sh
+ dh_illumos_make --no-onbld --native $(BUILD)/usr/src/tools
+
# Then we need sunld:
- sed -i -r 's/#(export +LD_ALTEXEC.*)/\1/' usr/env.sh
- dh_illumos_make --no-onbld usr/src/lib/libctf -t install_h
- dh_illumos_make --no-onbld usr/src/lib/libctf
+ sed -i -r 's/#(export +LD_ALTEXEC.*)/\1/' $(BUILD)/usr/env.sh
+ dh_illumos_make --no-onbld $(BUILD)/usr/src/lib/libctf -t install_h
+ dh_illumos_make --no-onbld $(BUILD)/usr/src/lib/libctf
+
# Then - don't:
- sed -i -r 's/(export +LD_ALTEXEC.*)/#\1/' usr/env.sh
- dh_illumos_make --no-onbld --native usr/src/tools/ctf/stabs
+ sed -i -r 's/(export +LD_ALTEXEC.*)/#\1/' $(BUILD)/usr/env.sh
+ dh_illumos_make --no-onbld --native $(BUILD)/usr/src/tools/ctf/stabs
+
+
+override_dh_auto_install:
+ rm -rf debian/tmp
+ cp -a $(ROOT) debian/tmp
+ cp -a $(BUILD)/usr/src/tools/proto/root_i386-nd/opt debian/tmp/opt
+ cp -a $(BUILD)/usr/src/tools/scripts/genoffsets.pl debian/tmp/opt/onbld/bin/genoffsets
- # 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; \
@@ -76,36 +81,10 @@ build-stamp: patch-stamp headers-stamp dirs-stamp
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 $@
-
-binary binary-arch binary-indep: binary-stamp
-binary-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_install
- dh_python2
- dh_installman
- dh_installdocs
- dh_installexamples
- dh_installchangelogs
- dh_strip
- 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
+
+
+override_dh_auto_clean:
+ rm -rf $(BUILD)