wok-next view ttf-dejavu/receipt @ rev 20204
libjreen: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 03 22:50:48 2017 +0100 (2017-11-03) |
parents | ca2828ae20d6 |
children | 0e7893ac206d |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="ttf-dejavu"
4 VERSION="2.37"
5 CATEGORY="fonts"
6 SHORT_DESC="DejaVu TrueType fonts"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="other"
9 WEB_SITE="https://dejavu-fonts.github.io/"
10 HOST_ARCH="i486 arm"
12 TARBALL="dejavu-fonts-ttf-$VERSION.tar.bz2"
13 WGET_URL="$SF_MIRROR/dejavu/$TARBALL"
15 BUILD_DEPENDS="shared-mime-info fontforge"
16 SPLIT="ttf-dejavu-extra"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 # Install/repack fonts
23 f=$install/usr/share/fonts/truetype/ttf-dejavu
24 mkdir -p $f
25 for font in $src/ttf/*.ttf; do
26 size1=$(ls -l $font | awk '{print $5}')
27 a="$a\n$(printf "%-32s" $(basename $font .ttf)): $size1 B -> "
28 echo "Processing $(basename $font):"
29 # About FontForge scripting and this command, see:
30 # https://fontforge.github.io/scripting-alpha.html#Generate
31 fontforge -quiet -lang=ff -c 'Open($1); Generate($2,"",0x90)' \
32 $font $f/$(basename $font)
33 size2=$(ls -l $f/$(basename $font) | awk '{print $5}')
34 a="$a$size2 B ($(( $size2 - $size1 )) B)"
35 echo
36 done
37 echo -e "\nResults:\n========\n$a"
39 # Install available configurations
41 f=$install/usr/share/fontconfig/conf.avail
42 mkdir -p $f
43 cp $src/fontconfig/*.conf $f
45 tmp=$(mktemp)
47 # Strip *.conf files
48 for i in $install/usr/share/fontconfig/conf.avail/*; do
49 # <?xml version="1.0" encoding="UTF-8"?>
50 sed -i 's| encoding="UTF-8"||' $i # remove needless encoding
51 # <!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
52 sed -i 's|\.\./||' $i # remove "../"
54 tr -d '\n' < $i | sed 's|[ \t][ \t]*| |g' | \
55 sed 's|<!--|\n&|g; s|-->|&\n|g' | sed '/<!--/d' | \
56 tr -d '\n' | sed 's|> *<|><|g' > $tmp
57 cat $tmp > $i
58 done
60 rm $tmp
62 # Use the configurations
63 f=$install/etc/fonts/conf.d
64 mkdir -p $f
65 for i in $src/fontconfig/*.conf; do
66 ln -s /usr/share/fontconfig/conf.avail/$(basename $i) $f/$(basename $i)
67 done
68 }
70 # Rules to gen a SliTaz package suitable for Tazpkg.
71 genpkg_rules()
72 {
73 case $PACKAGE in
74 ttf-dejavu)
75 copy DejaVuSans.ttf DejaVuSans-Bold.ttf DejaVuSansMono.ttf \
76 *sans.conf *mono.conf
77 TAGS="font"
78 ;;
79 ttf-dejavu-extra)
80 copy @std
81 remove_already_packed
82 CAT="fonts|extra font styles"
83 TAGS="font"
84 ;;
85 esac
86 }