Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 %:
3 dh $@
4
5 O=http://snapshot.debian.org/archive/debian/20110720T033111Z/pool/main/t/ttf-ancient-fonts/ttf-ancient-fonts_2.57.orig.tar.gz
6 FO=$(lastword $(subst /, ,$O))
7 DO=$(P)-obsolete.orig
8
9 P=ttf-ancient-fonts
10 V=2.60
11 U=http://users.teilar.gr/~g1951d/
12 Z=AbydosFont.zip \
13 AegeanFonts.zip \
14 Aegyptus.zip \
15 AkkadianAssyrian.zip \
16 Analecta.zip \
17 Anatolian.zip \
18 Maya.zip \
19 Musica.zip \
20 Symbola.zip \
21 TextfontsFonts.zip \
22 Unidings.zip \
23
24 DN=$(P)-$(V).orig
25
26 override_dh_install:
27 dh_install -pfonts-ancient-scripts -XSymbola
28 dh_install --remaining-packages
29
30 get-orig-source:
31 wget -c $(O) -O $(FO)
32 mkdir -p $(DO)
33 tar zxf $(FO) -C $(DO) --strip-components=1
34 rm -f $(FO)
35 ls $(DO) | grep -o '^[A-Z][a-z]*' | uniq > $(DO)/list
36 for f in $(Z) ; do \
37 wget -c -O $$f $(U)$$f ; \
38 # Some files are duplicated so we need -o \
39 unzip -o -d $(DN) $$f ; \
40 rm -f $$f ; \
41 done
42 # We prefer UTF-8 LF text files, convert them using iconv, tr
43 find $(DN) -iname '*.txt' -print0 | xargs -0 -I_ sh -c "iconv -f UTF-16 -t UTF-8 _ | tr -d '\r' > _.tmp && mv _.tmp _"
44 # PDFs are produced using Microsoft Word and no
45 # Word files (source code) are published for them
46 # so we have to remove them as per DFSG item 2.
47 rm -f $(DN)/*.pdf $(DN)/*.doc* $(DN)/*.xls*
48 ls $(DN) | grep -o '^[A-Z][a-z]*' | uniq > $(DN)/list
49 diff=$$(cat $(DO)/list $(DN)/list | sort | uniq -u) ; \
50 for f in $$diff ; do \
51 for j in $(DO)/$$f*; do \
52 [ -e $$j ] && cp $$j $(DN) ; \
53 done || true ; \
54 done
55 rm -f $(DO)/list $(DN)/list
56 tar Jcf $(P)_$(V).orig.tar.xz $(P)-$(V).orig
57 rm -rf $(DO) $(DN)
58
59 .PHONY: override_dh_install get-orig-source