File: rules

package info (click to toggle)
tex-gyre 20160520-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 40,084 kB
  • ctags: 10
  • sloc: makefile: 117; sh: 6
file content (172 lines) | stat: -rwxr-xr-x 6,852 bytes parent folder | download
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
#! /usr/bin/make -f

PKG                   := tex-gyre
PKGFONTS              := fonts-texgyre
PKG_INSTALL_DIR       := debian/$(PKG)
PKGFONTS_INSTALL_DIR  := debian/$(PKGFONTS)

FAMILIES              := qag qbk qzc qcr qcs qhv qpl qtm
FAMILYNAMES           := Adventor Bonum Chorus Cursor Heros Pagella \
                         Schola Termes

INSTALL               := install
INSTALL_FILE          := $(INSTALL) -p -o root -g root -m 644


SHELL                 := /bin/bash

build: build-arch build-indep
# We have nothing to do here but the Debian Policy says this target must
# exist.

build-arch:
# Nothing to do here

build-indep: build-indep-stamp

build-indep-stamp:
	dh_testdir fonts/type1/public/tex-gyre/qtmr.pfb tex/latex/tex-gyre/tgtermes.sty
	# Warn the person building the package if new files were added
	# to the .orig.tar.gz + .diff.gz that this script is not aware of.
	@newfiles=$$(find . -type f | grep -Ev \
          -e '^\./debian/' \
	  -e '^\./tlpkg/' \
          -e '^\./fonts/type1/public/tex-gyre/[^/]*\.pf[bm]$$' \
          -e '^\./fonts/afm/public/tex-gyre/[^/]*\.afm$$' \
          -e '^\./fonts/tfm/public/tex-gyre/[^/]*\.tfm$$' \
	  -e '^\./fonts/map/dvips/tex-gyre/[^/]*\.map$$' \
	  -e '^\./fonts/enc/dvips/tex-gyre/[^/]*\.enc$$' \
	  -e '^\./fonts/opentype/public/tex-gyre/[^/]*\.otf$$' \
	  -e '^\./fonts/opentype/public/tex-gyre-math/[^/]*\.otf$$' \
          -e '^\./tex/latex/tex-gyre/[^/]*\.(fd|sty)$$' \
	  -e '^\./source/fonts/tex-gyre-math/texgyredejavu-math\.sfd$$' \
	  -e '^\./doc/fonts/tex-gyre-math/[^/]*\.(tex|pdf|txt|fea|docx)$$' \
	  -e '^\./doc/fonts/tex-gyre-math/README$$' \
          -e '^\./doc/fonts/tex-gyre/[^/]*\.(tex|pdf|txt|fea|nam)$$' || true) && \
          if [ -n "$$newfiles" ]; then \
              { echo "New files were found in the patched tarball" \
                     "(.orig.tar.gz + .diff.gz):"; \
                echo "$$newfiles" | sed 's/^\(.*\)$$/  \1/'; \
                echo; \
                echo "Please update the debian/rules file accordingly."; \
              } >&2; \
              exit 1; \
          fi

        # Upstream provides <texmf>/fonts/map/dvips/tex-gyre/q??.map that 
	# should be equivalent to all the encoding-specific map files in 
        # <texmf>/fonts/map/dvips/tex-gyre/ 
        # Let's check if this is really the case.
	@export LC_COLLATE=C && for fam in $(FAMILIES) ; do \
	   a=$$(find fonts/map/dvips/tex-gyre -name "$$fam-*.map" \
              -print0 | xargs -0r cat | grep -Ev -e '^(%|[[:space:]]*$$)' \
                      | sort) \
	&& b=$$(sort < fonts/map/dvips/tex-gyre/$$fam.map | grep -Ev -e \
                                                        '^(%|[[:space:]]*$$)') \
	&& if [ "$$a" != "$$b" ]; then \
             { echo; \
               echo "Warning: fonts/map/dvips/tex-gyre/$$fam.map does not appear to" \
                    "be equivalent to"; \
               echo "the concatenation of the other family's map files found in" \
                    "fonts/map/dvips/tex-gyre/."; \
               echo; \
             } >&2; \
           fi ; \
	done

	# Generate $(PKG).scale from $(PKG).defoma-hints (since it contains
	# nice hand-crafted XLFD names for the fonts).
	sed -nf debian/sed_scripts/gen-fonts.scale \
	  "debian/$(PKG).defoma-hints" > "debian/$(PKG).scale.tmp"
	{ wc -l < "debian/$(PKG).scale.tmp" && \
	  cat "debian/$(PKG).scale.tmp"; \
	} > "debian/$(PKG).scale"

	# The following generated list should be safe with respect to font
	# file names containing spaces (there is one name per line)...
	sed -ne 's/^[[:blank:]]*begin[[:blank:]]\{1,\}.*[/]\([^/]\{1,\}\)\.pfb[[:blank:]]*$$/\1/p' \
	  < "debian/$(PKG).defoma-hints" > "debian/$(PKG).fontlist-x11"
	
        # Generate the actual copyright file from copyright.in and
        # the GUST license
	#cat debian/copyright.in doc/fonts/tex-gyre/GUST-FONT-LICENSE.txt \
        #    > debian/copyright

	touch build-indep-stamp

clean:
	dh_testdir fonts/type1/public/tex-gyre/qtmr.pfb tex/latex/tex-gyre/tgtermes.sty
	dh_testroot
	# debian/$(PKG).links is automatically generated from the list of
	# fonts to declare to X11 among other things, so we have to delete
	# it here.
	# rm -f debian/copyright
	rm -f build-indep-stamp \
		"debian/$(PKG).scale.tmp" "debian/$(PKG).scale" \
		"debian/$(PKG).fontlist-x11" "debian/$(PKG).links"
	dh_clean

binary-indep: build-indep
	dh_testdir fonts/type1/public/tex-gyre/qtmr.pfb tex/latex/tex-gyre/tgtermes.sty
	dh_testroot
	dh_clean

	# We will call dh_link only once for the build, with all desired links
	# specified in $(PKG).links because it is much faster than spawning
	# a dh_link (actually, Perl) process for every symbolic link in this
	# package. So, $(PKG).links starts as an empty file and (target, link)
	# pairs will be added to it in the relevant places.
	: > "debian/$(PKG).links"


	# Setup symlinks so that X can see the AFM and PFB files as well.
	sed -nf debian/sed_scripts/gen-x-fonts-links-list \
	  "debian/$(PKG).fontlist-x11" >> "debian/$(PKG).links"
	
	dh_install
	dh_installxfonts
	dh_installtex --package=$(PKG) mapfile=debian/tex-gyre.cfg

	$(foreach PPP, $(PKG) $(PKGFONTS), \
	  dh_link -p $(PPP) \
            $(foreach FAM, $(FAMILYNAMES), \
              usr/share/texmf/doc/fonts/tex-gyre/README-TeX-Gyre-$(FAM).txt \
	      usr/share/doc/$(PPP)/README-TeX-Gyre-$(FAM).txt) \
            $(foreach FAM, $(FAMILIES), \
	      usr/share/texmf/doc/fonts/tex-gyre/$(FAM)-info.pdf \
	      usr/share/doc/$(PPP)/$(FAM)-info.pdf) \
            $(foreach FAM, $(FAMILIES), \
	      usr/share/texmf/doc/fonts/tex-gyre/$(FAM)-hist.txt \
	      usr/share/doc/$(PPP)/$(FAM)-hist.txt) \
	    usr/share/texmf/doc/fonts/tex-gyre-math/README-TeX-Gyre-Bonum-Math.txt \
	    usr/share/doc/$(PPP)/README-TeX-Gyre-Bonum-Math.txt \
	    usr/share/texmf/doc/fonts/tex-gyre-math/README-TeX-Gyre-Pagella-Math.txt \
	    usr/share/doc/$(PPP)/README-TeX-Gyre-Pagella-Math.txt \
	    usr/share/texmf/doc/fonts/tex-gyre-math/README-TeX-Gyre-Schola-Math.txt \
	    usr/share/doc/$(PPP)/README-TeX-Gyre-Schola-Math.txt \
	    usr/share/texmf/doc/fonts/tex-gyre-math/README-TeX-Gyre-Termes-Math.txt \
	    usr/share/doc/$(PPP)/README-TeX-Gyre-Termes-Math.txt \
	    usr/share/texmf/doc/fonts/tex-gyre-math/README-TeX-Gyre-DejaVu-Math.txt \
	    usr/share/doc/$(PPP)/README-TeX-Gyre-DejaVu-Math.txt \
	      ; )
	dh_link -p $(PKGFONTS) \
	    etc/fonts/conf.avail/65-$(PKGFONTS).conf \
	    etc/fonts/conf.d/65-$(PKGFONTS).conf

	dh_installdocs debian/VERSIONS
	dh_installchangelogs
	dh_lintian
	dh_compress -X.pdf
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:
# We have nothing to do here but the Debian Policy says this target must
# exist.

binary: binary-indep binary-arch

.PHONY: clean build build-arch build-indep binary binary-indep binary-arch