| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DH_VERBOSE=1 |
| 4 |
|
| 5 |
pkg := openjade |
| 6 |
pkg-openjade := $(pkg) |
| 7 |
pkg-libostyle := libostyle1c2 |
| 8 |
pkg-libostyle-dev := libostyle-dev |
| 9 |
|
| 10 |
# build tool abstraction |
| 11 |
install_ := install -o root -g root -p |
| 12 |
install_file := install -o root -g root -m 644 -p |
| 13 |
install_script := install -o root -g root -m 755 -p |
| 14 |
install_program := install -o root -g root -m 755 -p |
| 15 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 16 |
install_program += --strip |
| 17 |
endif |
| 18 |
make_directory := install -d -o root -g root -m 755 |
| 19 |
compress := gzip -9f |
| 20 |
|
| 21 |
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) |
| 22 |
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) |
| 23 |
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) |
| 24 |
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) |
| 25 |
export CFLAGS |
| 26 |
export CPPFLAGS |
| 27 |
export CXXFLAGS |
| 28 |
export LDFLAGS |
| 29 |
|
| 30 |
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 31 |
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 32 |
MAKEFLAGS += -j$(NUMJOBS) |
| 33 |
endif |
| 34 |
|
| 35 |
ifneq (,$(findstring hppa,$(DEB_BUILD_ARCH))) |
| 36 |
CFLAGS += -ffunction-sections |
| 37 |
CXXFLAGS += -ffunction-sections |
| 38 |
endif |
| 39 |
CXXFLAGS += -fno-lifetime-dse # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69534 |
| 40 |
|
| 41 |
# flags to get automake to use the above |
| 42 |
inst_flags := INSTALL='$(install_)' |
| 43 |
inst_flags += INSTALL_PROGRAM='$(install_program)' |
| 44 |
inst_flags += INSTALL_SCRIPT='$(install_script)' |
| 45 |
inst_flags += INSTALL_DATA='$(install_file)' |
| 46 |
|
| 47 |
# first version of package providing the right shlibs |
| 48 |
SHLIBS_PKGVER := 1.4devel1-11 |
| 49 |
|
| 50 |
clean: |
| 51 |
dh_testdir |
| 52 |
[ ! -f Makefile ] || $(MAKE) distclean || true |
| 53 |
find . -type l | xargs rm -f |
| 54 |
rm -f Makefile config.log config.status libtool \ |
| 55 |
po/Makefile po/Makefile.in po/POTFILES stamp-h1 \ |
| 56 |
contrib/Makefile contrib/Makefile.in unicode/Makefile unicode/Makefile.in |
| 57 |
# The build process doesn't handle this properly, force a rebuild |
| 58 |
-rm -f style/InterpreterMessages.cxx style/InterpreterMessages.h \ |
| 59 |
style/DssslAppMessages.h jade/JadeMessages.h \ |
| 60 |
jade/RtfMessages.h jade/HtmlMessages.h jade/TeXMessages.h \ |
| 61 |
jade/MifMessages.h |
| 62 |
dh_autoreconf_clean |
| 63 |
dh_clean configure-stamp build-stamp install-stamp debian/copyright |
| 64 |
|
| 65 |
configure: configure-stamp |
| 66 |
configure-stamp: |
| 67 |
dh_autoreconf |
| 68 |
dh_auto_configure -- --enable-http --enable-shared --enable-static |
| 69 |
touch $@ |
| 70 |
|
| 71 |
|
| 72 |
build: build-arch build-indep |
| 73 |
build-arch: build-stamp |
| 74 |
build-indep: build-stamp |
| 75 |
build-stamp: configure-stamp |
| 76 |
dh_testdir jade |
| 77 |
$(MAKE) SUBDIRS="grove spgrove style" |
| 78 |
$(MAKE) |
| 79 |
touch $@ |
| 80 |
|
| 81 |
|
| 82 |
# Upstream copyright notice only appears in README; for Debian, it must be in |
| 83 |
# copyright file. COPYING is the license, which appears to be BSD derived |
| 84 |
# (similar wording, with "Regents" changed to "James Clark"). Create |
| 85 |
# debian/copyright with all the right information. |
| 86 |
debian/copyright: README debian/license.Debian debian/copyright.Debian |
| 87 |
cat $^ > $@ |
| 88 |
|
| 89 |
# Install into DESTDIR, then move everything later. CURDIR is set by make. |
| 90 |
DESTDIR = $(CURDIR)/debian/tmp |
| 91 |
export DESTDIR |
| 92 |
install: build install-stamp |
| 93 |
install-stamp: |
| 94 |
dh_testdir |
| 95 |
dh_testroot |
| 96 |
dh_prep |
| 97 |
$(MAKE) install $(inst_flags) |
| 98 |
touch $@ |
| 99 |
|
| 100 |
clean-install: |
| 101 |
rm -fr debian/tmp |
| 102 |
rm install-stamp |
| 103 |
|
| 104 |
binary-indep: install |
| 105 |
# There are no architecture-independent binary packages generated from this |
| 106 |
# source package. |
| 107 |
|
| 108 |
binary-arch: install debian/copyright debian/README.Debian |
| 109 |
dh_testdir |
| 110 |
dh_testroot |
| 111 |
rm -f debian/*.debhelper |
| 112 |
dh_prep -X tmp |
| 113 |
|
| 114 |
dh_installdirs |
| 115 |
dh_installdocs |
| 116 |
dh_installchangelogs -A ChangeLog |
| 117 |
|
| 118 |
mkdir -p $(DESTDIR)/usr/share/man/man1 && \ |
| 119 |
cp -p debian/openjade.1 \ |
| 120 |
$(DESTDIR)/usr/share/man/man1/openjade-1.4devel.1 |
| 121 |
dh_installman -p openjade |
| 122 |
|
| 123 |
cp -p $(DESTDIR)/usr/bin/openjade $(DESTDIR)/usr/bin/openjade-1.4devel |
| 124 |
dh_install |
| 125 |
|
| 126 |
dh_installcatalogs |
| 127 |
|
| 128 |
dh_strip -a |
| 129 |
dh_compress -a |
| 130 |
dh_fixperms -a |
| 131 |
dh_makeshlibs |
| 132 |
dh_shlibdeps -L $(pkg-libostyle) -l debian/$(pkg-libostyle)/usr/lib |
| 133 |
|
| 134 |
dh_installdeb |
| 135 |
dh_gencontrol |
| 136 |
dh_md5sums |
| 137 |
dh_builddeb |
| 138 |
|
| 139 |
binary: binary-indep binary-arch |
| 140 |
|
| 141 |
.PHONY: clean build install binary-indep binary-arch binary |
| 142 |
|
| 143 |
# vim: set syntax=makefile: |
| 144 |
# Local variables: |
| 145 |
# compile-command: "cd .. && fakeroot dpkg-buildpackage -uc -us" |
| 146 |
# End: |
| 147 |
|