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
|
#!/usr/bin/make -f
#
# debian/rules file for tfm-arphic for Debian.
# GNU GPL v2, Copyright (C) 1999-2001, Anthony Fok <foka@debian.org>
package = tfm-arphic
SHELL = /bin/sh
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
export DH_COMPAT=3
# export DH_OPTIONS doesn't work for this file. Yes, I tried already.
#export DH_OPTIONS
#
# Arphic PL fonts information
fonts = bsmi bkai gbsn gkai
bsmi_typeface = bsmi00lp
bsmi_familyname = AR PL Mingti2L Big5
bsmi_encoding = UBig5
bkai_typeface = bkai00mp
bkai_familyname = AR PL KaitiM Big5
bkai_encoding = UBig5
gbsn_typeface = gbsn00lp
gbsn_familyname = AR PL SungtiL GB
gbsn_encoding = UGB
gkai_typeface = gkai00mp
gkai_familyname = AR PL KaitiM GB
gkai_encoding = UGB
UBig5_mapfile = cubig5.map
UBig5_planes = 55
UGB_mapfile = cugb.map
UGB_planes = 35
fonttype = truetype
supplier = arphic
mode = modeless
typeface = $($(abbrev)_typeface)
familyname = $($(abbrev)_familyname)
encoding = $($(abbrev)_encoding)
mapfile = $($(encoding)_mapfile)
planes = $($(encoding)_planes)
bin-package = tfm-$(supplier)-$(typeface)
binary_fonts = $(addprefix binary_,$(fonts))
build-stamp_fonts = $(addprefix build-stamp.,$(fonts))
install_fonts = $(addprefix install_,$(fonts))
clean_fonts = $(addprefix clean_,$(fonts))
# Path names
d = debian/$(bin-package)
mapsdir = /usr/share/ttf2pt1/maps
texmf = usr/share/texmf
fontpath = usr/share/fonts/$(fonttype)/$(supplier)
dest_texfontpath = $(texmf)/fonts/$(fonttype)/$(supplier)
dest_tfmpath = $(texmf)/fonts/tfm/$(supplier)/$(typeface)
dest_docpath = usr/share/doc/texmf/fonts/$(fonttype)/$(supplier)
dest_encpath = $(texmf)/dvips/$(supplier)
build: build-stamp
build-stamp: $(build-stamp_fonts)
dh_testdir
touch build-stamp
$(build-stamp_fonts): abbrev = $(patsubst build-stamp.%,%,$@)
$(build-stamp_fonts):
dh_testdir
ln -sf /$(fontpath)/$(typeface).ttf .
ttf2tfm $(typeface) -q $(abbrev)@$(encoding)@
ttf2tfm $(typeface) -q -s 0.167 $(abbrev)s@$(encoding)@
ttf2tfm $(typeface) -q -x $(abbrev)r@$(encoding)@
ttf2tfm $(typeface) -q -x -s 0.167 $(abbrev)rs@$(encoding)@
for i in \
`perl -e 'for $$p (01..$(planes)) { printf "%02d ", $$p; }'`; \
do \
ttf2pt1 -L $(mapsdir)/$(mapfile)+$$i \
-Oh $(typeface).ttf $(abbrev)$$i; \
rm -f $(abbrev)$$i.t1a $(abbrev)$$i.afm; \
done
touch $@
clean: pre-clean $(clean_fonts)
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
rm -f *.ttf *.tfm *.afm *.t1a *.enc
dh_clean
pre-clean:
cd debian; cp control.stem.in control
$(clean_fonts): abbrev = $(patsubst clean_%,%,$@)
$(clean_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(clean_fonts):
cd debian; \
sed -e 's/@TYPEFACE@/$(typeface)/g' \
-e 's/@FAMILYNAME@/$(familyname)/g' \
control.leaf.in >> control
cd debian; \
sed -e 's/@ABBREV@/$(abbrev)/g' \
-e 's/@FAMILYNAME@/$(familyname)/g' \
-e 's/@TYPEFACE@/$(typeface)/g' \
copyright.in > $(bin-package).copyright
cd debian; \
cp postinst $(bin-package).postinst
cd debian; \
sed -e 's/@MODE@/$(mode)/g' \
-e 's/@SUPPLIER@/$(supplier)/g' \
-e 's/@TYPEFACE@/$(typeface)/g' \
postrm.in > $(bin-package).postrm
dh_clean $(DH_OPTIONS)
rm -f build-stamp.$(abbrev)
install: build $(install_fonts)
$(install_fonts): abbrev = $(patsubst install_%,%,$@)
$(install_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(install_fonts):
dh_testdir $(DH_OPTIONS)
dh_testroot $(DH_OPTIONS)
dh_clean -k $(DH_OPTIONS)
dh_installdirs $(DH_OPTIONS) $(dest_tfmpath) $(dest_docpath) \
$(dest_texfontpath) $(dest_encpath)
ln -s ../../../../fonts/$(fonttype)/$(supplier)/$(typeface).ttf \
$(d)/$(dest_texfontpath)/
cp -a $(abbrev)*.tfm $(d)/$(dest_tfmpath)/
cp -a $(abbrev)*.enc $(d)/$(dest_encpath)/
# Build architecture-independent files here.
binary-indep: build install $(binary_fonts)
$(binary_fonts): abbrev = $(patsubst binary_%,%,$@)
$(binary_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(binary_fonts):
dh_testdir $(DH_OPTIONS)
dh_testroot $(DH_OPTIONS)
dh_installdocs $(DH_OPTIONS)
ln -s ../../../../$(bin-package) $(d)/$(dest_docpath)/$(typeface)
dh_installchangelogs $(DH_OPTIONS)
dh_link $(DH_OPTIONS)
dh_compress $(DH_OPTIONS)
dh_fixperms $(DH_OPTIONS)
dh_installdeb $(DH_OPTIONS)
dh_gencontrol $(DH_OPTIONS)
dh_md5sums $(DH_OPTIONS)
dh_builddeb $(DH_OPTIONS)
# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install \
$(fonts) $(install_fonts) $(binary_fonts) $(clean_fonts) pre-clean
|