File: rules

package info (click to toggle)
gmp1 1.3.2-8
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 876 kB
  • ctags: 483
  • sloc: ansic: 8,098; makefile: 358; sh: 4
file content (197 lines) | stat: -rwxr-xr-x 4,926 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
192
193
194
195
196
197
#!/usr/bin/make -f
#
# This is a debian/rules make file. It supports the targets:
# build, clean, binary-indep, binary-arch, and binary
#
# This file was created by Dale Scheetz <dwarf@polaris.net> and modified
# to create "versioned" package names in late November of 1997.
# This file is copyright 1997 by Software in the Public Interest and 
# is thereby licensed under the GPL.

# Package and Library names
#
P=gmp1
P2=gmp1-dev

I=mp

# Create the two so version strings for the symbolic link names
#
command=/usr/lib/dpkg/parsechangelog/debian <debian/changelog
v1 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/\..\+//')
v2 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/-.\+//')

# Construct the library dependency entrie for shlibs
#
shl1=lib$(P)	$(v1)	$(P) (>= $(v2))
shl2=lib$(I)	$(v1)	$(P) (>= $(v2))

# Build the binary components and assemble the libraries
# =====================================================================
build:
	$(checkdir)
	$(MAKE) CFLAGS=-O3 MA_N=$(v1) MI_N=$(v2)
	$(MAKE) check gmp1.info
	touch build

# Clean up after a build and before building a source package
#======================================================================
clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) -i clean
	-rm -rf debian/tmp debian/*~ *~ *.orig ./#*# *.log

# No binary independent components to this package
#======================================================================
binary-indep:
#None:
	@echo >&2 'No independent packages'

# Install package components into debian/tmp to be built into packages
#======================================================================
binary binary-arch:		checkroot build

# First round...package gmp1...........................................
#
# Clean out old tmp directory
#
	-rm -rf debian/tmp

# Create new directories in debian/tmp
#
	mkdir debian/tmp debian/tmp/DEBIAN

# Insert appropriate lines into shlibs file
#
	echo -e '$(shl1)\n$(shl2)\n' >debian/tmp/DEBIAN/shlibs

# Create additional installation directories
#
	install -d debian/tmp/usr/doc/$(P)
	install -d debian/tmp/usr/{info,lib}

# Install installation scripts
#
	cp debian/{postinst,prerm} debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/{postinst,prerm}

# Install docs in proper directory and gzip them
#
	cp debian/changelog debian/tmp/usr/doc/$(P)/changelog.Debian
	cp ChangeLog debian/tmp/usr/doc/$(P)/changelog
	gzip -9v debian/tmp/usr/doc/$(P)/change*

# but don't gzip the copyright statement
#
	cp debian/copyright debian/tmp/usr/doc/$(P)/copyright

# Install and gzip the info pages
#
	install -m 644 gmp1.info* debian/tmp/usr/info/.
	gzip -9v debian/tmp/usr/info/*

# Install shared library
#
	strip --strip-unneeded lib$(P).so.$(v2)
	strip --strip-unneeded lib$(I).so.$(v2)
	install -m 644 lib$(P).so.$(v2) debian/tmp/usr/lib/.
	install -m 644 lib$(I).so.$(v2) debian/tmp/usr/lib/.

# Create .so link
#
	ln -s lib$(P).so.$(v2) debian/tmp/usr/lib/lib$(P).so.$(v1)
	ln -s lib$(I).so.$(v2) debian/tmp/usr/lib/lib$(I).so.$(v1)

# Create dependency information
#
	dpkg-shlibdeps lib$(P).so.$(v2)

# Generate control file for gmp1
#
	dpkg-gencontrol -p$(P) -isp

# Clean up file ownership
#
	chown -R root.root debian/tmp

# and permissions
#
	chmod -R g-ws debian/tmp

# and build the package
#
	dpkg --build debian/tmp ..	

# Second round...package gmp1-dev......................................
#
# Clean out old tmp directory
#
	-rm -rf debian/tmp

# Create new directories in debian/tmp
#
	mkdir debian/tmp debian/tmp/DEBIAN

# Create additional installation directories
#
	install -d debian/tmp/usr/doc/$(P2)
	install -d debian/tmp/usr/{include,lib}
	install -d debian/tmp/usr/include/$(P)

# Install docs in proper directory and gzip them
#
	install -m 644 README debian/tmp/usr/doc/$(P2)/.
	cp debian/changelog debian/tmp/usr/doc/$(P2)/changelog.Debian
	cp ChangeLog debian/tmp/usr/doc/$(P2)/changelog
	gzip -9v debian/tmp/usr/doc/$(P2)/change*

# but don't gzip the copyright statement
#
	cp debian/copyright debian/tmp/usr/doc/$(P2)/copyright

# Install header files
#
	install -m 644 gmp.h mp.h longlong.h debian/tmp/usr/include/$(P)/.
	install -m 644 gmp-mparam.h gmp-impl.h debian/tmp/usr/include/$(P)/.

# Install static library
#
	strip --strip-debug lib$(P).a
	strip --strip-debug lib$(I).a
	install -m 644 lib$(P).a debian/tmp/usr/lib/.
	install -m 644 lib$(I).a debian/tmp/usr/lib/.

# Create .so links
#
	ln -s lib$(P).so.$(v2) debian/tmp/usr/lib/lib$(P).so
	ln -s lib$(I).so.$(v2) debian/tmp/usr/lib/lib$(I).so

# Generate control file for gmp1-dev
#
	dpkg-gencontrol -p$(P2) -isp

# Clean up file ownership
#
	chown -R root.root debian/tmp

# and permissions
#
	chmod -R g-ws debian/tmp

# and build the package
#
	dpkg --build debian/tmp ..	



define checkdir
	test -f gmp.h
endef

# Below here is fairly generic really
checkroot:
	$(checkdir)
	test root = "`whoami`"

PHONY: binary binary-arch binary-indep clean checkroot