#!/usr/bin/make -f ifeq (,$(filter terse,${DEB_BUILD_OPTIONS})) export DH_VERBOSE=1 export V=1 export VERBOSE=1 endif LC_ALL:=C export LC_ALL DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) MUSL=$(DEB_HOST_GNU_CPU)-linux-musl ifneq (,$(filter armel,$(DEB_HOST_ARCH))) MUSL=arm-linux-musleabi endif ifneq (,$(filter armhf,$(DEB_HOST_ARCH))) MUSL=arm-linux-musleabihf endif ifeq ($(DEB_HOST_ARCH_CPU),i386) MUSL=i386-linux-musl endif ifeq ($(DEB_HOST_ARCH_CPU),sh4) MUSL=sh-linux-musl endif %: dh $@ --buildsystem=none execute_before_dh_auto_clean: -rm -rf builddir -rm -f debian/*~ debian/mksh.copyright -rm -f t.* xmusl.spec override_dh_auto_build: exec sh debian/meat execute_before_dh_install: cat builddir/substvars >>debian/mksh.substvars extract_categories:=sed --posix -n '/^set -A check_categories --/{s//cat=fastbox/;s/ / /g;y/ /,/;p;q;}' execute_after_dh_install: mkdir -p debian/mksh/usr/share/doc/mksh { \ ${extract_categories} builddir/full/test.sh; \ echo shell=/bin/mksh; \ echo skip=0; \ } >debian/mksh/usr/share/doc/mksh/testdata.full { \ ${extract_categories} builddir/legacy/test.sh; \ echo shell=/bin/lksh; \ echo skip=0; \ } >debian/mksh/usr/share/doc/mksh/testdata.legacy if test -e builddir/static-klibc/mksh; then \ { \ ${extract_categories} builddir/static-klibc/test.sh; \ echo shell=/usr/lib/klibc/bin/mksh; \ echo skip=$$( \ test -x builddir/static-klibc/mksh; \ echo $$? \ ); \ } >debian/mksh/usr/share/doc/mksh/testdata.static-klibc; \ mkdir -p debian/mksh/usr/lib/klibc/bin && \ cp builddir/static-klibc/mksh debian/mksh/usr/lib/klibc/bin/; \ fi if test -e builddir/static-dietlibc/mksh; then \ { \ ${extract_categories} builddir/static-dietlibc/test.sh; \ echo shell=/usr/lib/diet/bin/mksh; \ echo skip=$$( \ test -x builddir/static-dietlibc/mksh; \ echo $$? \ ); \ } >debian/mksh/usr/share/doc/mksh/testdata.static-dietlibc; \ mkdir -p debian/mksh/usr/lib/diet/bin && \ cp builddir/static-dietlibc/mksh debian/mksh/usr/lib/diet/bin/; \ fi if test -e builddir/static-musl/mksh; then \ { \ ${extract_categories} builddir/static-musl/test.sh; \ echo shell=/usr/lib/${MUSL}/bin/mksh; \ echo skip=$$( \ test -x builddir/static-musl/mksh; \ echo $$? \ ); \ } >debian/mksh/usr/share/doc/mksh/testdata.static-musl; \ mkdir -p debian/mksh/usr/lib/${MUSL}/bin && \ cp builddir/static-musl/mksh debian/mksh/usr/lib/${MUSL}/bin/; \ fi case $$(cat builddir/which_static) in \ (klibc) ln -sf /usr/lib/klibc/bin/mksh debian/mksh/bin/mksh-static ;; \ (diet*) ln -sf /usr/lib/diet/bin/mksh debian/mksh/bin/mksh-static ;; \ (musl) ln -sf /usr/lib/${MUSL}/bin/mksh debian/mksh/bin/mksh-static ;; \ (glibc) { \ ${extract_categories} builddir/static-glibc/test.sh; \ echo shell=/bin/mksh-static; \ echo skip=0; \ } >debian/mksh/usr/share/doc/mksh/testdata.static-glibc; \ cp builddir/static-glibc/mksh debian/mksh/bin/mksh-static ;; \ (*) echo cannot happen; exit 1 ;; \ esac test -x debian/mksh/$$(readlink debian/mksh/bin/mksh-static) test -x debian/mksh/bin/mksh test -x debian/mksh/bin/lksh cp -a builddir/dot.mkshrc debian/mksh/etc/mkshrc execute_after_dh_installdocs-arch: # we install this already, except with more information rm -f debian/mksh/usr/share/doc/mksh/README.Debian cp builddir/README.Debian.gz debian/mksh/usr/share/doc/mksh/ execute_before_dh_installdeb: if command -v dh_movetousr >/dev/null 2>&1; then dh_movetousr; fi execute_after_dh_builddeb-arch: #- cat builddir/loglibc.txt gzip -d