File: rules

package info (click to toggle)
dict-misc 1.5A-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,904 kB
  • ctags: 3,983
  • sloc: makefile: 101; sh: 65
file content (181 lines) | stat: -rwxr-xr-x 7,012 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#! /usr/bin/make -f

############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author           : Robert D. Hilliard <hilliard@debian.org>
## Created On       : Thu, 23 Apr 1998 17:54:36 -0400
## Last Modified By : Robert D. Hilliard <hilliard@debian.org>
## Last Modified On : Sun, 20 Apr 2003 20:27:46 -0400
## Status           : $Id: rules,v 1.14 2003/04/21 01:14:06 bob Exp bob $
## Last Changes     : $Log: rules,v $
## Last Changes     : Revision 1.14  2003/04/21 01:14:06  bob
## Last Changes     : added -isp to dpkg-gencontrol
## Last Changes     :
## Last Changes     : Revision 1.13  2003/04/21 01:00:46  bob
## Last Changes     : added dictionary files to "files to clean"
## Last Changes     :
## Last Changes     : Revision 1.12  2003/04/21 00:57:54  bob
## Last Changes     : Fixed install command for dictionaries.
## Last Changes     :
## Last Changes     : Revision 1.11  2003/04/21 00:49:52  bob
## Last Changes     : changed ./dictfmt to dictfmt
## Last Changes     :
## Last Changes     : Revision 1.10  2003/04/21 00:48:15  bob
## Last Changes     : Fixed sed command for easton.
## Last Changes     :
## Last Changes     : Revision 1.9  2003/04/21 00:44:05  bob
## Last Changes     : Corrected pathname to data files.
## Last Changes     :
## Last Changes     : Revision 1.8  2003/04/21 00:40:26  bob
## Last Changes     : Fixed space/tab problem.
## Last Changes     :
## Last Changes     : Revision 1.7  2003/04/21 00:31:24  bob
## Last Changes     : We now use local dictfmt and dictzip, so build doesn't build the tools
## Last Changes     : The dictionaries are now built by this rules file.
## Last Changes     : Removed prerm scripts, which did nothing except remove /usr/doc symlinks.
## Last Changes     :
## Description      : debian/rules for dict-misc
## Acknowledgment   : This debian/rules file is based on Manoj Srivasta's 
##                  : <srivasta@debian.org> sample debian/rules files,
##                  : but any errors belong to me.
###############################################################################

# The name of the package (for example, `emacs').
pkg   := dict-misc
pkg-east := dict-easton
pkg-hitch := dict-hitchcock

# Configuration variables (these should be pretty generic)
CC = cc
CFLAGS=  -O2 
LDFLAGS = -s
PREFIX = /usr
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man
MAN1DIR = $(MANDIR)/man1
DOCDIR = $(PREFIX)/share/doc/$(pkg)
DICTDIR= /usr/share/dictd

#  Package specific stuff.  The idea is to try to make the rules
#  generic (gradually).

FILES_TO_CLEAN  = debian/files *.dict.* *.index 
DIRS_TO_CLEAN   = debian/tmp-east debian/tmp-hitch
STAMPS_TO_CLEAN = stamp-configure stamp-build stamp-binary-indep



install_file= install -p -o root -g root -m 644
install_program= install -p -o root -g root -m 755
make_directory= install -d -o root -g root -m 755

all build: stamp-build
# Builds the binary package.


stamp-build:
# Builds the binary package.
	$(checkdir)
	cat easton/easton-info.txt easton/T*.html		\
	    | sed 's,<A HREF=[^>]*>\([^<]*\).*</A>,{\1},g'    \
	    | sed 's,\([A-Z][A-Z]*\) .T000[0-9]*,{\1},g' \
	| dictfmt -e					    \
	    -u ftp://ccel.wheaton.edu/ebooks/HTML/e/easton/ebd/ \
	    -s "Easton's 1897 Bible Dictionary" easton
	if [ "$(DICTZIP)" != "cat" ]; then		\
	        dictzip -v easton.dict;			\
	fi

	dictfmt -h							     \
	   -u ftp://ccel.wheaton.edu/ebooks/HTML/bible_names/bible_names.txt \
	   -s "Hitchcock's Bible Names Dictionary (late 1800's)"	     \
	   hitchcock < bible_names.txt
	if [ "$(DICTZIP)" != "cat" ]; then	\
	   dictzip -v hitchcock.dict; fi

	touch stamp-build

clean:
# Undoes the effect of `$(MAKE) -f debian/rules build'.
	$(checkdir)
	-test -f Makefile && $(MAKE) distclean       
	-rm -f  $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
	-rm -rf $(DIRS_TO_CLEAN)
	-rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS

binary: binary-indep binary-arch

binary-indep: build stamp-binary-indep


binary-arch: build stamp-binary-indep

stamp-binary-indep:
# Makes a binary package.
	@test root = "`whoami`" || (echo need root privileges; exit 1)
	$(checkdir)
	test -f stamp-build  || $(MAKE) -f debian/rules build
#	rm -rf               debian/tmp-* debian/tmp.deb
	$(make_directory)    debian/tmp-east
	$(make_directory)    debian/tmp-east/DEBIAN
	$(make_directory)    debian/tmp-east/usr
	$(make_directory)    debian/tmp-east/usr/share
	$(make_directory)    debian/tmp-east/usr/share/dictd
	$(make_directory)    debian/tmp-east/usr/share/doc
	$(make_directory)    debian/tmp-east/usr/share/doc/$(pkg-east)
	$(install_file)      easton.* debian/tmp-east/$(DICTDIR)
	$(install_file)      ChangeLog \
			       debian/tmp-east/usr/share/doc/$(pkg-east)/changelog
	$(install_file)      debian/changelog \
			       debian/tmp-east/usr/share/doc/$(pkg-east)/changelog.Debian
	gzip -9frq           debian/tmp-east/usr/share/doc/$(pkg-east)/
	$(install_program)    debian/postinst.east debian/tmp-east/DEBIAN/postinst
	$(install_program)    debian/postrm.east debian/tmp-east/DEBIAN/postrm
# Make sure the copyright file is not compressed
	$(install_file)      debian/copyright-east \
	                     debian/tmp-east/usr/share/doc/$(pkg-east)/copyright
	dpkg-gencontrol      -isp -p$(pkg-east) -Pdebian/tmp-east
	chown -R root.root   debian/tmp-east
	dpkg --build         debian/tmp-east ..

	$(make_directory)    debian/tmp-hitch
	$(make_directory)    debian/tmp-hitch/DEBIAN
	$(make_directory)    debian/tmp-hitch/usr
	$(make_directory)    debian/tmp-hitch/usr/share
	$(make_directory)    debian/tmp-hitch/usr/share/dictd
	$(make_directory)    debian/tmp-hitch/usr/share/doc
	$(make_directory)    debian/tmp-hitch/usr/share/doc/$(pkg-hitch)
	$(install_file)      hitchcock.* debian/tmp-hitch/$(DICTDIR)
	$(install_file)      ChangeLog \
			       debian/tmp-hitch/usr/share/doc/$(pkg-hitch)/changelog
	$(install_file)      debian/changelog \
			       debian/tmp-hitch/usr/share/doc/$(pkg-hitch)/changelog.Debian
	gzip -9frq           debian/tmp-hitch/usr/share/doc/$(pkg-hitch)/
	$(install_program)    debian/postinst.hitch debian/tmp-hitch/DEBIAN/postinst
	$(install_program)    debian/postrm.hitch debian/tmp-hitch/DEBIAN/postrm
# Make sure the copyright file is not compressed
	$(install_file)      debian/copyright-hitch \
	                     debian/tmp-hitch/usr/share/doc/$(pkg-hitch)/copyright
	dpkg-gencontrol      -isp -p$(pkg-hitch) -Pdebian/tmp-hitch
	chown -R root.root debian/tmp-hitch
	dpkg --build         debian/tmp-hitch ..

	touch                stamp-binary-indep


checkroot:
	@test root = "`whoami`" || (echo need root priviledges; exit 1)

define checkdir
	test -f debian/rules -a -f bible_names.txt -a -d easton
endef

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false


.PHONY: binary binary-arch binary-indep clean