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
|
#!/usr/bin/make -f
CFLAGS =-Wall -Drpl_malloc=malloc
DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS +=-g
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS +=-O0
else
CFLAGS +=-O2
endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
STRIP =: nostrip
else
STRIP = $(DEB_HOST_GNU_TYPE)-strip
endif
DIR =$(shell pwd)/debian/integrit
config: config.status
config.status: configure
CC='$(CC)' CFLAGS='$(CFLAGS)' sh ./configure \
--host='$(DEB_HOST_GNU_TYPE)' \
--build='$(DEB_BUILD_GNU_TYPE)' \
--prefix=/usr \
--mandir='$${prefix}/share/man' \
--infodir='$${prefix}/share/info'
build: build-stamp
build-stamp: config.status
-gcc -v
$(MAKE)
$(MAKE) utils
$(MAKE) -Cdoc html
touch build-stamp
clean:
-$(MAKE) distclean
rm -f build-stamp
rm -rf '$(DIR)'
rm -f changelog
dh_clean
install: build-stamp
rm -rf '$(DIR)'
# bin sbin
install -d -m0755 '$(DIR)'/usr/bin
install -d -m0755 '$(DIR)'/usr/sbin
install -m0755 integrit utils/i-viewdb '$(DIR)'/usr/sbin/
install -m0755 utils/i-ls '$(DIR)'/usr/bin/
# Maybe `dh_strip` would be better. For now, leaving it as it was
# in 4.1-5
$(STRIP) -R .note -R .comment '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
# lib
install -d -m0755 '$(DIR)'/var/lib/integrit/
# etc
install -d -m0755 '$(DIR)'/etc/integrit
install -m0600 debian/integrit.conf \
debian/integrit.debian.conf '$(DIR)'/etc/integrit/
# cron
dh_installcron
# man
dh_installman doc/*.1
# info
dh_installinfo doc/integrit.info
# lintian overrides
dh_lintian
# upstream changelog
rm -f changelog && ln -s Changes changelog
dh_installchangelogs
# additional docs
dh_installdocs
dh_installexamples
install -m0755 -d '$(DIR)'/usr/share/doc/integrit/etc
install -m0644 debian/etc/*.conf '$(DIR)'/usr/share/doc/integrit/etc/
dh_compress
dh_fixperms
# Restore special modes (used 4.1-5 and earlier and no time to figure out why)
chmod u=rx,go= '$(DIR)'/usr/sbin/*
chmod go= '$(DIR)'/etc/integrit/*.conf
binary-indep:
binary-arch: install
dh_makeshlibs
# The binaries are statically linked, so ${shlib:Depends} never gets
# generated. Kept it in anyway to avoid people thinking it was missing.i
dh_shlibdeps
dh_installdeb
dh_gencontrol -- -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version})' -W libc-dev-bin)"
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: config build clean binary-indep binary-arch binary install
|