File: rules

package info (click to toggle)
jade 1.2.1-43
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,808 kB
  • ctags: 16,989
  • sloc: cpp: 120,657; sh: 10,452; ansic: 8,228; perl: 378; makefile: 296; sed: 5
file content (332 lines) | stat: -rwxr-xr-x 10,812 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#!/usr/bin/make -f
# rules file for jade
#
# The principle of these rules files are simplicity, robustness,
# ease of maintenance, and readability through abstraction
#
# Some bytes in this file may have been touched by Ian Jackson,
# so I can never remove his name from this file.  Oh boy.

pkg-sp		:= sp
pkg-jade	:= jade
pkg-libsp1	:= libsp1
pkg-libsp1-dev	:= libsp1-dev

# default SGML dir
sgmldir			:= /usr/share/sgml
local-sgmldir		:= /usr/local/share/sgml

# default SGML pathing - see /usr/share/doc/opensp/sysid.htm
default-sgml-path	:= $(local-sgmldir):$(sgmldir)
default-catalogs	:= /etc/sgml/catalog

# directory abstraction
prefix-jade	:= debian/$(pkg-jade)
bindir-jade	:= $(prefix-jade)/usr/bin
sgmldir-jade	:= $(prefix-jade)$(sgmldir)/jade
docdir-jade	:= $(prefix-jade)/usr/share/doc/$(pkg-jade)
infodir-jade	:= $(prefix-jade)/usr/share/info
sharedir-jade	:= $(prefix-jade)/usr/share

prefix-sp	:= debian/$(pkg-sp)
bindir-sp	:= $(prefix-sp)/usr/bin
confdir-sp	:= $(prefix-sp)/etc
sgmldir-sp	:= $(prefix-sp)$(sgmldir)/sp
docdir-sp	:= $(prefix-sp)/usr/share/doc/$(pkg-sp)
infodir-sp	:= $(prefix-sp)/usr/share/info
sharedir-sp	:= $(prefix-sp)/usr/share

prefix-libsp1	:= debian/$(pkg-libsp1)
docdir-libsp1	:= $(prefix-libsp1)/usr/share/doc/$(pkg-libsp1)
libdir-libsp1	:= $(prefix-libsp1)/usr/lib

prefix-libsp1-dev	:= debian/$(pkg-libsp1-dev)
incdir-libsp1-dev	:= $(prefix-libsp1-dev)/usr/include/$(pkg-sp)
docdir-libsp1-dev	:= $(prefix-libsp1-dev)/usr/share/doc/$(pkg-libsp1-dev)
libdir-libsp1-dev	:= $(prefix-libsp1-dev)/usr/lib

# build tool abstraction
install_file	:= install -o root -g root -m 644 -p
install_script	:= install -o root -g root -m 755 -p
install_program	:= install -o root -g root -m 755 -p
make_directory	:= install -d -o root -g root -m 755
compress	:= gzip -9f

# debhelper verbose
#export DH_VERBOSE=1

# first version of package providing the right shlibs
SHLIBS_PKGVER	:= 1.3.4-1.2.1-30

# determine our version numbers
SRC_VERSION	:= $(shell LC_ALL=C dpkg-parsechangelog | sed -n 's/^Version: *//p')
SP_VERSION	:= $(shell cat VERSION)

# determine our top level
SRCDIR		:= $(shell pwd)

CFLAGS		:= -g -pipe
CXXFLAGS	:= -g -pipe -D_REENTRANT
CC		:= gcc
CXX		:= g++


# # work around broken C++ compiler on alpha, s390 and m68k
# DEB_BUILD_ARCH  := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
# ifeq ($(DEB_BUILD_ARCH),s390)
#   CC		:= gcc-3.2
#   CXX		:= g++-3.2
# endif
# ifeq ($(DEB_BUILD_ARCH),m68k)
#   CC		:= gcc-3.3
#   CXX		:= g++-3.3
# endif

# policy recommendations
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O0
  CXXFLAGS += -O0
else
ifeq ($(DEB_BUILD_ARCH),hppa)
  CFLAGS += -O0
  CXXFLAGS += -O0
else
  CFLAGS += -O2
  CXXFLAGS += -O2
endif
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  INSTALL_PROGRAM += -s
endif


version-test:
	@echo Debian version is $(SRC_VERSION)
	@echo upstream version is $(UPSTREAM_VERSION)

config.status:
	dh_buildinfo generate cat
	CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CC="$(CXX)" CXX="$(CXX)" \
	   ./configure --prefix=/usr --enable-html			\
	   --enable-http --enable-static --enable-shared --enable-mif	\
	   --enable-default-catalog=$(default-catalogs)			\
	   --enable-default-search-path=$(default-sgml-path)

build:	config.status
	dh_testdir
	$(MAKE)
	touch build

clean:
	dh_testdir
	rm -f debian/buildinfo
#	 update config.sub and config.guess, from autotools-dev
	test -r /usr/share/misc/config.sub && \
	  cp -f /usr/share/misc/config.sub config/
	test -r /usr/share/misc/config.guess && \
	  cp -f /usr/share/misc/config.guess config/
	rm -f build binary-arch
	$(MAKE) clean
	test ! -f Makefile.dist || $(MAKE) mrproper
	rm -f `find . -name "*~"`
	rm -rf $(prefix-sp) $(prefix-libsp1) $(prefix-libsp1-dev)
	rm -rf $(prefix-jade)
	rm -f debian/copyright debian/files* core
#        remove some autoconf spam
	rm -f conftest*
#	 force the M4 files to rebuild, timestamps can't be trusted
	find . -name '*.m4' | xargs chmod +w
	find . -name '*.m4' | xargs touch
#	 these are created in the binary-arch rule
	rm -f debian/README.Debian debian/substvars debian/shlibs* \
	      debian/sp.conffiles debian/*.substvars
# 	 some stuff that should be cleaned in upstream Makefile
	find . -name 'Makefile.dep' | xargs rm -f
	rm -f libtool
	dh_clean

binary-indep:	build
# There are no architecture-independent files to be uploaded
# generated by this package.

binary-arch:	build
	dh_testdir
	dh_testroot
	dh_clean -k

#	 lets create our debian-std copyright file; I like to ensure
#	 I have a verbatim copy of the upstream copyright by cat'ing
#	 the Debian-specific stuff to the end
	cat COPYING debian/copyright.Debian > debian/copyright

#	 substvar used to indicated our version of sp and libsp1
	: > debian/substvars
	echo "$(pkg-sp):Version=$(pkg-sp) (= $(SP_VERSION)-$(SRC_VERSION))" \
	    >> debian/substvars
	echo "$(pkg-libsp1):Version=$(pkg-libsp1) (= $(SP_VERSION)-$(SRC_VERSION))" \
	    >> debian/substvars
	echo "$(pkg-libsp1):ShlibVersion=$(pkg-libsp1) (>= $(SHLIBS_PKGVER))" \
	    >> debian/substvars
	: > debian/${pkg-libsp1-dev}.substvars
	echo "$(pkg-libsp1):Version=$(pkg-libsp1) (= $(SP_VERSION)-$(SRC_VERSION))" \
	    >> debian/${pkg-libsp1-dev}.substvars

#	 substitution in README.Debian
	sed -e 's|%{default-catalogs}|$(default-catalogs)|;		\
		s|%{default-sgml-path}|$(default-sgml-path)|;		\
		s|%{sgmldir}|$(sgmldir)|;'				\
		debian/README.Debian.in > debian/README.Debian

##
##	 install sp suite
	$(make_directory) $(bindir-sp) $(sgmldir-sp) $(docdir-sp) $(confdir-sp)
	$(MAKE) install PROGDIRS="nsgmls spam sgmlnorm spent sx" LIBDIRS="" \
	    prefix=$(SRCDIR)/$(prefix-sp)/usr INSTALL="$(install_script)"
	mv $(bindir-sp)/sx $(bindir-sp)/sgml2xml

# The place for sp pubtext, clearly indicated in the LSB (stripped of
# package versioning), is /usr/share/sgml/sp/

#	 install declarations
	$(make_directory) $(sgmldir-sp)
	$(install_file) japan.sgmldecl $(sgmldir-sp)/japan.decl
	$(install_file) debian/sp_implied.decl $(sgmldir-sp)
#	 install xml.soc, this is the expected location
	$(make_directory) $(prefix-sp)$(sgmldir)/declaration
	$(install_file) pubtext/xml.soc $(prefix-sp)$(sgmldir)/declaration
#	install unicode stuff
	$(make_directory) $(sgmldir-sp)/unicode
	$(install_file) unicode/catalog unicode/demo.sgm unicode/unicode.syn \
	    $(sgmldir-sp)/unicode/
	$(install_file) unicode/unicode.sd $(sgmldir-sp)/unicode/unicode.decl
#	 putting this script here is a little perverse
	$(install_script) unicode/gensyntax.pl $(sgmldir-sp)/unicode/

#	 install HTML documentation
	dh_installdocs -p$(pkg-sp) README doc/*.htm
#	 now sx is named sgml2xml, change it in the doco
	perl -pi -e 's/sx/sgml2xml/g; s/SX/SGML2XML/g;'			\
	    $(docdir-sp)/sx.htm
	perl -pi -e 's/>sx/>sgml2xml/g; s/>SX/>SGML2XML/g;'		\
	    $(docdir-sp)/index.htm $(docdir-sp)/new.htm
	dh_installchangelogs -p$(pkg-sp)
	dh_installexamples -p$(pkg-sp) dsssl/FOT.tex dsssl/demo*

#	 install man pages
	dh_installman -p$(pkg-sp) debian/nsgmls.1 debian/spam.1 debian/spent.1 \
	    debian/sgml2xml.1 debian/sgmlnorm.1

##
##	 install libsp1
	$(make_directory) $(prefix-libsp1)/usr/lib $(prefix-libsp1)/DEBIAN

#	 std shlibs file, with the first version that supplied the version
#	  that applications should build with
# should work but doesn't
#	dh_makeshlibs -p$(pkg-libsp1) -V'$(pkg-libsp1) (>=$(SHLIBS_PKGVER))'
# do it by hand
	: > $(prefix-libsp1)/DEBIAN/shlibs
	echo "libsp      1 $(pkg-libsp1) (>= $(SHLIBS_PKGVER))" >> $(prefix-libsp1)/DEBIAN/shlibs
	echo "libgrove   1 $(pkg-libsp1) (>= $(SHLIBS_PKGVER))" >> $(prefix-libsp1)/DEBIAN/shlibs
	echo "libspgrove 1 $(pkg-libsp1) (>= $(SHLIBS_PKGVER))" >> $(prefix-libsp1)/DEBIAN/shlibs
	echo "libstyle   1 $(pkg-libsp1) (>= $(SHLIBS_PKGVER))" >> $(prefix-libsp1)/DEBIAN/shlibs
	chmod 0644 $(prefix-libsp1)/DEBIAN/shlibs
	chown 0.0 $(prefix-libsp1)/DEBIAN/shlibs

	$(MAKE) install PROGDIRS="" LIBDIRS="lib grove spgrove style"	\
	    prefix=$(SRCDIR)/$(prefix-libsp1)/usr INSTALL="$(install_file)"

	rm -f $(libdir-libsp1)/*.so $(libdir-libsp1)/*.a $(libdir-libsp1)/*.la

#	 install Debian-std docs
	dh_installdocs -p$(pkg-libsp1) README
	dh_installchangelogs -p$(pkg-libsp1)
	$(install_file) debian/README.sp-dev $(docdir-libsp1)/README.Debian


##
##	 install libsp1-dev
	$(make_directory) $(incdir-libsp1-dev)
	$(make_directory) $(prefix-libsp1-dev)/DEBIAN			\
	    $(prefix-libsp1-dev)/usr/lib

	$(MAKE) install PROGDIRS="" LIBDIRS="lib grove spgrove style"	\
	    prefix=$(SRCDIR)/$(prefix-libsp1-dev)/usr INSTALL="$(install_script)"

	rm -f $(libdir-libsp1-dev)/*.so.* $(libdir-libsp1-dev)/*.la

#	 includes
	$(install_file) include/*.*            $(incdir-libsp1-dev)
	$(install_file) generic/*.h            $(incdir-libsp1-dev)
	$(install_file) grove/Node.h           $(incdir-libsp1-dev)
	$(install_file) spgrove/GroveApp.h     $(incdir-libsp1-dev)
	$(install_file) spgrove/GroveBuilder.h $(incdir-libsp1-dev)
	$(install_file) style/FOTBuilder.h style/GroveManager.h		\
	  style/DssslApp.h style/dsssl_ns.h    $(incdir-libsp1-dev)

#	 install Debian-std docs
	dh_installdocs -p$(pkg-libsp1-dev) README
	dh_installchangelogs -p$(pkg-libsp1-dev)
	$(install_file) debian/README.sp-dev $(docdir-libsp1-dev)/README.Debian


##
##	 install jade
	$(make_directory) $(bindir-jade) $(sgmldir-jade) $(docdir-jade)

	$(MAKE) install PROGDIRS="jade" LIBDIRS=""			\
	    prefix=$(SRCDIR)/$(prefix-jade)/usr INSTALL="$(install_script)"

#	 check these in dsssl/catalog
	$(make_directory) $(sgmldir-jade)
	$(install_file) dsssl/*.dtd dsssl/catalog $(sgmldir-jade)
	dh_installcatalogs -p jade

#	 make the links
	/usr/share/sgml-data/sgml-catalog-check.pl -l -v 0 -d		\
		$(prefix-jade)/usr/share/sgml $(sgmldir-jade)/catalog

#	 install HTML documentation
	dh_installdocs -p$(pkg-jade) jadedoc/*.htm
	cd $(docdir-jade) && \
	sed -e 's/copying\.txt/copyright/' jade.htm > jade.htm.new && \
	mv jade.htm.new jade.htm && ln -s jade.htm index.html
	dh_installchangelogs -p$(pkg-jade)

#	 install man pages
	dh_installman -p$(pkg-jade) debian/jade.1

#	 install examples
	dh_installexamples -p$(pkg-jade) dsssl/demo.* dsssl/FOT.tex

	dh_strip -a
	dh_compress -a
	dh_fixperms -a

	dh_buildinfo install

	dh_installdeb -a

#	 put it all together
	dh_shlibdeps -l $(libdir-libsp1) -a

#	 control files for sp, libsp1, and libsp1-dev have a different
#	 version
	dh_gencontrol -p$(pkg-sp) -- -v$(SP_VERSION)-$(SRC_VERSION)
	dh_gencontrol -p$(pkg-libsp1) -- -v$(SP_VERSION)-$(SRC_VERSION)
	dh_gencontrol -p$(pkg-libsp1-dev) -- -v$(SP_VERSION)-$(SRC_VERSION)
#	 jade is more normal
	dh_gencontrol -p$(pkg-jade)

	dh_md5sums -a
	dh_builddeb -a
	touch binary-arch

binary:		binary-indep binary-arch

.PHONY: binary binary-indep clean

# Local variables:
# mode: makefile
# compile-command: "cd .. && fakeroot dpkg-buildpackage -uc -us"
# End: