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 100 101 102 103
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
DEB_HOST_MULTIARCH?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# Aim for the top (almost), adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS= hardening=+all
export DEB_BUILD_MAINT_OPTIONS
GFORTH_VER = `sed -e 's/^[^ ]\+ (\([^)+-]\+\).*/\1/; 1q' debian/changelog`
D = $(CURDIR)/debian/tmp
DG = $(CURDIR)/debian/gforth
DC = $(CURDIR)/debian/gforth-common
DL = $(CURDIR)/debian/gforth-lib
ULIB = $D/usr/lib/$(DEB_HOST_MULTIARCH)/gforth/$(GFORTH_VER)
USHARE = $D/usr/share/gforth/$(GFORTH_VER)
packages := $(shell dh_listpackages)
# arch-specific options
sitelispdir :=/usr/share/emacs/site-lisp/gforth
common_opts :=--with-lispdir='${sitelispdir}'
m68k_opts :=--enable-force-reg
configure_options := $(common_opts)
ifeq ($(DEB_BUILD_ARCH),m68k)
configure_options = $(common_opts) $(m68k_opts)
endif
shellout := $(shell ls -d debian/kernl-save 2> /dev/null)
save-dir=frog$(shellout)
override_dh_auto_configure:
ifeq ($(save-dir),frog)
install -d debian/kernl-save
cp kernl*.fi debian/kernl-save
endif
no_dynamic_default=1 dh_auto_configure -- $(configure_options)
override_dh_auto_clean:
dh_auto_clean
ifneq ($(save-dir),frog)
cp debian/kernl-save/* .
rm -r debian/kernl-save
endif
override_dh_auto_install:
mkdir -p $D/usr/lib/gforth/site-forth
touch $D/usr/lib/gforth/site-forth/site-init.fs
mkdir -p $D${sitelispdir}
dh_auto_install
chmod 755 $(USHARE)/filedump.fs $(USHARE)/httpd.fs $(USHARE)/sieve.fs \
$(USHARE)/kernl*.fi $(ULIB)/gforth.fi
prunedirs=
ifneq (,$(filter gforth-common,$(packages)))
prunedirs+= $(DC)
endif
ifneq (,$(filter gforth-lib,$(packages)))
prunedirs+= $(DL)
endif
ifneq (,$(filter gforth,$(packages)))
prunedirs+= $(DG)
endif
override_dh_install:
ifneq (,$(filter gforth-common,$(packages)))
mkdir -p $(DC)/usr/share
mv $D/usr/share/gforth $(DC)/usr/share/gforth
else
rm -rf $D/usr/share/gforth
endif
ifneq (,$(filter gforth-lib,$(packages)))
mkdir -p $(DL)/usr/lib
mv $D/usr/lib/$(DEB_HOST_MULTIARCH) $(DL)/usr/lib/$(DEB_HOST_MULTIARCH)
else
rm -rf $D/usr/lib/$(DEB_HOST_MULTIARCH)
endif
ifneq (,$(filter gforth,$(packages)))
mkdir -p $(DG)
mv $D/* $(DG)/
endif
ifneq (,$(prunedirs))
find $(prunedirs) -type d -empty -delete
find $(prunedirs) -name '*.la' -delete
endif
override_dh_installchangelogs:
dh_installchangelogs -X ChangeLog
set -e; for p in $$(dh_listpackages); do \
install -m 644 NEWS "debian/$$p/usr/share/doc/$$p/"; \
done
override_dh_makeshlibs:
ifneq (,$(filter gforth,$(packages)))
override_dh_missing:
dh_missing --fail-missing
endif
%:
dh $@ --no-parallel
|