File: rules

package info (click to toggle)
cvs2html 1.96-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 84 kB
  • ctags: 28
  • sloc: perl: 1,249; makefile: 57; sh: 5
file content (70 lines) | stat: -rwxr-xr-x 2,136 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/make -f
# Written by Antti-Juhani Kaijanaho <ajk@debian.org>
# You may treat this file as if it were in the public domain.

package := $(shell dpkg-parsechangelog | grep-dctrl -sSource -n '' -)
version := $(shell dpkg-parsechangelog | grep-dctrl -sVersion -n '' -)
upversion := $(shell echo $(version) | sed 's/-[^-]$$//')

install := install -o root -g root
install_dir := $(install) -m 0755 -d
install_exec := $(install) -m 0755 -s
install_nonex := $(install) -m 0644
install_script := $(install) -m 0755

rootdir := debian/tmp
bindir  := $(rootdir)/usr/bin
ctldir  := $(rootdir)/DEBIAN
docdir  := $(rootdir)/usr/share/doc/$(package)
mandir  := $(rootdir)/usr/share/man
man1dir := $(mandir)/man1

build: debian/build.stamp
debian/build.stamp:
	chmod u+x cvs2html
	./cvs2html -help > debian/help.txt.new
	chmod u-x cvs2html
	mv debian/help.txt.new debian/help.txt
	touch $@

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

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

binary-indep: debian/binary-indep.stamp
debian/binary-indep.stamp:
	$(install_dir) $(ctldir)
	$(install_script) debian/prerm  $(ctldir)
	$(install_dir) $(bindir)
	$(install_script) cvs2html $(bindir)
	$(install_dir) $(docdir)
	$(install_nonex) debian/changelog $(docdir)/changelog.Debian
	cd $(docdir) && gzip -9f changelog.Debian
	$(install_nonex) debian/help.txt $(docdir)
	$(install_dir) $(man1dir)
	$(install_nonex) debian/cvs2html.1 $(man1dir)
	gzip -9f $(man1dir)/cvs2html.1
	$(install_nonex) debian/copyright $(docdir)
	chmod -R g-s *
	dpkg-gencontrol -isp
	dpkg --build debian/tmp ..
	touch $@

clean :
	rm -f debian/*.stamp *~ debian/*~ debian/files
	rm -f debian/help.txt debian/help.txt.new
	rm -rf $(rootdir)

orig-tarball : ../$(package)_$(upversion).orig.tar.gz
../$(package)_$(upversion).orig.tar.gz :
	mv cvs2html cvs2html.bak
	wget ftp://ftp.sslug.dk/pub/utils/cvs2html
	cd .. && tar zcvf $(package)_$(upversion).orig.tar.gz \
	                  $(package)-$(upversion)/cvs2html
	mv cvs2html.bak cvs2html

.PHONY: binary-arch binary-all binary build clean orig-tarball