File: rules

package info (click to toggle)
bcron 0.09-11%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 496 kB
  • ctags: 313
  • sloc: ansic: 2,055; sh: 419; makefile: 113
file content (132 lines) | stat: -rwxr-xr-x 4,463 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/make -f

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

CFLAGS =-g -O2 -Wall
LDFLAGS =
CC =gcc
BGLIBS =/usr/lib/bglibs
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS =-g -O0 -Wall
endif
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc -nostdinc
  BGLIBS =/usr/lib/diet/bglibs
endif

DIR =$(shell pwd)/debian/bcron

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-arch-stamp build-indep-stamp

build-arch: deb-checkdir build-arch-stamp
build-arch-stamp: patch-stamp
	-gcc -v
	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/sbin' >conf-bin
	echo '$(BGLIBS)/include' >conf-bgincs
	echo '$(BGLIBS)/lib' >conf-bglibs
	$(MAKE)
	sh tests.sh
	touch build-arch-stamp

build-indep: deb-checkdir build-indep-stamp
build-indep-stamp: 
	touch build-indep-stamp

clean: deb-checkdir deb-checkuid patch-stamp
	$(MAKE) clean
	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-arch-stamp build-indep-stamp patch-stamp
	rm -rf '$(DIR)' '$(DIR)'-run
	rm -f debian/files debian/substvars changelog

install: install-arch install-indep
install-arch: deb-checkdir deb-checkuid build-arch-stamp
	rm -rf '$(DIR)'
	install -d -m0755 '$(DIR)'/usr/bin '$(DIR)'/usr/sbin
	PATH="/usr/lib/bglibs/bin:$$PATH" make install install_prefix='$(DIR)'
	rm -f '$(DIR)'/usr/sbin/crontab
	$(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/*
	mv '$(DIR)'/usr/sbin/bcrontab '$(DIR)'/usr/bin/bcrontab
	install -d -m0755 '$(DIR)'/etc/bcron
	# man pages
	for i in 1 5 8; do \
	  install -d -m0755 '$(DIR)'/usr/share/man/man$$i && \
	  install -m0644 *.$$i '$(DIR)'/usr/share/man/man$$i/ || exit 1; \
	done
	mv '$(DIR)'/usr/share/man/man5/crontab.5 \
	  '$(DIR)'/usr/share/man/man5/bcrontab.5
	gzip -9 '$(DIR)'/usr/share/man/man?/*.?
	# info
	install -d -m0755 '$(DIR)'/usr/share/info
	install -m0644 bcron.info '$(DIR)'/usr/share/info/
	gzip -9 '$(DIR)'/usr/share/info/*.info
	test -r changelog || ln -s ChangeLog changelog

install-indep: deb-checkdir deb-checkuid build-indep-stamp
	rm -rf '$(DIR)'-run
	install -d -m0755 '$(DIR)'-run/usr/bin
	ln -s bcrontab '$(DIR)'-run/usr/bin/crontab
	install -d -m0755 '$(DIR)'-run/var/spool/cron/crontabs
	install -d -m0755 '$(DIR)'-run/var/spool/cron/tmp
	install -d -m0755 '$(DIR)'-run/etc/cron.d
	install -d -m0755 '$(DIR)'-run/etc/bcron-sched/log
	install -m0755 debian/etc/bcron-sched/run \
	  '$(DIR)'-run/etc/bcron-sched/run
	install -m0755 debian/etc/bcron-sched/log/run \
	  '$(DIR)'-run/etc/bcron-sched/log/run
	install -d -m0755 '$(DIR)'-run/etc/bcron-spool/log
	install -m0755 debian/etc/bcron-spool/run \
	  '$(DIR)'-run/etc/bcron-spool/run
	install -m0755 debian/etc/bcron-spool/log/run \
	  '$(DIR)'-run/etc/bcron-spool/log/run
	install -d -m0755 '$(DIR)'-run/etc/bcron-update/log
	install -m0755 debian/etc/bcron-update/run \
	  '$(DIR)'-run/etc/bcron-update/run
	install -m0755 debian/etc/bcron-update/log/run \
	  '$(DIR)'-run/etc/bcron-update/log/run
	install -d -m0755 '$(DIR)'-run/var/log/bcron/spool
	install -d -m0755 '$(DIR)'-run/var/log/bcron/update
	install -m0644 debian/crontab '$(DIR)'-run/etc/crontab
	install -d -m0755 '$(DIR)'-run/etc/cron.daily
	install -d -m0755 '$(DIR)'-run/etc/cron.hourly
	install -d -m0755 '$(DIR)'-run/etc/cron.monthly
	test -r changelog || ln -s ChangeLog changelog
	# man pages
	install -d -m0755 '$(DIR)'-run/usr/share/man/man5
	ln -s bcrontab.5.gz '$(DIR)'-run/usr/share/man/man5/crontab.5.gz
	install -d -m0755 '$(DIR)'-run/usr/share/man/man1
	ln -s bcrontab.1.gz '$(DIR)'-run/usr/share/man/man1/crontab.1.gz

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

binary-indep: deb-checkdir deb-checkuid install-indep bcron-run.deb
	dpkg-gencontrol -isp -pbcron-run -P'$(DIR)'-run
	dpkg -b '$(DIR)'-run ..

binary: binary-indep binary-arch

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

include debian/implicit