File: rules

package info (click to toggle)
integrit 3.02.00-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,480 kB
  • ctags: 559
  • sloc: ansic: 4,204; makefile: 385; sh: 306; perl: 224
file content (110 lines) | stat: -rwxr-xr-x 3,137 bytes parent folder | download
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
107
108
109
110
#!/usr/bin/make -f

CFLAGS =-Wall
STRIP =strip
CC =diet -v -Os gcc

DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)

DIET_ARCHS =alpha amd64 arm hppa i386 ia64 mips mipsel powerpc ppc64 s390 sparc
ifeq (,$(findstring $(DEB_HOST_ARCH),$(DIET_ARCHS)))
  CC =gcc
endif

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
endif

DIR =$(shell pwd)/debian/integrit

patch: deb-checkdir patch-stamp
patch-stamp:
	for i in `ls -1 debian/diff/*.diff || :`; do \
	  patch -p0 <$$i || exit 1; \
	done
	touch patch-stamp

config: deb-checkdir config.status
config.status: patch-stamp configure
	CC='$(CC)' CFLAGS='$(CFLAGS)' ./configure \
	  --host='$(DEB_HOST_GNU_TYPE)' \
	  --build='$(DEB_BUILD_GNU_TYPE)' \
	  --prefix=/usr \
	  --mandir='$${prefix}/share/man' \
	  --infodir='$${prefix}/share/info'

build: deb-checkdir build-stamp
build-stamp: config.status
	-gcc -v
	$(MAKE)
	$(MAKE) utils
	$(MAKE) -Cdoc html
	touch build-stamp

clean: deb-checkdir deb-checkuid
	-$(MAKE) distclean
	test ! -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff || :`; do \
	    patch -p0 -R <$$i || exit 1; \
	  done
	rm -f build-stamp patch-stamp
	rm -rf '$(DIR)'
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	# bin sbin
	install -d -m0755 '$(DIR)'/usr/bin
	install -d -m0755 '$(DIR)'/usr/sbin
	install -m0500 integrit utils/i-viewdb '$(DIR)'/usr/sbin/
	install -m0755 utils/i-ls '$(DIR)'/usr/bin/
	$(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 -oroot -groot debian/integrit.conf \
	  debian/integrit.debian.conf '$(DIR)'/etc/integrit/
	# cron
	install -d -m0755 '$(DIR)'/etc/cron.daily
	install -m0755 debian/integrit.cron.daily \
	  '$(DIR)'/etc/cron.daily/integrit
	# man
	install -d -m0755 '$(DIR)'/usr/share/man/man1
	install -m0644 doc/*.1 '$(DIR)'/usr/share/man/man1/
	gzip -9 '$(DIR)'/usr/share/man/man1/*.1
	# info
	install -d -m0755 '$(DIR)'/usr/share/info
	install -m0644 doc/integrit.info '$(DIR)'/usr/share/info/
	gzip -9 '$(DIR)'/usr/share/info/*.info
	# lintian overrides
	install -d -m0755 '$(DIR)'/usr/share/lintian/overrides
	install -m0644 debian/integrit.lintian \
	  $(DIR)/usr/share/lintian/overrides/integrit
	# upstream changelog
	rm -f changelog && ln -s Changes changelog
	# additional docs
	install -m0755 -d '$(DIR)'/usr/share/doc/integrit/etc
	install -m0644 debian/etc/*.conf '$(DIR)'/usr/share/doc/integrit/etc/

binary-indep:

binary-arch: deb-checkdir deb-checkuid install integrit.deb
	dpkg-gencontrol -isp -pintegrit -P'$(DIR)'
	dpkg -b '$(DIR)' ..

binary: binary-indep binary-arch

.PHONY: patch config build clean binary-indep binary-arch binary install

include debian/implicit