Initial commit
[profile/ivi/fontpackages.git] / spec-templates / spectemplate-fonts-multi.spec
1 %global fontname <FONTNAME>
2 %global fontconf <①>-%{fontname}
3
4 #global archivename %{name}-%{version} ②
5
6 %global common_desc \
7 <FONT COLLECTION DESCRIPTION: ③>
8
9
10 Name:           %{fontname}-fonts
11 Version:        <④>
12 Release:        1%{?dist}
13 Summary:        
14
15 Group:          User Interface/X
16 License:        
17 URL:            
18 Source0:        
19 Source1:        %{name}-fontconfig.conf
20
21 BuildArch:      noarch
22 BuildRequires:  fontpackages-devel
23
24 %description
25 %common_desc
26
27
28 %package common
29 Summary:        Common files of <NAME>
30 Requires:       fontpackages-filesystem
31
32 %description common
33 %common_desc
34
35 This package consists of files used by other %{name} packages.
36
37 # Repeat for every font family ➅
38 %package -n %{fontname}-<FAMILY>-fonts
39 Summary:        
40 Requires:       %{name}-common = %{version}-%{release}
41
42 %description -n %{fontname}-<FAMILY>-fonts
43 %common_desc
44
45 <FAMILY DESCRIPTION>
46
47 %_font_pkg -n <FAMILY> -f %{fontconf}-<FAMILY>.conf <NAME>*.ttf
48
49
50 %prep
51 %setup -q
52
53
54 %build
55
56
57 %install
58 rm -fr %{buildroot}
59
60 install -m 0755 -d %{buildroot}%{_fontdir}
61 install -m 0644 -p *.ttf %{buildroot}%{_fontdir}
62
63 install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
64                    %{buildroot}%{_fontconfig_confdir}
65
66 # Repeat for every font family
67 install -m 0644 -p %{SOURCEX} \
68         %{buildroot}%{_fontconfig_templatedir}/%{fontconf}-<FAMILYX>.conf
69
70 for fconf in %{fontconf}-<FAMILYX>.conf \
71              %{fontconf}-<FAMILYY>.conf \
72              %{fontconf}-<FAMILYZ>.conf ; do
73   ln -s %{_fontconfig_templatedir}/$fconf \
74         %{buildroot}%{_fontconfig_confdir}/$fconf
75 done
76
77
78 %clean
79 rm -fr %{buildroot}
80
81
82 %files common
83 %defattr(0644,root,root,0755)
84 %doc 
85
86
87 %changelog
88
89
90 # Documentation
91 # (remove it from your final spec file, with the other comments)
92 #
93 #
94 # This template can be used with complex multi-font releases
95 # (several font families ⑤ in one upstream archive):
96 # — if you intend to package a single font family, use
97 #   spectemplate-fonts-simple.spec
98 # – if upstream releases separate fonts in separate archives, do not try to
99 #   stuff them in a single srpm, just package them separately.
100 #
101 # <FOO> placeholders must be replaced by something appropriate for your font.
102 #
103 #
104 # ①
105 # Two-digit fontconfig priority number, see:
106 # /usr/share/fontconfig/templates/fontconfig-priorities.txt
107 #
108 # ②
109 # Optional
110 #
111 # ③
112 # This will be reused in every sub-package description.
113 # Please do not forget to complete it with subpackage-specific information.
114 #
115 # ④
116 # Do not trust font metadata versionning unless you've checked upstream does
117 # update versions on file changes. When in doubt use the timestamp of the most
118 # recent file as version. “1.0” versions especially are suspicious.
119 #
120 # ⑤
121 # — A font family corresponds to one entry in GUI font lists. For example,
122 #   DejaVu Sans, DejaVu Serif and DejaVu Sans Mono are three different font
123 #   families.
124 # — A font family is subdivided in faces or styles. DejaVu Sans Normal, DejaVu
125 #   Sans Bold, DejaVu Sans Condensed Italic are three faces of the DejaVu Sans
126 #   font family.
127 # — A font-metadata aware tool such as gnome-font-viewer or fontforge can be
128 #   used to check the font family name and the font face/style declared by a
129 #   font file.
130 # — For use in spec files, convert names to lowerscript and replace spaces
131 #   with “-”