File: rules

package info (click to toggle)
dictd 1.4.8-8
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,492 kB
  • ctags: 2,540
  • sloc: ansic: 20,420; sh: 1,721; makefile: 745; perl: 235; yacc: 189; lex: 117
file content (191 lines) | stat: -rwxr-xr-x 7,274 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
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
182
183
184
185
186
187
188
189
190
191
#! /usr/bin/make -f

############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author           : Robert D. Hilliard <hilliard@debian.org>
## Created On       : Tue,  7 Apr 1998 20:30:10 -0400 
## Last Modified By : Robert D. Hilliard <hilliard@debian.org>
## Last Modified On : Tue,  1 Dec 1998 21:35:08 -0500

## Update Count     : 
## Status           : $Id: rules,v 1.2 1998/12/02 02:35:57 bob Exp bob $
## HISTORY          :
## Description      : debian/rules for dictd
## Acknowledgment   : This debian/rules file is based on Manoj Srivasta's 
##                  : <srivasta@debian.org> sample debian/rules files.
##                  : Any errors belong to me alone.
###############################################################################

# The name of the package (for example, `emacs').
pkg   := dictd
pkg_2 	:= dict

# 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)/doc/$(pkg)

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

FILES_TO_CLEAN  = debian/files 
DIRS_TO_CLEAN   = debian/tmp debian/tmp_2 
STAMPS_TO_CLEAN = stamp-configure stamp-build stamp-binary stamp-dict


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.

configure: stamp-configure

stamp-configure:
	./configure --verbose --prefix=$(PREFIX) && touch stamp-configure


stamp-build:
# Builds the binary package.
	$(checkdir)
	-test -f stamp-configure || $(MAKE) -f debian/rules configure
	$(MAKE) CC="$(CC)" LDFLAGS="$(LDFLAGS)"

## Upstream Makefile has very long definition for CFLAGS that sets
## certain variables, but isn't used for every compile statement.  It
## seems best to leave CFLAGS up to the upstream Makefile.

	touch stamp-build

clean:
# Undoes the effect of `$(MAKE) -f debian/rules build'.
	$(checkdir)
	-test -f Makefile && $(MAKE) recursive-clean 
	-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 stamp-binary-dict


binary-arch: build stamp-binary stamp-binary-dict

stamp-binary:
# Makes a binary package.
	@test root = "`whoami`" || (echo need root priviledges; exit 1)
	$(checkdir)
	test -f stamp-build  || $(MAKE) -f debian/rules build
	rm -rf               debian/tmp debian/tmp_2 debian/tmp.deb
	$(make_directory)    debian/tmp
	$(make_directory)    debian/tmp/DEBIAN
	$(make_directory)    debian/tmp/usr
	$(make_directory)    debian/tmp/usr/bin
	$(make_directory)    debian/tmp/usr/sbin
	$(make_directory)    debian/tmp/etc
	$(make_directory)    debian/tmp/etc/init.d
	$(make_directory)    debian/tmp/usr/man/man1
	$(make_directory)    debian/tmp/usr/man/man8
	$(make_directory)    debian/tmp/usr/doc
	$(make_directory)    debian/tmp/usr/doc/$(pkg)
	$(make_directory)    debian/tmp/usr/doc/$(pkg)/examples
## It is necessary to create the debian/tmp_2 tree under this
## target since the Makefile install target will put several files in
## the debian/tmp tree that must be moved to debian/tmp_2 before
## dpkg-gencongtrol calculaates the size of the installed package.
	$(make_directory)    debian/tmp_2
	$(make_directory)    debian/tmp_2/DEBIAN
	$(make_directory)    debian/tmp_2/usr
	$(make_directory)    debian/tmp_2/usr/bin
	$(make_directory)    debian/tmp_2/etc
	$(make_directory)    debian/tmp_2/usr/man/man1
	$(make_directory)    debian/tmp_2/usr/doc
	$(make_directory)    debian/tmp_2/usr/doc/$(pkg_2)
	$(make_directory)    debian/tmp_2/usr/doc/$(pkg_2)/examples
	$(MAKE)              install prefix=debian/tmp/usr
	mv -f  debian/tmp/usr/bin/dict debian/tmp_2/usr/bin/dict
	$(install_file)      ChangeLog \
			       debian/tmp/usr/doc/$(pkg)/changelog
	$(install_file)      debian/changelog \
			       debian/tmp/usr/doc/$(pkg)/changelog.Debian
	$(install_file)      debian/readme-dictd \
			       debian/tmp/usr/doc/$(pkg)/README.Debian
	gzip -9frq           debian/tmp/usr/doc/$(pkg)/
	$(install_program)   debian/dictd debian/tmp/etc/init.d/dictd
	$(install_file)      debian/dictd.conf debian/tmp/etc/dictd.conf 
	touch 		     debian/tmp/etc/dictd_dummy 
	touch 		     debian/tmp/etc/dictd_dummy.index
# Make sure the copyright file is not compressed
	$(install_file)      debian/copyright \
	                     debian/tmp/usr/doc/$(pkg)/copyright
	test -f              debian/tmp/usr/man/man1/dictzip.1 || \
	    $(install_file)      dictzip.1 debian/tmp/usr/man/man1/dictzip.1
	gzip -9fq            debian/tmp/usr/man/man1/dictzip.1
	test -f              debian/tmp/usr/man/man8/dictd.8 || \
	     $(install_file)      dictd.8 debian/tmp/usr/man/man8/dictd.8
	gzip -9fq            debian/tmp/usr/man/man8/dictd.8
	mv -f debian/tmp/usr/man/man1/dict.1 \
			debian/tmp_2/usr/man/man1/dict.1 
	test -f              debian/tmp_2/usr/man/man1/dict.1 || \
	     $(install_file)      dict.1 debian/tmp/usr/man/man1/dict.1
	$(install_file)      example* debian/tmp/usr/doc/$(pkg)/examples/
	mv -f  debian/tmp/usr/doc/$(pkg)/examples/example.dictrc \
	 debian/tmp_2/usr/doc/$(pkg_2)/examples/example.dictrc
	$(install_program)   debian/postinst  debian/tmp/DEBIAN/postinst
	$(install_program)   debian/postrm debian/tmp/DEBIAN/postrm
	$(install_file)      debian/conffiles-dictd debian/tmp/DEBIAN/conffiles
	dpkg-shlibdeps       debian/tmp/usr/sbin/dictd \
				debian/tmp/usr/bin/dictzip
	dpkg-gencontrol      -pdictd -Pdebian/tmp
	chown -R root.root   debian/tmp
	dpkg --build         debian/tmp ..

stamp-binary-dict:
# Makes a binary package.
	$(install_file)      ChangeLog \
		       debian/tmp_2/usr/doc/$(pkg_2)/changelog
	$(install_file)      debian/changelog \
	            debian/tmp_2/usr/doc/$(pkg_2)/changelog.Debian
	$(install_file)      debian/readme-dict \
			       debian/tmp_2/usr/doc/$(pkg_2)/README.Debian
	gzip -9frq           debian/tmp_2/usr/doc/$(pkg_2)/
	$(install_file)      debian/dict.conf debian/tmp_2/etc/dict.conf 
# Make sure the copyright file is not compressed
	$(install_file)      debian/copyright \
	                     debian/tmp_2/usr/doc/$(pkg_2)/copyright
	$(install_file)      dict.1 debian/tmp_2/usr/man/man1/dict.1
	gzip -9fq            debian/tmp_2/usr/man/man1/dict.1
	$(install_file)      debian/conffiles-dict \
				debian/tmp_2/DEBIAN/conffiles
	dpkg-shlibdeps       debian/tmp_2/usr/bin/dict
	dpkg-gencontrol      -pdict -Pdebian/tmp_2
	chown -R root.root   debian/tmp_2
	dpkg --build         debian/tmp_2 ..
	touch                stamp-binary
	touch                stamp-binary-dict


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

define checkdir
	test -f  dictd.h -a -f debian/rules
endef

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


.PHONY: binary binary-arch binary-indep clean