File: rules

package info (click to toggle)
checkpw 1.02-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 552 kB
  • sloc: ansic: 2,169; makefile: 396; sh: 189
file content (88 lines) | stat: -rwxr-xr-x 2,445 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/make -f

CC =gcc
CFLAGS =-g -O2 -Wall
LDFLAGS =
STRIP =strip

DIET_ARCHS =alpha amd64 arm hppa i386 ia64 mips mipsel powerpc ppc64 s390 sparc
ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc
  CFLAGS =-nostdinc -Wall
endif

ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

DIR =$(shell pwd)/debian/checkpw

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

build: deb-checkdir build-stamp
build-stamp: patch-stamp
	for i in conf-*; do \
	  test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \
	done
	echo '$(CC) $(CFLAGS)' >conf-cc
	echo '$(CC) $(LDFLAGS)' >conf-ld
	echo /usr >conf-home
	$(MAKE)
	touch build-stamp

clean: deb-checkdir deb-checkuid
	rm -f `cat TARGETS`
	test ! -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
	for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done
	rm -f build-stamp patch-stamp
	rm -rf '$(DIR)' '$(DIR)'-run
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	install -d -m0755 '$(DIR)'/usr/bin
	echo '$(DIR)'/usr >conf-home
	rm -f install instcheck auto_home.o auto_home.c
	$(MAKE) install instcheck
	./install
	./instcheck
	rm -f '$(DIR)'/usr/bin/loginlog
	rm -f '$(DIR)'/usr/bin/selectcheckpw
	chmod 0755 '$(DIR)'/usr/bin/*
	$(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
	# man pages
	install -d -m0755 '$(DIR)'/usr/share/man/man8
	install -m0644 debian/checkpw.8 debian/checkapoppw.8 \
	  '$(DIR)'/usr/share/man/man8/
	gzip -9 '$(DIR)'/usr/share/man/man8/*.8
	# service directories
	for i in pop apop; do \
	  install -d -m0755 '$(DIR)'/usr/share/doc/checkpw/etc/$$i/log && \
	  install -m0644 debian/$$i/run \
	    '$(DIR)'/usr/share/doc/checkpw/etc/$$i/run && \
	  install -m0644 debian/$$i/log/run \
	    '$(DIR)'/usr/share/doc/checkpw/etc/$$i/log/run || exit 1; \
	done
	# upstream changelog
	test -r changelog || ln -s CHANGES changelog

binary-indep:

binary-arch: deb-checkdir deb-checkuid install checkpw.deb
	test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/*
	dpkg-gencontrol -isp -pcheckpw -P'$(DIR)'
	dpkg -b '$(DIR)' ..

binary: binary-indep binary-arch

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

include debian/implicit