| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
CFLAGS =-Wall -Drpl_malloc=malloc |
| 4 |
|
| 5 |
DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 6 |
DEB_BUILD_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 7 |
|
| 8 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 9 |
CFLAGS +=-g |
| 10 |
endif |
| 11 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 12 |
CFLAGS +=-O0 |
| 13 |
else |
| 14 |
CFLAGS +=-O2 |
| 15 |
endif |
| 16 |
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 17 |
STRIP =: nostrip |
| 18 |
else |
| 19 |
STRIP = $(DEB_HOST_GNU_TYPE)-strip |
| 20 |
endif |
| 21 |
|
| 22 |
DIR =$(shell pwd)/debian/integrit |
| 23 |
|
| 24 |
config: config.status |
| 25 |
config.status: configure |
| 26 |
CC='$(CC)' CFLAGS='$(CFLAGS)' sh ./configure \ |
| 27 |
--host='$(DEB_HOST_GNU_TYPE)' \ |
| 28 |
--build='$(DEB_BUILD_GNU_TYPE)' \ |
| 29 |
--prefix=/usr \ |
| 30 |
--mandir='$${prefix}/share/man' \ |
| 31 |
--infodir='$${prefix}/share/info' |
| 32 |
|
| 33 |
build: build-stamp |
| 34 |
build-arch: |
| 35 |
build-indep: |
| 36 |
build-stamp: config.status |
| 37 |
-gcc -v |
| 38 |
$(MAKE) |
| 39 |
$(MAKE) utils |
| 40 |
$(MAKE) -Cdoc html |
| 41 |
touch build-stamp |
| 42 |
|
| 43 |
clean: |
| 44 |
-$(MAKE) distclean |
| 45 |
rm -f build-stamp |
| 46 |
rm -rf '$(DIR)' |
| 47 |
rm -f changelog |
| 48 |
dh_clean |
| 49 |
|
| 50 |
install: build-stamp |
| 51 |
rm -rf '$(DIR)' |
| 52 |
# bin sbin |
| 53 |
install -d -m0755 '$(DIR)'/usr/bin |
| 54 |
install -d -m0755 '$(DIR)'/usr/sbin |
| 55 |
install -m0755 integrit utils/i-viewdb '$(DIR)'/usr/sbin/ |
| 56 |
install -m0755 utils/i-ls '$(DIR)'/usr/bin/ |
| 57 |
# Maybe `dh_strip` would be better. For now, leaving it as it was |
| 58 |
# in 4.1-5 |
| 59 |
$(STRIP) -R .note -R .comment '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/* |
| 60 |
# lib |
| 61 |
install -d -m0755 '$(DIR)'/var/lib/integrit/ |
| 62 |
# etc |
| 63 |
install -d -m0755 '$(DIR)'/etc/integrit |
| 64 |
install -m0600 debian/integrit.conf \ |
| 65 |
debian/integrit.debian.conf '$(DIR)'/etc/integrit/ |
| 66 |
# cron |
| 67 |
dh_installcron |
| 68 |
# man |
| 69 |
dh_installman doc/*.1 |
| 70 |
# info |
| 71 |
dh_installinfo doc/integrit.info |
| 72 |
# lintian overrides |
| 73 |
dh_lintian |
| 74 |
# upstream changelog |
| 75 |
rm -f changelog && ln -s Changes changelog |
| 76 |
dh_installchangelogs |
| 77 |
# additional docs |
| 78 |
dh_installdocs |
| 79 |
dh_installexamples |
| 80 |
install -m0755 -d '$(DIR)'/usr/share/doc/integrit/etc |
| 81 |
install -m0644 debian/etc/*.conf '$(DIR)'/usr/share/doc/integrit/etc/ |
| 82 |
dh_compress |
| 83 |
dh_fixperms |
| 84 |
# Restore special modes (used 4.1-5 and earlier and no time to figure out why) |
| 85 |
chmod u=rx,go= '$(DIR)'/usr/sbin/* |
| 86 |
chmod go= '$(DIR)'/etc/integrit/*.conf |
| 87 |
|
| 88 |
|
| 89 |
binary-indep: |
| 90 |
|
| 91 |
binary-arch: install |
| 92 |
dh_makeshlibs |
| 93 |
# The binaries are statically linked, so ${shlib:Depends} never gets |
| 94 |
# generated. Kept it in anyway to avoid people thinking it was missing.i |
| 95 |
dh_shlibdeps |
| 96 |
dh_installdeb |
| 97 |
dh_gencontrol -- -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version})' -W libc-dev-bin)" |
| 98 |
dh_md5sums |
| 99 |
dh_builddeb |
| 100 |
|
| 101 |
binary: binary-indep binary-arch |
| 102 |
|
| 103 |
.PHONY: config build clean binary-indep binary-arch binary install |