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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
include /usr/share/hardening-includes/hardening.make
export CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
# PIE disabled on amd64 because it's mostly written in assembly and
# already handles PIC when needed. The codes aren't compiled with
# gcc so enable -fPIE is meaningless.
CFLAGS_NO_PIE := $(CFLAGS) \
$(filter-out $(HARDENING_DISABLE_PIE_CFLAGS_FILTER),$(HARDENING_CFLAGS))
LDFLAGS_NO_PIE := $(LDFLAGS) \
$(filter-out $(HARDENING_DISABLE_PIE_LDFLAGS_FILTER),$(HARDENING_LDFLAGS))
CFLAGS += $(HARDENING_CFLAGS_PIC) \
$(filter-out $(HARDENING_DISABLE_PIE_CFLAGS_FILTER),$(HARDENING_CFLAGS))
LDFLAGS += $(HARDENING_LDFLAGS) -Wl,-z,noexecstack
override_dh_auto_build:
chmod -x app/loc/no
chmod +x bin/plmod
ifeq (amd64,$(DEB_HOST_ARCH_CPU))
mv src64/tags src64/tags.orig
make -C src OS=Linux CPU=amd64 picolisp
make -C src OS=Linux tools gate
make -C src64 OS=Linux CFLAGS="$(CFLAGS_NO_PIE)" LDFLAGS="$(LDFLAGS_NO_PIE)"
else
make -C src OS=Linux CPU=$(DEB_HOST_ARCH_CPU) picolisp tools gate
endif
mkdir -p build/bash_completion.d
cp lib/bash_completion build/bash_completion.d/pil
override_dh_auto_install:
dh_install build/bash_completion.d/pil etc/bash_completion.d
dh_install -X.o src usr/lib/picolisp
dh_install -X.o src64 usr/lib/picolisp
override_dh_auto_clean:
make -C src clean
make -C src64 clean
-rm bin/ssl bin/httpGate bin/lat1 bin/utf2 bin/balance
-mv src64/tags.orig src64/tags
-rm -rf build
override_dh_compress:
dh_compress -X.l
%:
dh $@
VER?=3.0.7.1
get-orig-source:
rm -rf picolisp-$(VER).orig
hg clone https://picolisp.googlecode.com/hg/ picolisp-$(VER).orig
cd picolisp-$(VER).orig && hg up -r v$(VER)
rm -r picolisp-$(VER).orig/.hg picolisp-$(VER).orig/.hgtags
GZIP=--best tar -cz --owner root --group root --mode a+rX \
-f picolisp_$(VER).orig.tar.gz \
picolisp-$(VER).orig
rm -r picolisp-$(VER).orig
|