#!/usr/bin/make -f include /usr/share/dpkg/architecture.mk VERSION := $(shell dpkg-parsechangelog | perl -ne '/Version:\s+(.+)-[^-]+/ && print $$1') export DH_VERBOSE = 1 %: 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/' $(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/' $(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/' $(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 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 symlinks -c debian/tmp/usr/lib32 symlinks -c debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) override_dh_auto_clean: rm -rf $(BUILD)