| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
ifeq (,$(findstring terse,${DEB_BUILD_OPTIONS})) |
| 4 |
export DH_VERBOSE=1 |
| 5 |
export V=1 |
| 6 |
export VERBOSE=1 |
| 7 |
endif |
| 8 |
|
| 9 |
LC_ALL:=C |
| 10 |
export LC_ALL |
| 11 |
|
| 12 |
shellescape='$(subst ','\'',$(1))' |
| 13 |
shellexport=$(1)=$(call shellescape,${$(1)}) |
| 14 |
|
| 15 |
# Hallo Helmut, yes, I know this causes FTCBFS, will deal with that later |
| 16 |
DEB_HOST_GNU_TYPE?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 17 |
|
| 18 |
EXTRA_CPPFLAGS= -DFREETYPEFONTDIR=\"/usr/share/fonts/truetype\" |
| 19 |
EXTRA_CPPFLAGS+=-D_DEFAULT_SOURCE # work around imake weirdness |
| 20 |
EXTRA_CPPFLAGS+=-D_GNU_SOURCE # for asprintf(3) |
| 21 |
EXTRA_CFLAGS+= -Wall -Wformat |
| 22 |
#EXTRA_CFLAGS+= -Wextra |
| 23 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 24 |
EXTRA_CFLAGS+= -Og -g3 |
| 25 |
endif |
| 26 |
|
| 27 |
# cut my losses, for now |
| 28 |
EXTRA_CFLAGS+= -Wno-unused-variable |
| 29 |
EXTRA_CFLAGS+= -Wno-unused-but-set-variable |
| 30 |
EXTRA_CFLAGS+= -Wno-pointer-sign |
| 31 |
EXTRA_CFLAGS+= -Wno-unused-function |
| 32 |
EXTRA_CFLAGS+= -Wno-unused-result |
| 33 |
# prototypisation done in the new upstream branch |
| 34 |
EXTRA_CFLAGS+= -std=gnu99 |
| 35 |
|
| 36 |
DEB_CPPFLAGS_MAINT_APPEND=${EXTRA_CPPFLAGS} |
| 37 |
DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS} |
| 38 |
DEB_CXXFLAGS_MAINT_APPEND=${EXTRA_CFLAGS} |
| 39 |
DEB_LDFLAGS_MAINT_APPEND=${EXTRA_LDFLAGS} |
| 40 |
DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 41 |
include /usr/share/dpkg/buildflags.mk |
| 42 |
|
| 43 |
CONFIGURE_ARGS+= --prefix=/usr |
| 44 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 45 |
CONFIGURE_ARGS+= --enable-debug |
| 46 |
endif |
| 47 |
CONFIGURE_ARGS+= --enable-locale |
| 48 |
CONFIGURE_ARGS+= --enable-freetype |
| 49 |
CONFIGURE_ARGS+= --enable-freetype-charset16 |
| 50 |
CONFIGURE_ARGS+= --enable-xft2 |
| 51 |
CONFIGURE_ARGS+= --disable-vflib |
| 52 |
CONFIGURE_ARGS+= --enable-gif |
| 53 |
CONFIGURE_ARGS+= --build=${DEB_HOST_GNU_TYPE} |
| 54 |
|
| 55 |
CONFIGURE_ENV+= ac_cv_path_mgp_cv_path_gunzip=/bin/gunzip |
| 56 |
CONFIGURE_ENV+= ac_cv_path_mgp_cv_path_gzip=/bin/gzip |
| 57 |
|
| 58 |
MAKE_ARGS+= LIBDIR=/etc |
| 59 |
MAKE_ARGS+= INSTPGMFLAGS= INSTALLFLAGS=-p |
| 60 |
# work around imake weirdness |
| 61 |
MAKE_ARGS+= EXTRA_DEFINES=$(call shellescape,${CPPFLAGS}) |
| 62 |
MAKE_ARGS+= CDEBUGFLAGS=$(call shellescape,${CFLAGS}) |
| 63 |
MAKE_ARGS+= CXXDEBUGFLAGS=$(call shellescape,${CXXFLAGS}) |
| 64 |
MAKE_ARGS+= LOCAL_LDFLAGS=$(call shellescape,${LDFLAGS}) |
| 65 |
MAKE_ARGS+= PROJECTMANSUFFIX= |
| 66 |
|
| 67 |
# Note to other DDs seeing this: This is the old packaging for |
| 68 |
# magicpoint; I’ve got a new packaging using dh7-style as is |
| 69 |
# these days recommended, but that’s for a new upstream, which |
| 70 |
# is not ready yet. Keep this, for now, since it works good enough. |
| 71 |
|
| 72 |
build-arch: build-stamp |
| 73 |
build-stamp: |
| 74 |
dh_testdir |
| 75 |
ln -sf /usr/share/misc/config.sub . |
| 76 |
ln -sf /usr/share/misc/config.guess . |
| 77 |
exec env ${CONFIGURE_ENV} \ |
| 78 |
$(foreach i,CC CFLAGS CXXFLAGS CPPFLAGS LDFLAGS,$(call shellexport,$i)) \ |
| 79 |
sh configure ${CONFIGURE_ARGS} |
| 80 |
xmkmf |
| 81 |
make Makefiles |
| 82 |
make ${MAKE_ARGS} |
| 83 |
touch build-stamp |
| 84 |
|
| 85 |
clean: |
| 86 |
dh_testdir |
| 87 |
dh_testroot |
| 88 |
-rm -f build-stamp install-stamp |
| 89 |
[ ! -f Makefile ] || make distclean |
| 90 |
-rm -f `find . -name "*~"` |
| 91 |
-rm -rf debian/mgp debian/files* core debian/substvars |
| 92 |
-rm -f Makefile Imakefile *._man |
| 93 |
rm -f config.guess config.sub |
| 94 |
dh_clean |
| 95 |
|
| 96 |
install: install-stamp |
| 97 |
install-stamp: build-stamp |
| 98 |
dh_testdir |
| 99 |
dh_testroot |
| 100 |
dh_prep |
| 101 |
dh_installdirs |
| 102 |
make ${MAKE_ARGS} \ |
| 103 |
DESTDIR=$(CURDIR)/debian/mgp prefix=$(CURDIR)/debian/mgp/usr \ |
| 104 |
install install.man |
| 105 |
# contrib |
| 106 |
install -d $(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el |
| 107 |
install -m 755 contrib/eqn2eps.sh \ |
| 108 |
contrib/mgp2html.pl contrib/mgp2latex.pl \ |
| 109 |
contrib/tex2eps.sh \ |
| 110 |
$(CURDIR)/debian/mgp/usr/bin/ |
| 111 |
install -m 644 contrib/mgp-el/README \ |
| 112 |
$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el |
| 113 |
install -m 644 contrib/mgp-el/mgp.sty \ |
| 114 |
$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el |
| 115 |
install -m 644 contrib/mgp-el/sample.tex \ |
| 116 |
$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el |
| 117 |
install -m 644 contrib/mgp-mode.el contrib/mgp-el/mgp.el \ |
| 118 |
$(CURDIR)/debian/mgp/usr/share/emacs/site-lisp/mgp |
| 119 |
-rm $(CURDIR)/debian/mgp/etc/mgp/* |
| 120 |
cp debian/default.mgp $(CURDIR)/debian/mgp/etc/mgp/default.mgp |
| 121 |
|
| 122 |
#Rename shell scripts to remove .sh extension. |
| 123 |
mv $(CURDIR)/debian/mgp/usr/bin/eqn2eps.sh \ |
| 124 |
$(CURDIR)/debian/mgp/usr/bin/eqn2eps |
| 125 |
mv $(CURDIR)/debian/mgp/usr/bin/tex2eps.sh \ |
| 126 |
$(CURDIR)/debian/mgp/usr/bin/tex2eps |
| 127 |
mv $(CURDIR)/debian/mgp/usr/bin/mgp2html.pl \ |
| 128 |
$(CURDIR)/debian/mgp/usr/bin/mgp2html |
| 129 |
mv $(CURDIR)/debian/mgp/usr/bin/mgp2latex.pl \ |
| 130 |
$(CURDIR)/debian/mgp/usr/bin/mgp2latex |
| 131 |
|
| 132 |
touch install-stamp |
| 133 |
|
| 134 |
# Build architecture-independent files here. |
| 135 |
binary-indep: build-indep |
| 136 |
# We have nothing to do by default. |
| 137 |
build-indep: |
| 138 |
|
| 139 |
# Build architecture-dependent files here. |
| 140 |
binary-arch: build-arch install |
| 141 |
# dh_testversion |
| 142 |
dh_testdir |
| 143 |
dh_testroot |
| 144 |
dh_installdocs COPYRIGHT COPYRIGHT.jp FAQ \ |
| 145 |
README README.fonts README.fonts.jp README.lang \ |
| 146 |
SYNTAX TODO.jp USAGE USAGE.jp |
| 147 |
dh_installexamples `find sample -type f ! -name '*akefile*' ! -name .cvsignore -print` debian/mgp-print6 |
| 148 |
dh_installmenu |
| 149 |
dh_installmime |
| 150 |
dh_installcron |
| 151 |
# dh_installman |
| 152 |
dh_installinit |
| 153 |
dh_installemacsen |
| 154 |
dh_installchangelogs RELNOTES |
| 155 |
# dh_movefiles |
| 156 |
dh_strip |
| 157 |
dh_compress --exclude=examples |
| 158 |
dh_fixperms |
| 159 |
# dh_suidregister |
| 160 |
dh_makeshlibs |
| 161 |
dh_installdeb |
| 162 |
dh_shlibdeps |
| 163 |
dh_gencontrol |
| 164 |
dh_md5sums |
| 165 |
dh_builddeb |
| 166 |
|
| 167 |
binary: binary-indep binary-arch |
| 168 |
build: build-indep build-arch |
| 169 |
.PHONY: build clean binary-indep binary-arch binary build-indep build-arch |