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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
export CONFIG_SHELL=/bin/bash
LIBTOOLVERSION = $(shell dpkg-query -W -f='$${Version}\n' "libtool")
DIST=$(shell lsb_release -i -s)
CONFIG_OPTS = --prefix=/usr \
--libdir=\$${prefix}/lib \
--mandir=\$${prefix}/share/man \
--with-regular-link \
--enable-devicetables \
--enable-pyextension \
--enable-type3 \
--with-freetype-src
ifeq "$(DIST)" "Ubuntu"
CONFIG_OPTS += --with-freetype-bytecode
else
CONFIG_OPTS += --with-freetype-bytecode=no
endif
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS = --build $(DEB_BUILD_GNU_TYPE)
endif
configure: configure-stamp
configure-stamp:
dh_testdir
#ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
#endif
#ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
#endif
cp configure configure.old
cp install-sh install-sh.old
cp configure.in configure.in.old
# Now configure fontforge
if dpkg --compare-versions $(LIBTOOLVERSION) gt 1.9b; then \
set -e; cp configure.dynamic.in configure.in; libtoolize --force --copy --install; aclocal; autoconf; \
else \
set -e; cp configure.dynamic.in configure.in; libtoolize --force --copy; aclocal; autoconf; \
fi
./configure $(CROSS) ${CONFIG_OPTS} $(shell dpkg-buildflags --export=configure)
touch $@
configure-nox: configure-stamp-nox
configure-stamp-nox:
dh_testdir
[ ! -f Makefile ] || $(MAKE) distclean
./configure $(CROSS) ${CONFIG_OPTS} --without-x $(shell dpkg-buildflags --export=configure)
touch $@
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE)
$(MAKE) -C fontforge FontForge.pot
touch $@
build-nox: build-stamp-nox
build-stamp-nox: configure-stamp-nox
dh_testdir
$(MAKE)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-stamp-nox configure-stamp configure-stamp-nox
[ ! -f Makefile ] || $(MAKE) distclean
rm -f config.sub config.guess
[ ! -f configure.old ] || mv -f configure.old configure
[ ! -f install-sh.old ] || mv -f install-sh.old install-sh
[ ! -f configure.in.old ] || mv -f configure.in.old configure.in
rm -f debian/fontforge.sharedmimeinfo debian/fontforge.desktop
rm -rf Unicode/.libs Unicode/Makefile.in
rm -rf gdraw/.libs gdraw/Makefile.in
rm -rf fontforge/Makefile.in gutils/Makefile.in fontforge/FontForge.pot
rm -f Makefile.in aclocal.m4 ltmain.sh config.log configure.lineno
dh_clean --exclude ./fontforge/FontForge-MenuShortCuts.pot.orig --exclude ./fontforge/nowakowskittfinstr.c.orig --exclude ./fontforge/scstyles.c.orig
install: build
dh_testdir
dh_testroot
dh_prep -s --exclude ./fontforge/FontForge-MenuShortCuts.pot.orig --exclude ./fontforge/nowakowskittfinstr.c.orig --exclude ./fontforge/scstyles.c.orig
dh_installdirs -s
$(MAKE) install prefix=$(CURDIR)/debian/fontforge/usr libdir=$(CURDIR)/debian/libfontforge1/usr/lib
chrpath -d $(CURDIR)/debian/fontforge/usr/bin/fontforge
cp -p $(CURDIR)/debian/fontforge/usr/include/fontforge/* $(CURDIR)/debian/libfontforge-dev/usr/include/fontforge
-rm -rf $(CURDIR)/debian/fontforge/usr/include \
$(CURDIR)/debian/libfontforge1/usr/lib/*.la
mv $(CURDIR)/debian/libfontforge1/usr/lib/lib*.so $(CURDIR)/debian/libfontforge-dev/usr/lib
mv -t $(CURDIR)/debian/libfontforge-dev/usr/lib $(CURDIR)/debian/libfontforge1/usr/lib/pkgconfig
mkdir -p $(CURDIR)/debian/libgdraw4/usr/lib
mv $(CURDIR)/debian/libfontforge1/usr/lib/libgdraw.* $(CURDIR)/debian/libgdraw4/usr/lib
mv $(CURDIR)/debian/fontforge/usr/share/fontforge/python $(CURDIR)/debian/python-fontforge/usr/share/fontforge
cp -p Packaging/fontforge.desktop debian/fontforge/usr/share/applications/
cp -p Packaging/fontforge.png debian/fontforge/usr/share/pixmaps/
cp -p debian/fontforge.xpm debian/fontforge/usr/share/pixmaps/
cp Packaging/fontforge.xml debian/fontforge.sharedmimeinfo
dh_install -s
set -e; cd pyhook; python setup.py install --prefix=$(CURDIR)/debian/python-fontforge/usr
install-nox: build-nox
dh_testdir
dh_testroot
dh_installdirs -s
$(MAKE) install prefix=$(CURDIR)/debian/fontforge-nox/usr exec_prefix=$(CURDIR)/debian/fontforge-nox/usr
-rm -rf $(CURDIR)/debian/fontforge-nox/usr/include
-rm -rf $(CURDIR)/debian/fontforge-nox/usr/lib
-rm -rf $(CURDIR)/debian/fontforge-nox/usr/share/fontforge
chrpath -d $(CURDIR)/debian/fontforge-nox/usr/bin/fontforge
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installmenu
dh_installmime
dh_installman
dh_link
dh_python2 -ppython-fontforge
dh_strip --exclude=fontforge-nox --dbg-package=fontforge-dbg
# strip again to clean up the binaries in fontforge-nox:
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch: build install build-nox install-nox binary-common
binary-indep:
binary: binary-arch
.PHONY: build clean binary-arch binary install configure \
build-nox configure-nox install-nox
|