#!/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