summaryrefslogtreecommitdiff
path: root/libc/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'libc/debian/rules')
-rwxr-xr-xlibc/debian/rules126
1 files changed, 51 insertions, 75 deletions
diff --git a/libc/debian/rules b/libc/debian/rules
index ec9676f..1fcc7ce 100755
--- a/libc/debian/rules
+++ b/libc/debian/rules
@@ -3,6 +3,9 @@
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
+%:
+ dh $@
+
export DH_VERBOSE = 1
CC = gcc
@@ -78,7 +81,6 @@ util \
BUILD = build-tree
ROOT = $(BUILD)/root
-
ILLUMOS_GATE = illumos-gate
$(ILLUMOS_GATE):
@@ -91,6 +93,7 @@ create-orig: $(ILLUMOS_GATE)
$(ILLUMOS_GATE)/usr/src/man/man2/\*.2 \
$(ILLUMOS_GATE)/usr/src/man/man3/\*.3 \
$(ILLUMOS_GATE)/usr/src/man/man3c/\*.3c \
+ $(ILLUMOS_GATE)/usr/src/uts/common/sys/avl*.h \
$(cmd:%=$(ILLUMOS_GATE)/usr/src/cmd/%) \
$(common:%=$(ILLUMOS_GATE)/usr/src/common/%) \
$(libs:%=$(ILLUMOS_GATE)/usr/src/lib/%) \
@@ -134,83 +137,58 @@ libsocket \
libnsl \
libgen \
-unpack: unpack-stamp
-unpack-stamp:
- dh_testdir
- # TODO: unpack only required stuff
- dh_illumos_gate
- rm -fv usr/src/uts/common/sys/feature_tests.h
- echo 'export DEB_CRYPT_MODULE_DIR_32="$$DEB_LIBDIR_32/security"' >> usr/env.sh
- echo 'export DEB_CRYPT_MODULE_DIR_64="$$DEB_LIBDIR_64/security"' >> usr/env.sh
- touch $@
-
libc-mapfile := usr/src/lib/libc/port/mapfile-vers
-patch: patch-stamp
-patch-stamp: unpack-stamp
- dh_testdir
- [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
- cp usr/src/man/man1/ld.1 \
- usr/src/man/man1/sunld.1
- touch $@
-
-unpatch:
- dh_testdir
- [ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt pop -a -f || test $$? = 2
- [ ! -f $(libc-mapfile).orig ] || mv $(libc-mapfile).orig $(libc-mapfile)
- rm -f patch-stamp
-
-fix-x-stamp: patch-stamp
- find usr/src/head -name \*.x \
- -exec ./debian/fix.x.pl {} \;
- touch $@
-
-dirs-stamp:
- . usr/env.sh; mkdir -p \
- debian/tmp$$DEB_CRYPT_MODULE_DIR_32 \
- debian/tmp$$DEB_CRYPT_MODULE_DIR_64 \
- debian/tmp$$DEB_LIBDIR_32 \
- debian/tmp$$DEB_LIBDIR_64 \
- debian/tmp$$DEB_USRLIBDIR_32 \
- debian/tmp$$DEB_USRLIBDIR_64 \
- debian/tmp/etc/default \
- debian/tmp/usr/include/sys \
- debian/tmp/usr/bin \
- debian/tmp/usr/sbin
- touch $@
+override_dh_strip:
+ : # we don't strip *this* libc
+
+override_dh_auto_configure:
+ dh_illumos_gate --configure --destdir=$(BUILD) --root=$(ROOT)
+ echo 'export DEB_CRYPT_MODULE_DIR_32="$$DEB_LIBDIR_32/security"' >> $(BUILD)/usr/env.sh
+ echo 'export DEB_CRYPT_MODULE_DIR_64="$$DEB_LIBDIR_64/security"' >> $(BUILD)/usr/env.sh
+ find $(BUILD)/usr/src/head -name \*.x -exec ./debian/fix.x.pl {} \;
+
+override_dh_auto_build:
+ . $(BUILD)/usr/env.sh; mkdir -p \
+ $(ROOT)/$$DEB_CRYPT_MODULE_DIR_32 \
+ $(ROOT)/$$DEB_CRYPT_MODULE_DIR_64 \
+ $(ROOT)/$$DEB_LIBDIR_32 \
+ $(ROOT)/$$DEB_LIBDIR_64 \
+ $(ROOT)/$$DEB_USRLIBDIR_32 \
+ $(ROOT)/$$DEB_USRLIBDIR_64 \
+ $(ROOT)/etc/default \
+ $(ROOT)/usr/include/sys \
+ $(ROOT)/usr/bin \
+ $(ROOT)/usr/sbin
# We are changing soname, but keep links for build time.
# These links also will go into libsunXXX-dev packages.
# Watch out: libc build-conflicts with other libelf-dev and libavl-dev
# implementations, and libsunXXX-dev will do too.
- . usr/env.sh; \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_32/libsunelf.so.1 \
- debian/tmp$$DEB_USRLIBDIR_32/libelf.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_64/libsunelf.so.1 \
- debian/tmp$$DEB_USRLIBDIR_64/libelf.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_32/libsunavl.so.1 \
- debian/tmp$$DEB_USRLIBDIR_32/libavl.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_64/libsunavl.so.1 \
- debian/tmp$$DEB_USRLIBDIR_64/libavl.so
+ . $(BUILD)/usr/env.sh; \
+ ln -sf $$ROOT/$$DEB_LIBDIR_32/libsunelf.so.1 \
+ $$ROOT/$$DEB_USRLIBDIR_32/libelf.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_64/libsunelf.so.1 \
+ $$ROOT/$$DEB_USRLIBDIR_64/libelf.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_32/libsunavl.so.1 \
+ $$ROOT/$$DEB_USRLIBDIR_32/libavl.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_64/libsunavl.so.1 \
+ $$ROOT/$$DEB_USRLIBDIR_64/libavl.so
# This is for ld and other to find the right library:
- . usr/env.sh; \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_32/libld.so.4 \
- debian/tmp$$DEB_USRLIBDIR_32/libld.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_64/libld.so.4 \
- debian/tmp$$DEB_USRLIBDIR_64/libld.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_32/liblddbg.so.4 \
- debian/tmp$$DEB_USRLIBDIR_32/liblddbg.so && \
- ln -sf $(CURDIR)/debian/tmp$$DEB_LIBDIR_64/liblddbg.so.4 \
- debian/tmp$$DEB_USRLIBDIR_64/liblddbg.so
-
- touch $@
-
-headers-stamp: patch-stamp dirs-stamp fix-x-stamp
- dh_illumos_make $(make) usr/src/head -t install_h
- dh_illumos_make $(make) $(libs_headers:%=usr/src/lib/%) -t install_h
- cp -vf usr/src/uts/common/sys/avl*.h debian/tmp/usr/include/sys/
- cp -vrf debian/compat_headers/* debian/tmp/usr/include/
- touch $@
+ . $(BUILD)/usr/env.sh; \
+ ln -sf $$ROOT/$$DEB_LIBDIR_32/libld.so.4 \
+ $$ROOT/$$DEB_USRLIBDIR_32/libld.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_64/libld.so.4 \
+ $$ROOT/$$DEB_USRLIBDIR_64/libld.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_32/liblddbg.so.4 \
+ $$ROOT/$$DEB_USRLIBDIR_32/liblddbg.so && \
+ ln -sf $$ROOT/$$DEB_LIBDIR_64/liblddbg.so.4 \
+ $$ROOT/$$DEB_USRLIBDIR_64/liblddbg.so
+
+ dh_illumos_make $(make) $(BUILD)/usr/src/head -t install_h
+ dh_illumos_make $(make) $(libs_headers:%=$(BUILD)/usr/src/lib/%) -t install_h
+ cp -vf $(BUILD)/usr/src/uts/common/sys/avl*.h $(ROOT)/usr/include/sys/
+ cp -vrf debian/compat_headers/* $(ROOT)/usr/include/
lib-stamp: headers-stamp
dh_illumos_make $(make) $(libs:%=usr/src/lib/%)
@@ -232,7 +210,6 @@ sgs-stamp: lib-stamp
touch $@
-
cmd-stamp: lib-stamp sgs-stamp
dh_illumos_make --native $(make) $(cmd:%=usr/src/cmd/%)
touch $@
@@ -326,11 +303,10 @@ crle: debian/crle.c
-DDEB_HOST_ARCH_BITS=$$DEB_HOST_ARCH_BITS \
$<
-clean: unpatch
- dh_testdir
+
+override_dh_auto_clean:
+ rm -rf $(BUILD)
rm -f debian/LC_DATA.*
rm -f debian/locales.config
- rm -rf usr .pc
rm -f crle
- dh_clean