File: rules

package info (click to toggle)
mh-book 9910-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 8,136 kB
  • ctags: 2,983
  • sloc: sh: 2,048; perl: 773; ansic: 279; makefile: 52; csh: 8
file content (77 lines) | stat: -rwxr-xr-x 3,512 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
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

package=mh-book
SHELL=/bin/bash

build:
	$(checkdir)

clean:
	$(checkdir)
	-rm -f build
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: checkroot
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp
	cd debian/tmp && install -d `cat ../dirs`
	tar --exclude debian --exclude README --exclude README.ftp-site -cf - ./ | ( cd debian/tmp/usr/share/doc/mh-book/html/ ; tar xf - )
# Add Debian comments about search engine being different than Jerry's
	(cd debian/tmp/usr/share/doc/mh-book/html/ ; patch srchhelp.htm < ../../../../../../cgi/srchhelp.html.patch)
# convert HREF tags in mh-e's .html files to .html.gz (except index.html)
# and adjust search-engine URL
	(cd debian/tmp/usr/share/doc/mh-book/html/mh-e/ ; ../../../../../../../scripts/href2gz *.html)
# rename htm files to html, correct HREF tags within them, 
# and adjust search-engine URL
	(cd debian/tmp/usr/share/doc/mh-book/html/; ../../../../../../scripts/htm2html  *.htm */*.htm */*/*.htm) 
	(cd debian/tmp/usr/share/doc/mh-book/html/; rm  *.htm */*.htm */*/*.htm) 
	(cd debian/tmp/usr/share/doc/mh-book/html/; find . -name "*.html" -exec gzip --best '{}' \; )
	(cd debian/tmp/usr/share/doc/mh-book/html/; find . -name "index.html.gz" -exec gunzip '{}' \; )
	(cd debian/tmp/usr/share/doc/mh-book/html/; find . -name "frm-*.html.gz" -exec gunzip '{}' \; )
# Add a border to mhcover.gif, otherwise it's white on white
# We need ImageMagick for this.
#	convert -border 3x3 -bordercolor black overall/figs/mhcover.gif debian/tmp/usr/share/doc/mh-book/html/overall/figs/mhcover.gif
# Use my own frm-srch.html
	install -m 0644 debian/cgi/frm-srch.html debian/tmp/usr/share/doc/mh-book/html/
	(gunzip debian/tmp/usr/share/doc/mh-book/html/indx-cgi.html.gz)
# move examples over to standard Debian location 
	(cd debian/tmp/usr/share/doc/mh-book; mv html/download/split examples)
# ...and link them back in html tree
	(cd debian/tmp/usr/share/doc/mh-book/html/download/ ; ln -s ../../examples split)
# rfl script doesn't have Debian's path for perl
	(cd debian/tmp/usr/share/doc/mh-book/examples/mh/bin; perl -pi -e s:/usr/local/bin/perl:/usr/bin/perl: rfl)
# install cgi-bin script
	install -m 755 debian/cgi/mh-book-index debian/tmp/usr/lib/cgi-bin/
	(cd debian/tmp/usr/lib/cgi-bin/ ; ln mh-book-index mh-book-index-frames )
# install postscript conversion script
	install -m 0644 debian/postscript/make-postscript-mh-book* debian/tmp/usr/share/doc/mh-book/postscript/
	install -m 0644 debian/postscript/README debian/tmp/usr/share/doc/mh-book/postscript/README.debian

	install -m 0644 debian/doc-base debian/tmp/usr/share/doc-base/mh-book
	gzip --best -c debian/changelog > debian/tmp/usr/share/doc/mh-book/changelog.Debian.gz
# Using debstd -m : no man page search, otherwise it installs example 
#                   scripts man pages
#       debstd -c : no compression, otherwise it mangles the example scripts
	debstd -m -c README README.ftp-site
	dpkg-gencontrol -isp
	chmod +x debian/tmp/usr/share/doc/mh-book/examples/mh/bin/*
	chmod +x debian/tmp/usr/share/doc/mh-book/examples/xmh/bin/*
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f debian/rules
endef

binary: binary-indep

checkroot:
	$(checkdir)
	test root = "`whoami`"

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