File: rules

package info (click to toggle)
openjade 1.4devel1-22
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 5,336 kB
  • sloc: cpp: 90,092; sh: 7,479; ansic: 1,793; lisp: 894; perl: 604; makefile: 393; sed: 93
file content (181 lines) | stat: -rwxr-xr-x 5,250 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
#!/usr/bin/make -f

export DH_VERBOSE=1

pkg			:= openjade
pkg-openjade		:= $(pkg)
pkg-libostyle		:= libostyle1c2
pkg-libostyle-dev	:= libostyle-dev

# 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

CFLAGS		:= -g --pipe
CXXFLAGS	:= -g --pipe -fpermissive
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O2
  CXXFLAGS += -O2
else
  CFLAGS += -O0
  CXXFLAGS += -O0
endif
ifneq (,$(findstring hppa,$(DEB_BUILD_ARCH)))
  CFLAGS += -ffunction-sections
  CXXFLAGS += -ffunction-sections
endif
CXXFLAGS += -fno-lifetime-dse  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69534
export CFLAGS
export CXXFLAGS

# 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.4devel1-11

# # extra docs we don't want
# DOCS_TOO_MUCH	:= ABOUT-NLS COPYING copying.txt ChangeLog

# 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 snapshot/cvs building
root_cmd		:= sudo
deb_build		:= dpkg-buildpackage -pgpg -r$(root_cmd) -b
cvs_build_dir		:= $(HOME)/debian/$(pkg-openjade)
cvs_ver_build_dir	:= $(cvs_build_dir)/$(pkg-openjade)-$(UPSTREAM_VERSION)
cvs_pure_src_dir	:= ..
cvs_pure_src		:= $(pkg-openjade)

# cvs snapshot building
cvs-build:	clean
	[ -d $(cvs_pure_src_dir)/$(cvs_pure_src)/CVS ] || exit 1
	$(root_cmd) rm -rf $(cvs_ver_build_dir)
#	rm -f $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz
#	 don't do cvs up or make the changelog
	install -d -m 755 $(cvs_ver_build_dir)
#	GZIP=-9 tar czf $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz -C $(cvs_pure_src_dir) --exclude CVS $(cvs_pure_src)
	tar cf - --exclude CVS . | tar xf - -C $(cvs_ver_build_dir)
	[ -f ChangeLog ] || cvs2cl -r -t -b
	cp ChangeLog $(cvs_ver_build_dir)/
	cd $(cvs_ver_build_dir) && $(deb_build)

ChangeLog:
	[ ! -e OpenJade-$(UPSTREAM_VERSION) ]
	[ -f $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz ]
	tar -xzvf $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz OpenJade-1.4devel/ChangeLog
	mv OpenJade-1.4devel/ChangeLog .
	rm -r OpenJade-1.4devel

clean:
	dh_testdir
	rm -f debian/buildinfo
	[ ! -f Makefile ] || $(MAKE) distclean || true
	rm -f po/*.gmo
	find . -type l | xargs rm -f
	dh_clean configure-stamp build-stamp install-stamp debian/copyright
	# The build process doesn't handle this properly, force a rebuild
	-rm -f style/InterpreterMessages.cxx style/InterpreterMessages.h \
	    style/DssslAppMessages.h jade/JadeMessages.h \
	    jade/RtfMessages.h jade/HtmlMessages.h jade/TeXMessages.h \
	    jade/MifMessages.h
	dh_autoreconf_clean
	rm -f debian/*.debhelper.log

configure: configure-stamp
configure-stamp:
	dh_autoreconf
	dh_buildinfo generate cat
	dh_auto_configure -- --enable-http --enable-shared --enable-static
	touch $@


build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir jade
	$(MAKE) SUBDIRS="grove spgrove style"
	$(MAKE)
	touch $@


# Upstream copyright notice only appears in README; for Debian, it must be in
# copyright file.  COPYING is the license, which appears to be BSD derived
# (similar wording, with "Regents" changed to "James Clark"). Create
# debian/copyright with all the right information.
debian/copyright: README debian/license.Debian debian/copyright.Debian
	cat $^ > $@

# Install into DESTDIR, then move everything later. CURDIR is set by make.
DESTDIR = $(CURDIR)/debian/tmp
export DESTDIR
install: build install-stamp
install-stamp:
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) install $(inst_flags)
	touch $@

clean-install:
	rm -fr debian/tmp
	rm install-stamp

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

binary-arch: install debian/copyright debian/README.Debian 
	dh_testdir
	dh_testroot
	rm -f debian/*.debhelper
	dh_prep -X tmp

	dh_installdirs
	dh_installdocs
	dh_installchangelogs -A ChangeLog

	mkdir -p $(DESTDIR)/usr/share/man/man1 && \
	cp -p debian/openjade.1 \
		$(DESTDIR)/usr/share/man/man1/openjade-1.4devel.1
	dh_installman -p openjade

	cp -p $(DESTDIR)/usr/bin/openjade $(DESTDIR)/usr/bin/openjade-1.4devel
	dh_install

	dh_installcatalogs

	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs
	dh_shlibdeps -L $(pkg-libostyle) -l debian/$(pkg-libostyle)/usr/lib

	dh_buildinfo install

	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

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

# vim: set syntax=makefile:
# Local variables:
# compile-command: "cd .. && gbp buildpackage"
# End: