File: rules

package info (click to toggle)
opensp 1.5.2-13
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 8,932 kB
  • ctags: 10,036
  • sloc: cpp: 65,784; ansic: 17,124; sh: 11,503; xml: 2,704; makefile: 926; perl: 561; yacc: 288; sed: 16
file content (232 lines) | stat: -rwxr-xr-x 7,232 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
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
#!/usr/bin/make -f

#export DH_VERBOSE=1

pkg		:= opensp
pkg-osp		:= $(pkg)
libosp-maj-ver	:= $(shell egrep 'SP_LIBOSP_CUR=[0-9]+' configure.in|cut -d= -f2)
ifeq (,$(libosp-maj-ver))
$(error "Could not get value of SP_LIBOSP_CUR")
endif
pkg-libosp	:= libosp$(libosp-maj-ver)
pkg-libosp-dev	:= libosp-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

# build tool abstraction
install_	:= install -o root -g root -p
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
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  install_program += --strip
endif
make_directory	:= install -d -o root -g root -m 755
compress	:= gzip -9f

DEB_BUILD_ARCH  := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifeq (somearch,$(DEB_BUILD_ARCH))
  CC	:= gcc-fubar
  CXX	:= g++-fubar
else
  CC	:= gcc
  CXX	:= g++
endif

CFLAGS		:= $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS	:= $(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS	:= $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS		:= $(shell dpkg-buildflags --get LDFLAGS)
export CFLAGS
export CPPFLAGS
export CXXFLAGS
export LDFLAGS

ifeq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
enable_doc_build := --enable-full-doc-build
else
enable_doc_build := --disable-doc-build
endif

# flags to get automake to use the above
inst_flags	:= INSTALL='$(install_)'
inst_flags	+= INSTALL_PROGRAM='$(install_program)'
inst_flags	+= INSTALL_SCRIPT='$(install_script)'
inst_flags	+= INSTALL_DATA='$(install_file)'

# first version of package providing the right shlibs
SHLIBS_PKGVER	:= 1.5.2-1

# determine our version numbers
SRC_VERSION	:= $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
UPSTREAM_VERSION:= $(shell echo $(SRC_VERSION) | sed -e 's/^\(.*\)-[^-]*$$/\1/')
# stuff for cvs retrieval
cvs_src		:= $(pkg)-$(UPSTREAM_VERSION)
orig_name	:= $(pkg)_$(UPSTREAM_VERSION).orig.tar.gz
cvs_base_dir	:= ../cvs
cvs_src_dir	:= $(cvs_base_dir)/$(cvs_src)
cvs_module	:= sp
cvs_tag		:= opensp_1_5_branch
cvs_root	:= :pserver:anonymous@cvs.openjade.sourceforge.net:/cvsroot/openjade

sources-update:
	rm -fr $(cvs_base_dir)
	mkdir $(cvs_base_dir)
	cd $(cvs_base_dir) && CVSROOT=$(cvs_root) \
		cvs checkout -d $(cvs_src) -r $(cvs_tag) $(cvs_module)
	# Upstream has an ancient debian subdirectory, but we do not use it.
	rm -fr $(cvs_src_dir)/debian
	find $(cvs_src_dir) -name .cvsignore -print | xargs rm -f
	find $(cvs_src_dir) -type d -name CVS -print | xargs rm -fr
	cd $(cvs_base_dir) && tar -zcf $(orig_name) $(cvs_src)

# Maintainer target; set AM_MAINTAINER_MODE in configure.in, so this needs to
# be run when autotools input files change.
autoinit:
	./autoinit.sh

clean-stamp:
	rm -f config-stamp build-stamp install-stamp

clean:
	dh_testdir
	rm -f debian/buildinfo
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_autoreconf_clean
	dh_clean config-stamp build-stamp install-stamp debian/copyright \
	    debian/$(pkg-libosp).shlibs debian/$(pkg-libosp-dev).substvars \
	    debian/README.Debian debian/$(pkg-libosp).README.Debian
	# See /usr/share/doc/autotools-dev/README.Debian.gz
	-test -r /usr/share/misc/config.sub && \
		cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
		cp -f /usr/share/misc/config.guess config.guess

config-stamp:
	dh_buildinfo generate cat
	dh_autoreconf
	CC=$(CC) CXX=$(CXX) ./configure --prefix=/usr \
	   --enable-http --enable-shared --enable-static \
	   --enable-default-catalog=$(default-catalogs) \
	   --enable-default-search-path=$(default-sgml-path) \
	   --disable-dtddecl $(enable_doc_build)
	touch $@

configure: config-stamp

build-stamp: configure
	dh_testdir
	$(MAKE) SUBDIRS=lib CXXFLAGS="$(CXXFLAGS) -D_REENTRANT"
	$(MAKE)
	touch $@

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

debian/copyright:	COPYING debian/copyright.Debian
#	 to ensure we have a verbatim copy of the upstream copyright, 
#	 cat the Debian-specific stuff to the end of the upstream file
	cat $^ > $@

debian/$(pkg-libosp-dev).substvars:
#	 indicate our providing version of shlibs; this must be
#	 sync'd with debian/control
	: > $@
	echo "opensp:Version=$(pkg-osp) (= $(SRC_VERSION))"            >> $@
	echo "libosp:Version=$(pkg-libosp) (= $(SRC_VERSION))"         >> $@
	echo "libosp:ShlibVersion=$(pkg-libosp) (>= $(SHLIBS_PKGVER))" >> $@

debian/$(pkg-libosp).shlibs:
#	 std shlibs file, with the first version that supplied the version
#	 that applications should build with
	echo "libosp      $(libosp-maj-ver) $(pkg-libosp) (>= $(SHLIBS_PKGVER))" > $@

debian/README.Debian:	debian/README.Debian.in
#	 substitute the catalog paths
	sed -e 's|%{default-catalogs}|$(default-catalogs)|' \
	-e 's|%{default-sgml-path}|$(default-sgml-path)|' $^ > $@

debian/$(pkg-libosp).README.Debian:	debian/$(pkg-libosp).README.Debian.in
#	 substitute the catalog paths
	sed -e 's|%{default-catalogs}|$(default-catalogs)|' \
	-e 's|%{default-sgml-path}|$(default-sgml-path)|' $^ > $@

install-common := debian/copyright debian/$(pkg-libosp-dev).substvars \
		  debian/$(pkg-libosp).shlibs \
		  debian/README.Debian debian/$(pkg-libosp).README.Debian

# Install into DESTDIR, then move everything later. CURDIR is set by make.
DESTDIR = $(CURDIR)/debian/tmp
export DESTDIR
install-stamp:
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) install $(inst_flags)
	cd $(DESTDIR)/usr/share/OpenSP && \
	( [ -f unicode.decl ] || mv unicode.sd unicode.decl ) && \
	( sed -e 's/unicode.sd/unicode.decl/' catalog > catalog.tmp && \
	mv -f catalog.tmp catalog ) && \
	chmod +x gensyntax.pl
ifeq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
	# Ugly fix for man page generation error
	sed 's~\.HP.*\[\\fIsysid\\fR\.\.\.\]~[\\fIsysid\\fR...]~' $(DESTDIR)/usr/share/man/man1/onsgmls.1 > $(DESTDIR)/usr/share/man/man1/onsgmls.1.tmp && mv $(DESTDIR)/usr/share/man/man1/onsgmls.1.tmp $(DESTDIR)/usr/share/man/man1/onsgmls.1
else
	mkdir -p $(DESTDIR)/usr/share/man/man1 $(DESTDIR)/usr/share/doc/OpenSP
	for f in onsgmls.1 osgmlnorm.1 ospam.1 ospcat.1 ospent.1 osx.1; do \
		touch $(DESTDIR)/usr/share/man/man1/$$f; \
	done
	for ext in html pdf ps; do \
		touch $(DESTDIR)/usr/share/doc/OpenSP/releasenotes.$$ext; \
	done
endif
	touch $@

install: build install-stamp $(install-common)

binary-indep: install
# There are no architecture-independent binary packages generated from this
# source package.

binary-arch: install
	dh_testdir
	dh_testroot

	dh_installdirs
	dh_installdocs
	dh_installchangelogs -A ChangeLog
	dh_installman -p opensp
	dh_install

	dh_strip -a
	dh_compress -a
	dh_fixperms -a

	dh_buildinfo install

	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps

	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

TAGS:
	etags $$(find . -path ./debian -prune -o -regex '.*\.\(cxx\|c\|h\)' -print|sed -e 's/^.\///')

.PHONY: clean build install binary-indep binary-arch binary

# vim: set syntax=makefile:
# Local variables:
# compile-command: "cd .. && fakeroot dpkg-buildpackage -uc -us"
# End: