David Turner | c5341fb | 2001-06-23 07:44:51 +0000 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | # Made with the aid of debhelper by by Joey Hess, |
| 3 | # based on the sample debian/rules file for GNU hello by Ian Jackson. |
| 4 | # |
| 5 | # This is free software; see the GNU General Public Licence |
| 6 | # version 2 or later for copying conditions. There is NO warranty. |
| 7 | # |
| 8 | # Currently maintained by Anthony Fok <foka@debian.org> |
| 9 | # for Debian GNU/Linux. |
| 10 | |
| 11 | SHELL = /bin/bash |
| 12 | |
| 13 | # Uncomment this to turn on verbose mode. |
| 14 | #export DH_VERBOSE=1 |
| 15 | |
| 16 | # This is the debhelper compatibility version to use. |
| 17 | export DH_COMPAT=3 |
| 18 | |
| 19 | # This has to be exported to make some magic below work. |
| 20 | export DH_OPTIONS |
| 21 | |
| 22 | srcpkg = freetype2 |
| 23 | |
| 24 | # Remember to update the following for each release. |
| 25 | freetype_u := freetype-2.0.4 |
| 26 | ftdocs_u := ftdocs-2.0.4 |
| 27 | ftdocs_d := freetype-2.0.4 |
| 28 | ft2demos_u := ft2demos-2.0.4 |
| 29 | |
| 30 | # ver := $(shell ( head -1 | sed -e 's/^.*(\(.\+\)-.*).*/\1/' ) < debian/changelog) |
| 31 | |
| 32 | libpkg := libfreetype7 |
| 33 | devpkg := $(libpkg)-dev |
| 34 | docpkg := $(libpkg)-doc |
| 35 | demospkg := freetype2-demos |
| 36 | docdir := usr/share/doc |
| 37 | |
| 38 | # These files are general documentation and should go into the lib package. |
| 39 | libdoc = FTL.txt GPL.txt license.txt CHANGES todo |
| 40 | |
| 41 | TMP = $(PWD)/debian/tmp |
| 42 | |
| 43 | build: build-stamp |
| 44 | build-stamp: |
| 45 | dh_testdir |
| 46 | |
| 47 | @for i in $(freetype_u) $(ftdocs_u) $(ft2demos_u); do \ |
| 48 | if [ -f $$i.tar.bz2 ]; then \ |
| 49 | echo "Unpacking $$i.tar.bz2 ..."; \ |
| 50 | tar -x --bzip2 -f $$i.tar.bz2; \ |
| 51 | elif [ -f $$i.tar.gz ]; then \ |
| 52 | echo "Unpacking $$i.tar.gz ..."; \ |
| 53 | tar -x --gzip -f $$i.tar.gz; \ |
| 54 | else \ |
| 55 | echo "Error! $$i.tar.{bz2,gz} not found!"; \ |
| 56 | exit 1; \ |
| 57 | fi \ |
| 58 | done |
| 59 | # Apple's so-called patents are bogus, says me. |
| 60 | # Let's turn on the bytecode interpreter. |
| 61 | perl -pi -e 's/^#undef(?=\s+TT_CONFIG_OPTION_BYTECODE_INTERPRETER)/#define/' \ |
| 62 | $(freetype_u)/include/freetype/config/ftoption.h |
| 63 | |
| 64 | $(MAKE) -C $(freetype_u) setup CFG="--prefix=/usr" |
| 65 | $(MAKE) -C $(freetype_u) |
| 66 | |
| 67 | $(MAKE) -C $(ft2demos_u) TOP=../$(freetype_u) X11_PATH=/usr/X11R6 |
| 68 | |
| 69 | touch build-stamp |
| 70 | |
| 71 | clean: |
| 72 | dh_testdir |
| 73 | dh_testroot |
| 74 | rm -f build-stamp |
| 75 | # -$(MAKE) distclean |
| 76 | rm -rf $(freetype_u) $(ft2demos_u) $(ftdocs_d) |
| 77 | dh_clean |
| 78 | |
| 79 | install: DH_OPTIONS= |
| 80 | install: build |
| 81 | dh_testdir |
| 82 | dh_testroot |
| 83 | dh_clean -k |
| 84 | dh_installdirs |
| 85 | |
| 86 | $(MAKE) -C $(freetype_u) prefix=$(TMP)/usr install |
| 87 | |
| 88 | dh_movefiles |
| 89 | @if [ "`find debian/tmp ! -type d`" ]; then \ |
| 90 | echo "Error! Not all files are moved out of debian/tmp!"; \ |
| 91 | echo "Please fix your debian/*.files."; \ |
| 92 | exit 1; \ |
| 93 | fi |
| 94 | |
| 95 | dh_installdirs -p$(demospkg)/usr/bin |
| 96 | $(freetype_u)/builds/unix/libtool --mode=install \ |
| 97 | cp -av `find $(ft2demos_u)/bin -type f -perm +a=x -maxdepth 1` \ |
| 98 | $(PWD)/debian/$(demospkg)/usr/bin/ |
| 99 | cd debian/$(demospkg)/usr/bin && mv memtest ftmemtest |
| 100 | |
| 101 | # Build architecture-independent files here. |
| 102 | # Pass -i to all debhelper commands in this target to reduce clutter. |
| 103 | binary-indep: DH_OPTIONS=-i |
| 104 | binary-indep: build install |
| 105 | # We have nothing to do by default. |
| 106 | |
| 107 | # Build architecture-dependent files here. |
| 108 | # Pass -a to all debhelper commands in this target to reduce clutter. |
| 109 | binary-arch: DH_OPTIONS=-a |
| 110 | binary-arch: build $(libpkg) $(devpkg) $(demospkg) |
| 111 | |
| 112 | $(libpkg): DH_OPTIONS=-p$(libpkg) |
| 113 | $(libpkg): build install |
| 114 | dh_testdir |
| 115 | dh_testroot |
| 116 | dh_installdirs |
| 117 | dh_installdocs $(addprefix $(freetype_u)/docs/,$(libdoc)) \ |
| 118 | $(freetype_u)/src/autohint/CatharonLicense.txt \ |
| 119 | $(ftdocs_d)/docs/ft2faq.html |
| 120 | ln -sf ../../common-licenses/GPL debian/$(libpkg)/$(docdir)/$(libpkg)/GPL.txt |
| 121 | mkdir debian/$(libpkg)/$(docdir)/$(libpkg)/pcf |
| 122 | cp -a $(freetype_u)/src/pcf/readme debian/$(libpkg)/$(docdir)/$(libpkg)/pcf/ |
| 123 | dh_installexamples |
| 124 | # dh_installmenu |
| 125 | # dh_undocumented |
| 126 | dh_installchangelogs -k $(freetype_u)/ChangeLog |
| 127 | dh_strip |
| 128 | dh_link |
| 129 | dh_compress |
| 130 | dh_fixperms |
| 131 | dh_installdeb |
| 132 | dh_shlibdeps |
| 133 | dh_gencontrol |
| 134 | # dh_makeshlibs -V $(dependency) |
| 135 | dh_makeshlibs |
| 136 | |
| 137 | dh_md5sums |
| 138 | dh_builddeb |
| 139 | |
| 140 | $(devpkg): DH_OPTIONS=-p$(devpkg) |
| 141 | $(devpkg): build install |
| 142 | dh_testdir |
| 143 | dh_testroot |
| 144 | dh_installdirs $(docdir)/$(libpkg) |
| 145 | ln -s $(libpkg) debian/$(devpkg)/$(docdir)/$(devpkg) |
| 146 | dh_installdocs $(ftdocs_d)/docs/* $(freetype_u)/docs/* |
| 147 | cd debian/$(devpkg)/usr/share/doc/$(devpkg)/ \ |
| 148 | && rm -f $(libdoc) BUILD ft2faq.html |
| 149 | # dh_installexamples |
| 150 | # dh_installmenu |
| 151 | # dh_installmanpages |
| 152 | # dh_undocumented |
| 153 | # dh_installchangelogs |
| 154 | dh_strip |
| 155 | dh_link |
| 156 | dh_compress |
| 157 | dh_fixperms |
| 158 | dh_installdeb |
| 159 | dh_shlibdeps |
| 160 | dh_gencontrol |
| 161 | # dh_makeshlibs |
| 162 | dh_md5sums |
| 163 | dh_builddeb |
| 164 | |
| 165 | $(demospkg): DH_OPTIONS=-p$(demospkg) |
| 166 | $(demospkg): build install |
| 167 | dh_testdir |
| 168 | dh_testroot |
| 169 | dh_installdirs $(docdir)/$(libpkg) |
| 170 | ln -s $(libpkg) debian/$(demospkg)/$(docdir)/$(demospkg) |
| 171 | # dh_installdocs |
| 172 | # dh_installexamples |
| 173 | # dh_installmenu |
| 174 | # dh_installmanpages |
| 175 | # dh_undocumented |
| 176 | # dh_installchangelogs |
| 177 | dh_strip |
| 178 | dh_link |
| 179 | dh_compress |
| 180 | dh_fixperms |
| 181 | dh_installdeb |
| 182 | dh_shlibdeps |
| 183 | dh_gencontrol |
| 184 | # dh_makeshlibs |
| 185 | dh_md5sums |
| 186 | dh_builddeb |
| 187 | |
| 188 | binary: binary-indep binary-arch |
| 189 | .PHONY: build clean binary-indep binary-arch binary \ |
| 190 | $(libpkg) $(devpkg) install |