File: rules

package info (click to toggle)
cgiemail 1.6-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 204 kB
  • ctags: 103
  • sloc: ansic: 1,418; makefile: 110
file content (67 lines) | stat: -rwxr-xr-x 2,082 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
#!/usr/bin/make -f

arch=$(shell dpkg --print-architecture)

package=cgiemail
tempdir=$(shell pwd)/debian/tmp
insdirs=$(tempdir)/$(package)/DEBIAN \
	$(tempdir)/$(package)/usr/lib/cgi-bin \
	$(tempdir)/$(package)/usr/doc/cgiemail \
	$(tempdir)/$(package)/usr/man/man1

binary: binary-arch binary-indep

binary-arch: debian/control checkroot build $(insdirs)
	install -s -m 755 cgiemail $(tempdir)/$(package)/usr/lib/cgi-bin
	install -s -m 755 cgiecho $(tempdir)/$(package)/usr/lib/cgi-bin
	install -s -m 755 cgifile $(tempdir)/$(package)/usr/lib/cgi-bin
	install -m 644 debian/changelog $(tempdir)/$(package)/usr/doc/$(package)/changelog.Debian
	install -m 644 ChangeLog $(tempdir)/$(package)/usr/doc/$(package)/changelog
	install -m 644 README $(tempdir)/$(package)/usr/doc/$(package)/README
	find $(tempdir)/$(package)/usr/doc/$(package) -type f | xargs -r gzip -v9	
	install -m 644 debian/copyright $(tempdir)/$(package)/usr/doc/$(package)/copyright
	ln -s ../man7/undocumented.7.gz $(tempdir)/$(package)/usr/man/man1/cgiemail.1.gz
	ln -s ../man7/undocumented.7.gz $(tempdir)/$(package)/usr/man/man1/cgiecho.1.gz
	dpkg-shlibdeps $(tempdir)/$(package)/usr/lib/cgi-bin/cgiemail $(tempdir)/$(package)/usr/lib/cgi-bin/cgiecho
	dpkg-gencontrol -P$(tempdir)/$(package)
	chown -R root.root $(tempdir)/$(package)
	chmod -R g-ws $(tempdir)/$(package)
	dpkg --build $(tempdir)/$(package) ..

binary-indep: debian/control checkroot build $(insdirs)

build: debian/control
	CFLAGS=-O2 LDFLAGS= ./configure --enable-cgienv
	make
	touch build

checkroot: debian/control
	test "root" = "$(shell whoami)"

clean: debian/control
	if [ -e Makefile ]; then \
		make -i distclean; \
	fi
	for i in cgi.h testce.html build debian/files debian/substvars `find -name "*~"`; do \
		if [ -e $$i ]; then \
			rm -f $$i; \
		fi; \
	done
	for i in $(tempdir); do \
		if [ -d $$i ]; then \
			rm -rf $$i; \
		fi; \
	done

$(insdirs):
	if [ -d $@ ]; then \
		rm -rf $@; \
	fi
	install -d -m 755 $@
	chmod g-s $@

.PHONY: binary binary-arch binary-indep checkroot clean

#Local variables:
#mode: makefile
#End: