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 104 105 106
|
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for tripwire
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
package := $(firstword $(shell dh_listpackages))
prefix := $(PWD)/debian/$(package)
share := /usr/share
etc := /etc/$(package)
config_flags := --prefix=/usr \
--sysconfdir=$(etc) \
--mandir=$(share)/man \
--infodir=$(share)/info \
--build $(DEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
config_flags += --host $(DEB_HOST_GNU_TYPE)
endif
cflags := -g -Wall
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
cflags += -O2
else
cflags += -O0
endif
export CFLAGS=$(cflags)
export CXXFLAGS=$(cflags)
lintian := $(share)/lintian/overrides
version := $(shell dpkg-parsechangelog | \
sed -ne 's/Version: *\([0-9]\+:\)*//p')
get_misc_file = ln -sf /usr/share/misc/$(1) .
update_config_sub := $(call get_misc_file,config.sub)
update_config_guess := $(call get_misc_file,config.guess)
tag:
cvs tag -c -F $(subst .,_,debian_version_$(version))
ifeq ($(findstring -,$(version)),)
cvs tag -c -F $(subst .,_,upstream_version_$(version))
endif
config: config-stamp
config-stamp:
dh_testdir
$(update_config_sub)
$(update_config_guess)
$(SHELL) ./configure $(config_flags) \
--disable-openssl \
--disable-static \
--disable-debug
-mkdir bin lib
touch $@
build: config build-stamp
build-stamp:
$(MAKE)
touch $@
clean: checkroot
rm -f *-stamp config.sub config.guess
-$(MAKE) distclean
rm -rf bin lib
dh_clean
binary-arch: checkroot build
dh_clean
dh_installdirs \
$(etc) \
/usr/lib/$(package)/databases \
/var/lib/$(package)/report
$(MAKE) install DESTDIR=$(prefix)
install -m 600 debian/twcfg.txt debian/twpol.txt $(prefix)/$(etc)
install -m 644 -D debian/overrides $(prefix)/$(lintian)/$(package)
dh_installdocs README MAINTAINERS Release_Notes TRADEMARK WISHLIST
dh_installchangelogs ChangeLog
dh_installexamples policy/*.txt
dh_installcron
dh_strip
dh_compress
dh_fixperms
dh_installdebconf
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary-indep: checkroot build
binary: binary-indep binary-arch
checkroot:
dh_testdir
dh_testroot
.PHONY: binary binary-arch binary-indep clean checkroot build config
|