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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
package=shc
tempdir=$(shell pwd)/debian/tmp
insdirs=$(tempdir)/$(package)/DEBIAN \
$(tempdir)/$(package)/usr/bin \
$(tempdir)/$(package)/usr/share/doc/$(package) \
$(tempdir)/$(package)/usr/share/man/man1 \
binary: binary-indep binary-arch
binary-arch: debian/control checkroot build $(insdirs)
install -m 644 shc.1 $(tempdir)/$(package)/usr/share/man/man1
install -s -m 755 shc $(tempdir)/$(package)/usr/bin
install -m 644 debian/changelog $(tempdir)/$(package)/usr/share/doc/$(package)/changelog.Debian
find $(tempdir)/$(package)/usr/share/doc -type f | xargs -r gzip -v9
install -m 644 debian/copyright $(tempdir)/$(package)/usr/share/doc/$(package)
install -m 644 shc.html $(tempdir)/$(package)/usr/share/doc/$(package)/shc.html
install -m 644 debian/README.Debian $(tempdir)/$(package)/usr/share/doc/$(package)/README.Debian
find $(tempdir)/$(package)/usr/share/man -type f | xargs -r gzip -v9
dh_fixperms -P$(tempdir)/$(package)
dh_strip -P$(tempdir)/$(package)
dh_shlibdeps -P$(tempdir)/$(package)
dh_installdeb -P$(tempdir)/$(package)
dh_shlibdeps -P$(tempdir)/$(package)
dh_gencontrol -P$(tempdir)/$(package)
dh_md5sums -P$(tempdir)/$(package)
#dpkg --build $(tempdir)/$(package) ..
dh_builddeb -P$(tempdir)/$(package)
binary-indep: debian/control checkroot build $(insdirs)
build: debian/control
CFLAGS="$(CFLAGS) -Wl,-z,defs" $(MAKE)
touch build
checkroot: debian/control
test "root" = "$(shell whoami)"
clean: debian/control
$(MAKE) clean
$(MAKE) cleanall
for i in build debian/files debian/substvars `find -name "*~"`; do \
if [ -e $$i ]; then \
rm -f $$i; \
fi; \
done
for i in $(tempdir); do \
if [ -d $$i ]; then \
rm -rf $$i; \
fi; \
done
dh_clean
$(insdirs):
if [ -d $@ ]; then \
rm -rf $@; \
fi
install -d -m 755 $@
chmod g-s $@
.PHONY: binary binary-arch binary-indep checkroot clean
#Local variables:
#mode: makefile
#End:
|