File: rules

package info (click to toggle)
httptunnel 3.3%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 524 kB
  • ctags: 309
  • sloc: ansic: 4,646; sh: 338; makefile: 97
file content (100 lines) | stat: -rwxr-xr-x 2,418 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
#!/usr/bin/make -f
#-*- makefile -*-

install		= install -o root -g root
install_exec	= $(install) -m 755
install_dir	= $(install) -m 755 -d
install_nonex	= $(install) -m 644
install_script	= $(install) -m 755
install_zipped	= gzip -9vc
install_symlink	= ln -s
install_strip   = echo

package		= httptunnel
rootdir		= `pwd`/debian/tmp
docdir		= $(rootdir)/usr/share/doc/$(package)
bindir		= $(rootdir)/usr/bin
mandir		= $(rootdir)/usr/share/man
man1dir		= $(mandir)/man1

ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	install_strip = strip --remove-section=.comment --remove-section=.note
endif

CFLAGS=-g -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

# TODO: - build-indep/build-arch, policy section 7. + 4.8
#       - DEB_BUILD_OPTIONS, section 10.1

build: debian/build.stamp
debian/build.stamp:
	$(checkdir)
	CFLAGS="$(CFLAGS)" CC=gcc ./configure --prefix=/usr \
		--mandir=/usr/share/man
	$(MAKE)
	touch $@

clean-build:
	$(RM) debian/build*.stamp
	[ ! -f Makefile ] || $(MAKE) distclean

binary: binary-arch binary-indep

binary-indep: debian/binary-indep.stamp
debian/binary-indep.stamp:
	touch $@

binary-arch: debian/binary-arch.stamp
debian/binary-arch.stamp: build
	$(checkdir)
	$(RM) -r $(rootdir)
	$(install_dir) $(rootdir)
	$(install_dir) $(rootdir)/DEBIAN
	$(install_dir) $(docdir)
	$(install_dir) $(bindir)
	$(install_dir) $(man1dir)
	$(MAKE) install-strip prefix=`pwd`/debian/tmp/usr mandir=`pwd`/debian/tmp/usr/share/man
#	changelogs
	$(install_nonex) debian/changelog $(docdir)/changelog.Debian
	$(install_nonex) ChangeLog $(docdir)/changelog
#	docs
	$(install_nonex) FAQ $(docdir)
	$(install_nonex) NEWS $(docdir)
	$(install_nonex) README $(docdir)
	$(install_nonex) TODO $(docdir)
	$(install_nonex) DISCLAIMER $(docdir)
	$(install_nonex) AUTHORS $(docdir)
	$(install_nonex) HACKING $(docdir)
	gzip -9vfr $(docdir)/

	gzip -9vfr $(man1dir)/

#	copyright
	$(install_nonex) debian/copyright $(docdir)
#	control
	$(install_script) debian/prerm $(rootdir)/DEBIAN

	dpkg-shlibdeps $(bindir)/hts $(bindir)/htc
	dpkg-gencontrol -isp

	chown -R root.root $(rootdir)
	chmod -R g-ws $(rootdir)

	dpkg --build $(rootdir) ..
	touch $@

define checkdir
	test -f htc.c -a -f hts.c -a -f debian/rules
endef

clean-binary:
	$(RM) debian/binary*.stamp
	$(RM) *~
	$(RM) -r debian/tmp debian/*~ debian/files debian/substvars

clean: clean-build clean-binary