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
#!/usr/bin/make -f
# Made with the aid of debhelper by by Joey Hess,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
#
# This is free software; see the GNU General Public Licence
# version 2 or later for copying conditions. There is NO warranty.
#
# Currently maintained by Anthony Fok <foka@debian.org>
# for Debian GNU/Linux.
SHELL = /bin/bash
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
export DH_COMPAT=3
# This has to be exported to make some magic below work.
export DH_OPTIONS
srcpkg = freetype2
# Remember to update the following for each release.
freetype_u := freetype-2.0.4
ftdocs_u := ftdocs-2.0.4
ftdocs_d := freetype-2.0.4
ft2demos_u := ft2demos-2.0.4
# ver := $(shell ( head -1 | sed -e 's/^.*(\(.\+\)-.*).*/\1/' ) < debian/changelog)
libpkg := libfreetype7
devpkg := $(libpkg)-dev
docpkg := $(libpkg)-doc
demospkg := freetype2-demos
docdir := usr/share/doc
# These files are general documentation and should go into the lib package.
libdoc = FTL.txt GPL.txt license.txt CHANGES todo
TMP = $(PWD)/debian/tmp
build: build-stamp
build-stamp:
dh_testdir
@for i in $(freetype_u) $(ftdocs_u) $(ft2demos_u); do \
if [ -f $$i.tar.bz2 ]; then \
echo "Unpacking $$i.tar.bz2 ..."; \
tar -x --bzip2 -f $$i.tar.bz2; \
elif [ -f $$i.tar.gz ]; then \
echo "Unpacking $$i.tar.gz ..."; \
tar -x --gzip -f $$i.tar.gz; \
else \
echo "Error! $$i.tar.{bz2,gz} not found!"; \
exit 1; \
fi \
done
# Apple's so-called patents are bogus, says me.
# Let's turn on the bytecode interpreter.
perl -pi -e 's/^#undef(?=\s+TT_CONFIG_OPTION_BYTECODE_INTERPRETER)/#define/' \
$(freetype_u)/include/freetype/config/ftoption.h
$(MAKE) -C $(freetype_u) setup CFG="--prefix=/usr"
$(MAKE) -C $(freetype_u)
$(MAKE) -C $(ft2demos_u) TOP=../$(freetype_u) X11_PATH=/usr/X11R6
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# -$(MAKE) distclean
rm -rf $(freetype_u) $(ft2demos_u) $(ftdocs_d)
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) -C $(freetype_u) prefix=$(TMP)/usr install
dh_movefiles
@if [ "`find debian/tmp ! -type d`" ]; then \
echo "Error! Not all files are moved out of debian/tmp!"; \
echo "Please fix your debian/*.files."; \
exit 1; \
fi
dh_installdirs -p$(demospkg)/usr/bin
$(freetype_u)/builds/unix/libtool --mode=install \
cp -av `find $(ft2demos_u)/bin -type f -perm +a=x -maxdepth 1` \
$(PWD)/debian/$(demospkg)/usr/bin/
cd debian/$(demospkg)/usr/bin && mv memtest ftmemtest
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.
binary-arch: DH_OPTIONS=-a
binary-arch: build $(libpkg) $(devpkg) $(demospkg)
$(libpkg): DH_OPTIONS=-p$(libpkg)
$(libpkg): build install
dh_testdir
dh_testroot
dh_installdirs
dh_installdocs $(addprefix $(freetype_u)/docs/,$(libdoc)) \
$(freetype_u)/src/autohint/CatharonLicense.txt \
$(ftdocs_d)/docs/ft2faq.html
ln -sf ../../common-licenses/GPL debian/$(libpkg)/$(docdir)/$(libpkg)/GPL.txt
mkdir debian/$(libpkg)/$(docdir)/$(libpkg)/pcf
cp -a $(freetype_u)/src/pcf/readme debian/$(libpkg)/$(docdir)/$(libpkg)/pcf/
dh_installexamples
# dh_installmenu
# dh_undocumented
dh_installchangelogs -k $(freetype_u)/ChangeLog
dh_strip
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
# dh_makeshlibs -V $(dependency)
dh_makeshlibs
dh_md5sums
dh_builddeb
$(devpkg): DH_OPTIONS=-p$(devpkg)
$(devpkg): build install
dh_testdir
dh_testroot
dh_installdirs $(docdir)/$(libpkg)
ln -s $(libpkg) debian/$(devpkg)/$(docdir)/$(devpkg)
dh_installdocs $(ftdocs_d)/docs/* $(freetype_u)/docs/*
cd debian/$(devpkg)/usr/share/doc/$(devpkg)/ \
&& rm -f $(libdoc) BUILD ft2faq.html
# dh_installexamples
# dh_installmenu
# dh_installmanpages
# dh_undocumented
# dh_installchangelogs
dh_strip
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
# dh_makeshlibs
dh_md5sums
dh_builddeb
$(demospkg): DH_OPTIONS=-p$(demospkg)
$(demospkg): build install
dh_testdir
dh_testroot
dh_installdirs $(docdir)/$(libpkg)
ln -s $(libpkg) debian/$(demospkg)/$(docdir)/$(demospkg)
# dh_installdocs
# dh_installexamples
# dh_installmenu
# dh_installmanpages
# dh_undocumented
# dh_installchangelogs
dh_strip
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
# dh_makeshlibs
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary \
$(libpkg) $(devpkg) install