]> Pileus Git - ~andy/sunrise/blob - media-fonts/openfontlibrary/openfontlibrary-20110916.ebuild
media-fonts/openfontlibrary: Fix whitespace.
[~andy/sunrise] / media-fonts / openfontlibrary / openfontlibrary-20110916.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6
7 inherit eutils font
8
9 # Structure of this variable:
10 # - in each line, encode one font from OpenFontLibrary
11 # - fields are separated by |
12 # - fields are as follows:
13 #   - use flagg (see IUSE below)
14 #   - download url (from OpenFontLibrary's page for font)
15 #   - pattern which files to be installed
16 #     (.otf files are preferred over .ttf)
17 #   - license (Open Font License in most cases,
18 #     see OpenFontLibrary's page for font)
19 FONTLIST="handwriting|http://openfontlibrary.org/assets/downloads/graziano/493b3e1535054a8f076d02ba9f945ad1/graziano.zip|Graziano.ttf|OFL
20         handwriting|http://openfontlibrary.org/assets/downloads/intuitive/71763f72bef454e1fc6ac6ddc2fd8e7f/intuitive.zip|intuitive.ttf|OFL
21         sansserif|http://openfontlibrary.org/assets/downloads/douar-outline/08717079a1f176808971879f24d44f39/douar-outline.zip|DouarOutline.ttf|OFL
22         sansserif|http://openfontlibrary.org/assets/downloads/junction/f99fa7793abd572cc4e202f8cafa1a28/junction.zip|junction_OFL/Junction*.otf|OFL
23         sansserif|http://openfontlibrary.org/assets/downloads/alfphabet/55201027210b27c9c647eb66918f3abe/alfphabet.zip|OSP_Alfphabet/Alfphabet-IV.ttf|OFL
24         sansserif|http://openfontlibrary.org/assets/downloads/osp-din/fa3d08bd4b819d71da421ae73c1bd1d1/osp-din.zip|OSP-foundry_DIN/OSP-DIN.ttf|OFL
25         sansserif|http://openfontlibrary.org/assets/downloads/freeuniversal/5077bdf47767ac210dd15ea83870df66/freeuniversal.zip|FreeUniversal-*.ttf|OFL
26         sansserif|http://openfontlibrary.org/assets/downloads/vds/e04696b834661151239f2123b9ca9ef9/vds.zip|TTF/VDS*.ttf|OFL
27         sansserif|http://openfontlibrary.org/assets/downloads/pfennig/bfe495172cefc2388a81ee630281d8e5/pfennig.zip|Pfennig*.ttf|OFL
28         sansserif|http://openfontlibrary.org/assets/downloads/jura/514421954ac740cb72effbd2aa7c477e/jura.zip|Jura-*.ttf|OFL
29         sansserif|http://openfontlibrary.org/assets/downloads/didact-gothic/e12a3678deb5791ac79cf0e3f0569663/didact-gothic.zip|DidactGothic.ttf|OFL
30         sansserif|http://openfontlibrary.org/assets/downloads/sansus-webissimo/9e7ef959f7aeef22383039a04e56def9/sansus-webissimo.zip|Sansus*.otf|CCPL-Attribution-3.0
31         sansserif|http://openfontlibrary.org/assets/downloads/designosaur/20b76920b181bc400c45166473687ed6/designosaur.zip|OT-ps/Designosaur-*.otf|CCPL-Attribution-3.0
32         sansserif|http://openfontlibrary.org/assets/downloads/klaudia-and-berenika/0a3b87bd1a161792058e644854ee7b9b/klaudia-and-berenika.zip|Klaudia*/*/*.ttf|OFL
33         monospaced|http://openfontlibrary.org/assets/downloads/notcouriersans/283f31e5facea102ba05ffe4d60b340f/notcouriersans.zip|OSP_NotCourierSans/NotCourierSans*.otf|OFL
34         serif|http://openfontlibrary.org/assets/downloads/squareantiqua/9e7334002d839460e2d6cb7fe9f217b0/squareantiqua.zip|*Antiqua/SquareAntiqua*.ttf|OFL
35         serif|http://openfontlibrary.org/assets/downloads/old-standard/8f7616da5d24d2c54ec2d8e734320ac1/old-standard.zip|oldstandard-2.0.2.otf/OldStandard-*.otf|OFL
36         serif|http://openfontlibrary.org/assets/downloads/open-baskerville/7d908608fdbf11a2f990dee983c3ef35/open-baskerville.zip|OpenBaskerville-*/OpenBaskerville-*.otf|OFL
37         serif|http://openfontlibrary.org/assets/downloads/libertinage/7e850a8dd5040bf3070dc8a720604844/libertinage.zip|OSP_Libertinage/Libertinage*.ttf|OFL
38         serif|http://openfontlibrary.org/assets/downloads/acknowledgement/a5294ce75f3058111216b845e2bd2a6d/acknowledgement.zip|distribution/rendered/Acknowledgement.otf|OFL
39         serif|http://openfontlibrary.org/assets/downloads/judson/51d83ce369280539578dd360d378d814/judson.zip|Judson-*.ttf|OFL
40         serif|http://openfontlibrary.org/assets/downloads/crimson/6feb6f6187adb04e0ea4a40f69101d98/crimson.zip|Crimson-*.otf|OFL"
41
42 function get_font_src_uri {
43         for line in ${FONTLIST} ; do
44                 read use url pattern license <<<${line//|/ }
45                 echo "${use}? ( ${url} )"
46         done
47 }
48
49 function get_font_license {
50         for line in ${FONTLIST} ; do
51                 read use url pattern license <<<${line//|/ }
52                 echo "${use}? ( $license )"
53         done | sort -u
54 }
55
56 function get_font_filepattern {
57         for line in ${FONTLIST} ; do
58                 read use url pattern license <<<${line//|/ }
59                 if use $use ; then echo "$pattern" ; fi
60         done
61 }
62
63 DESCRIPTION="Fonts that come with the freedom to use, study, share and remix"
64 HOMEPAGE="http://openfontlibrary.org/"
65
66 SRC_URI=$(get_font_src_uri)
67 LICENSE=$(get_font_license)
68
69 SLOT="0"
70 KEYWORDS="~x86"
71
72 IUSE="handwriting +monospaced +sansserif +serif"
73
74 S="${WORKDIR}"
75
76 src_install() {
77         # where to install font files
78         insinto /usr/share/fonts/openfontlibrary
79
80         # install all font files as listed in the pattern list
81         doins $(get_font_filepattern)
82
83         font_xfont_config
84         font_fontconfig
85 }