File: rules

package info (click to toggle)
lmodern 2.004.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 46,284 kB
  • sloc: sh: 204; makefile: 155
file content (249 lines) | stat: -rwxr-xr-x 10,074 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#! /usr/bin/make -f

PKG                   := lmodern
PKG_INSTALL_DIR       := debian/$(PKG)

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


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/lm/lmr10.pfb tex/latex/lm/lmodern.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 '^\./fonts/type1/public/lm/[^/]*\.pf[bm]$$' \
          -e '^\./fonts/afm/public/lm/[^/]*\.afm$$' \
          -e '^\./fonts/afm/public/lm/[^/]*\.aft$$' \
          -e '^\./fonts/tfm/public/lm/[^/]*\.tfm$$' \
	  -e '^\./fonts/map/dvips/lm/[^/]*\.map$$' \
	  -e '^\./fonts/map/dvipdfm/lm/[^/]*\.map$$' \
	  -e '^\./fonts/enc/dvips/lm/[^/]*\.enc$$' \
	  -e '^\./fonts/opentype/public/lm/[^/]*\.otf$$' \
          -e '^\./tex/latex/lm/[^/]*\.(fd|sty)$$' \
	  -e '^\./(README\.eng|README)$$' \
	  -e '^\./(lm1\.106mt1\.zip)$$' \
          -e '^\./doc/fonts/lm/[^/]*\.(tex|pdf|txt|eng|TXT)$$' || 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/lm/lm.map that should be
        # equivalent to all the encoding-specific map files in 
        # <texmf>/fonts/map/dvips/lm/ but the replacement maps for CM, CS
        # PL and VN fonts. Let's check if this is really the case.
	@export LC_COLLATE=C \
	&& a=$$(find fonts/map/dvips/lm \
              \( -name "*.map" -not -name lm.map -not -name "lm-rep-*.map" \) \
              -print0 | xargs -0r cat | grep -Ev -e '^(%|[[:space:]]*$$)' \
                      | sort) \
	&& b=$$(sort < fonts/map/dvips/lm/lm.map | grep -Ev -e \
                                                        '^(%|[[:space:]]*$$)') \
	&& if [ "$$a" != "$$b" ]; then \
             { echo; \
               echo "Warning: fonts/map/dvips/lm/lm.map does not appear to" \
                    "be equivalent to"; \
               echo "the concatenation of the other map files found in" \
                    "fonts/map/dvips/lm/."; \
               echo; \
             } >&2; \
           fi

        # 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/lm/GUST-FONT-LICENSE.TXT \
            > debian/copyright

	touch build-indep-stamp

clean:
	dh_testdir fonts/type1/public/lm/lmr10.pfb tex/latex/lm/lmodern.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.
        # debian/copyright and debian/lmodern.cfg are automatically generated
        # from the respective .in files.
	rm -f build-indep-stamp \
              "debian/$(PKG).scale.tmp" "debian/$(PKG).scale" \
              "debian/$(PKG).fontlist-x11" "debian/$(PKG).links" \
	      debian/copyright debian/lmodern.cfg
	dh_clean

binary-indep: build-indep
	dh_testdir fonts/type1/public/lm/lmr10.pfb tex/latex/lm/lmodern.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"

        # Add the set of backward compatibility links
        # This should be removed for etch+1
	cat "debian/compat.links" >> "debian/$(PKG).links"

	dh_installdirs \
          usr/share/texmf/fonts/type1/public/lm \
          usr/share/texmf/fonts/opentype/public/lm \
          usr/share/texmf/fonts/afm/public/lm \
          usr/share/texmf/fonts/tfm/public/lm \
          usr/share/texmf/fonts/enc/dvips/lm \
	  usr/share/texmf/fonts/map/dvips/lm \
          usr/share/texmf/tex/latex/lm \
          usr/share/doc/texmf/fonts/lm \
          usr/share/doc/$(PKG)/font-substitution \
          etc/X11/fonts/Type1 \
          usr/share/fonts/X11/Type1 \
          usr/share/lintian/overrides

        # Note: we won't install the PFM files because we already have the
        #       AFM files which are preferred in general.

        # Install all the PFB files in the right place for TeX and friends
	$(INSTALL_FILE) fonts/type1/public/lm/*.pfb \
          "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/type1/public/lm"

        # Install all the OpenType files in the right place for TeX and friends
	$(INSTALL_FILE) fonts/opentype/public/lm/*.otf \
          "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/opentype/public/lm"

        # Install all the AFM files in the right place for TeX and friends
	for file in fonts/afm/public/lm/*.afm; do \
          DEST_FILE="$(PKG_INSTALL_DIR)/usr/share/texmf/$$file" \
          && cp "$$file" "$$DEST_FILE" \
          && chown root:root "$$DEST_FILE" \
          && chmod 644 "$$DEST_FILE"; \
        done

        # Setup symlinks so that X can see the AFM and PFB files as well.
        # Note: we use debian/$(PKG).fontlist-x11 because we are not making
        #       each and every font file available to X (lmr10 and lmr12
        #       are very similar, for instance; including all the fonts
        #       would bring virtually nothing and would terribly clutter
        #       font selection menus and confuse users).
	sed -nf debian/sed_scripts/gen-x-fonts-links-list \
          "debian/$(PKG).fontlist-x11" >> "debian/$(PKG).links"

	$(INSTALL_FILE) "debian/$(PKG).scale" \
          "$(PKG_INSTALL_DIR)/etc/X11/fonts/Type1"
	dh_installxfonts

	$(INSTALL_FILE) fonts/tfm/public/lm/*.tfm \
          "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/tfm/public/lm"

	$(INSTALL_FILE) fonts/enc/dvips/lm/*.enc \
          "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/enc/dvips/lm"

        # Install the specific map files because the monolithic lm.map is
        # incomplete in LM 1.00.
	find fonts/map/dvips/lm \
          \( -name "*.map" -not -name lm.map -not -name "lm-rep-*.map" \) \
          -print0 | xargs -0r $(INSTALL_FILE) \
            -t "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/map/dvips/lm"

        # Declare these map files in lmodern.cfg
	{ sed -nf debian/sed_scripts/extract-start \
            "debian/lmodern.cfg.in" && \
          find fonts/map/dvips/lm \
            \( -name "*.map" -not -name lm.map -not -name "lm-rep-*.map" \) \
            -print | while read f; do echo "Map $$(basename "$$f")"; done \
                   | sort && \
          sed -nf debian/sed_scripts/extract-end \
            "debian/lmodern.cfg.in"; \
        } > "debian/lmodern.cfg"

        # Also install the map files for replacement fonts for CS, CM, PL and
        # VN.
	$(INSTALL_FILE) fonts/map/dvips/lm/lm-rep-*.map \
	  "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/map/dvips/lm"

        # install cork-lm.map which helps xdvi/dvips/etc for old dvi files
        # with old file names. This file is not disabled by default
        # in lmodern.cfg.
	$(INSTALL_FILE) debian/cork-lm.map \
	  "$(PKG_INSTALL_DIR)/usr/share/texmf/fonts/map/dvips/lm"

	for file in tex/latex/lm/*.fd tex/latex/lm/*.sty; do \
          $(INSTALL_FILE) "$$file" \
             "$(PKG_INSTALL_DIR)/usr/share/texmf/tex/latex/lm"; \
        done

	for file in doc/fonts/lm/*; do \
          $(INSTALL_FILE) "$$file" \
            "$(PKG_INSTALL_DIR)/usr/share/doc/texmf/fonts/lm"; \
        done

        # Symlink the useful documentation files from
        # /usr/share/doc/texmf/fonts/lm/ to /usr/share/doc/lmodern/.
	{ echo "usr/share/doc/texmf/fonts/lm/README-Latin-Modern.TXT" \
               "usr/share/doc/lmodern/README"; \
          echo "usr/share/doc/texmf/fonts/lm/MANIFEST-Latin-Modern.TXT" \
               "usr/share/doc/lmodern/MANIFEST.txt"; \
          echo "usr/share/doc/texmf/fonts/lm/lm-hist.txt" \
               "usr/share/doc/lmodern/lm-hist.txt"; \
          echo "usr/share/doc/texmf/fonts/lm/lm-info.pdf" \
               "usr/share/doc/lmodern/lm-info.pdf"; \
        } >> "debian/$(PKG).links"

        # Install the standard conffile for update-updmap
	dh_installtex --priority=10 mapfile=debian/lmodern.cfg

	dh_link

	dh_installdocs debian/NEWS.Debian

	$(INSTALL_FILE) debian/font-substitution/* \
          "$(PKG_INSTALL_DIR)/usr/share/doc/$(PKG)/font-substitution"

	dh_installchangelogs

	$(INSTALL_FILE) debian/$(PKG).lintian-overrides \
          "$(PKG_INSTALL_DIR)/usr/share/lintian/overrides/$(PKG)"

	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