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
|
#!/usr/bin/make -f
SHELL := /bin/bash
version := $(shell dpkg-parsechangelog | grep Version:)
version := $(shell echo $(version) | perl -pe 's/^Version:\s+//o')
build_cpu := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
%:
dh --with quilt $@
override_dh_testdir:
dh_testdir
@if ! test -f stalin.sc; \
then \
echo; \
echo -n "The upstream source does not appear to be available."; \
echo " Please put the contents"; \
echo -n "of $(upstream_archive) into the"; \
echo " current directory."; \
echo; \
false; \
fi
override_dh_auto_build:
ifeq ($(build_cpu),amd64)
CC_OPTIMIZATION="-g -O0" ./build
else
CC_OPTIMIZATION="-g -O2" ./build
endif
./build-gl-fpi
# Tests
rm -rf debian/tmp-test
mkdir debian/tmp-test
echo '(display "hello") (newline)' > debian/tmp-test/hello.scm
cd debian/tmp-test && $(CURDIR)/stalin -On hello.scm
test -x debian/tmp-test/hello
test $$(debian/tmp-test/hello) = "hello"
# These don't work on all debian platforms yet.
#cd benchmarks && ./compile-and-run-stalin-old-benchmarks
override_dh_auto_install:
rm -rf debian/stalin
install -d debian/stalin
# Binaries
install -d debian/stalin/usr/bin
cp debian/stalin-script debian/stalin/usr/bin/stalin
# libs (some of these should be in share, but stalin doesn't make the
# distinction ATM)
install -d debian/stalin/usr/lib/stalin
cp -r include/* debian/stalin/usr/lib/stalin
install -s include/stalin debian/stalin/usr/lib/stalin/
# manpages
install -d debian/stalin/usr/share/man/man1
cp stalin.1 debian/stalin/usr/share/man/man1
# docs
install -d debian/stalin/usr/share/doc/stalin
install README ANNOUNCEMENT debian/stalin/usr/share/doc/stalin
install stalin.el debian/stalin/usr/share/doc/stalin
cp -a benchmarks debian/stalin/usr/share/doc/stalin
dh_auto_install
override_dh_clean:
dh_clean
rm -rf debian/tmp-test
rm -f debian/tmp-src-lsdiff
buildpackage: override_dh_testdir
dpkg-buildpackage -D -us -uc -rfakeroot -i'\.git|\.pc'
lsdiff -z \
-x stalin-0.11/debian/'*' \
-x stalin-0.11/stalin-arch-amd64.c \
-x stalin-0.11/stalin-arch-i386.c \
-x stalin-0.11/stalin-arch-ia64.c \
-x stalin-0.11/stalin-arch-sparc.c \
../stalin_$(version).diff.gz \
> debian/tmp-src-lsdiff
@if test -s debian/tmp-src-lsdiff; \
then \
echo "Diffs found outside ./debian in ../stalin_$(version).diff.gz"; \
cat debian/tmp-src-lsdiff; \
false; \
fi
.PHONY: buildpackage
# Local variables:
# mode: makefile
# End:
|