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
|
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
pkg = $(DEB_SOURCE_PACKAGE)
pkg-mono = $(pkg)-mono
pkg-hinted = $(pkg)-hinted
pkg-hinted-udeb = $(pkg)-hinted-udeb
pkg-unhinted = $(pkg)-unhinted
pkg-unhinted-udeb = $(pkg)-unhinted-udeb
pkg-croscore = fonts-croscore
DEB_UPSTREAM_URL = https://github.com/googlei18n/noto-fonts/archive
DEB_UPSTREAM_PACKAGE = NotoFonts-hinted
DEB_UPSTREAM_TARBALL_SRCDIR = noto-fonts-$(DEB_UPSTREAM_TARBALL_BASENAME)
DEB_UPSTREAM_TARBALL_SRCDIR += $(if \
$(filter $(DEB_UPSTREAM_PACKAGE)-%,$(DEB_UPSTREAM_TARBALL_BASENAME)),\
$(error set DEB_UPSTREAM_TARBALL_BASENAME to commit hash))
DEB_INSTALL_DOCS_ALL += README.md FAQ.md
DEB_COPYRIGHT_EXTRACT_EXTS = gif jpg png ttc
DEB_COPYRIGHT_EXTRACT_PATHS_EXIF = .*.ttf .*.otf
# resolve font facts and encode for control file (see deb-substvars(5) )
CDBS_BUILD_DEPENDS +=, lcdf-typetools
substvars-list-encode = perl -0 -F/\\n/ -ane 'print " * ", join("\$${Newline} * ",@F)'
# Generate fonts list
fonts-mono := $(wildcard hinted/NotoMono*.ttf)
fonts-hinted := $(filter-out $(fonts-mono),$(wildcard hinted/Noto*.ttf))
fonts-hinted-di = $(wildcard hinted/NotoSansSinhala*.ttf)
fonts-unhinted := $(wildcard unhinted/Noto*.ttf)
fonts-croscore := $(wildcard hinted/Arimo*.ttf hinted/Cousine*.ttf hinted/Tinos*.ttf)
fonts-nothinted = $(filter-out $(subst hinted,unhinted,$(fonts-hinted)),$(fonts-unhinted))
# Substvars magic
fonts-scriptcount := $(shell otfinfo -s $(fonts-unhinted) | perl -ne 's/^.*\t+//;s, ?(/|Default|<unknown|v\.2|\(.*\)).*,,;s,^([^/]+)/\1,$1,;/./ and print' | sort -u | grep -c .)
fonts-familylist := $(shell otfinfo -a $(fonts-hinted) | cut -d: -f2 | LC_ALL=C sort -u | $(substvars-list-encode))
fonts-nohintfamilylist := $(shell otfinfo -a $(fonts-nothinted) | cut -d: -f2 | LC_ALL=C sort -u | $(substvars-list-encode))
# Install fonts
DEB_DH_INSTALL_ARGS_$(pkg-mono) = $(fonts-mono) usr/share/fonts/truetype/noto/
DEB_DH_INSTALL_ARGS_$(pkg-hinted) = $(fonts-hinted) usr/share/fonts/truetype/noto/
DEB_DH_INSTALL_ARGS_$(pkg-hinted-udeb) = $(fonts-hinted-di) usr/share/fonts/truetype/noto/
DEB_DH_INSTALL_ARGS_$(pkg-unhinted) = $(fonts-nothinted) usr/share/fonts/truetype/noto/
DEB_DH_INSTALL_ARGS_$(pkg-unhinted-udeb) = $(fonts-nothinted) usr/share/fonts/truetype/noto/
DEB_DH_INSTALL_ARGS_$(pkg-croscore) = $(fonts-croscore) usr/share/fonts/truetype/croscore/
# install bug-* files into all binary packages
DEB_DH_BUGFILES_ARGS_ALL = --all
$(addprefix install/,$(pkg) $(pkg-hinted) $(pkg-unhinted))::
echo 'fonts:scriptcount=$(fonts-scriptcount)' >> debian/$(cdbs_curpkg).substvars
install/$(pkg-hinted)::
echo 'fonts:familylist=$(fonts-familylist)' >> debian/$(cdbs_curpkg).substvars
install/$(pkg-unhinted)::
echo 'fonts:nohintfamilylist=$(fonts-nohintfamilylist)' >> debian/$(cdbs_curpkg).substvars
|