]> git.pld-linux.org Git - packages/fonts-TTF-microsoft.git/blob - fonts-TTF-microsoft.spec
- use without macro
[packages/fonts-TTF-microsoft.git] / fonts-TTF-microsoft.spec
1 #
2 # Conditional build:
3 %bcond_with     license_agreement       # generates package
4 #
5 Summary:        Microsoft True Type fonts
6 Summary(pl):    Fonty True Type firmy Microsoft
7 %define         base_name       fonts-TTF-microsoft
8 %if %{with license_agreement}
9 Name:           %{base_name}
10 %else
11 Name:           %{base_name}-installer
12 %endif
13 Version:        20020525
14 Release:        5%{?with_license_agreement:wla}
15 License:        Microsoft EULA (for non-commercial use)
16 Group:          Fonts
17 %if %{with license_agreement}
18 Source0:        http://dl.sourceforge.net/corefonts/andale32.exe
19 # NoSource0-md5:        cbdc2fdd7d2ed0832795e86a8b9ee19a
20 Source1:        http://dl.sourceforge.net/corefonts/arial32.exe
21 # NoSource1-md5:        9637df0e91703179f0723ec095a36cb5
22 Source2:        http://dl.sourceforge.net/corefonts/arialb32.exe
23 # NoSource2-md5:        c9089ae0c3b3d0d8c4b0a95979bb9ff0
24 Source3:        http://dl.sourceforge.net/corefonts/comic32.exe
25 # NoSource3-md5:        2b30de40bb5e803a0452c7715fc835d1
26 Source4:        http://dl.sourceforge.net/corefonts/courie32.exe
27 # NoSource4-md5:        4e412c772294403ab62fb2d247d85c60
28 Source5:        http://dl.sourceforge.net/corefonts/georgi32.exe
29 # NoSource5-md5:        4d90016026e2da447593b41a8d8fa8bd
30 Source6:        http://dl.sourceforge.net/corefonts/impact32.exe
31 # NoSource6-md5:        7907c7dd6684e9bade91cff82683d9d7
32 Source7:        http://dl.sourceforge.net/corefonts/times32.exe
33 # NoSource7-md5:        ed39c8ef91b9fb80f76f702568291bd5
34 Source8:        http://dl.sourceforge.net/corefonts/trebuc32.exe
35 # NoSource8-md5:        0d7ea16cac6261f8513a061fbfcdb2b5
36 Source9:        http://dl.sourceforge.net/corefonts/verdan32.exe
37 # NoSource9-md5:        12d2a75f8156e10607be1eaa8e8ef120
38 Source10:       http://dl.sourceforge.net/corefonts/webdin32.exe
39 # NoSource10-md5:       230a1d13a365b22815f502eb24d9149b
40 %else
41 # extracted from one of the above
42 Source20:       Microsoft-EULA.txt
43 %endif
44 URL:            http://corefonts.sourceforge.net/
45 %if %{with license_agreement}
46 BuildRequires:  cabextract
47 Requires:       %{_fontsdir}/TTF
48 Requires(post,postun):  fontpostinst
49 %else
50 Requires:       cabextract
51 Requires:       rpm-build-tools
52 Requires:       wget
53 %endif
54 BuildArch:      noarch
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %define         ttffontsdir     %{_fontsdir}/TTF
58
59 %description
60 Microsoft free True Type fonts collection.
61 %if %{without license_agreement}
62 License issues made us not to include inherent files into this package
63 by default. If you want to create full working package please build it
64 with one of the following command:
65
66 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
67 %{base_name}.install --with license_agreement ftp://ftp.pld-linux.org/dists/ac/PLD/<your_arch>/PLD/RPMS/%{base_name}-{version}-{release}.src.rpm
68 %endif
69
70 %description -l pl
71 Kolekcja darmowych fontów True Type firmy Microsoft.
72 %if %{without license_agreement}
73 Kwestie licencji zmusi³y nas do niedo³±czania do tego pakietu istotnych
74 plików. Je¶li chcesz stworzyæ w pe³ni funkcjonalny pakiet, zbuduj go za
75 pomoc± polecenia:
76
77 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
78 %{base_name}.install --with license_agreement ftp://ftp.pld-linux.org/dists/ac/PLD/<your_arch>/PLD/RPMS/%{base_name}-{version}-{release}.src.rpm
79 %endif
80
81 %prep
82 %if %{with license_agreement}
83 %setup -q -c -T
84 /usr/bin/cabextract -L %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \
85 %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} \
86 %{SOURCE10}
87 %endif
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91
92 %if %{without license_agreement}
93 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
94
95 cat <<EOF >$RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
96 #!/bin/sh
97 if [ "\$1" = "--with" -a "\$2" = "license_agreement" ]
98 then
99         TMPDIR=\`rpm --eval "%%{tmpdir}"\`; export TMPDIR
100         SPECDIR=\`rpm --eval "%%{_specdir}"\`; export SPECDIR
101         SRPMDIR=\`rpm --eval "%%{_srcrpmdir}"\`; export SRPMDIR
102         SOURCEDIR=\`rpm --eval "%%{_sourcedir}"\`; export SOURCEDIR
103         BUILDDIR=\`rpm --eval "%%{_builddir}"\`; export BUILDDIR
104         RPMDIR=\`rpm --eval "%%{_rpmdir}"\`; export RPMDIR
105         BACKUP_SPEC=0
106         mkdir -p \$TMPDIR \$SPECDIR \$SRPMDIR \$RPMDIR \$SRPMDIR \$SOURCEDIR \$BUILDDIR
107         if [ -f \$SPECDIR/%{base_name}.spec ]; then
108                 BACKUP_SPEC=1
109                 mv -f \$SPECDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec.prev
110         fi
111         if echo "\$3" | grep '\.src\.rpm$' >/dev/null; then
112                 ( cd \$SRPMDIR
113                 if echo "\$3" | grep '://' >/dev/null; then
114                         wget --passive-ftp -t0 "\$3"
115                 else
116                         cp -f "\$3" .
117                 fi
118                 rpm2cpio \`basename "\$3"\` | ( cd \$TMPDIR; cpio -i %{base_name}.spec ) )
119                 if ! cp -i \$TMPDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec; then
120                         exit 1
121                 fi
122         else
123                 if ! cp -i "\$3" \$SPECDIR; then
124                         exit 1
125                 fi
126         fi
127         ( cd \$SPECDIR
128         %{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
129         if [ "\$?" -ne 0 ]; then
130                 exit 2
131         fi
132         RPMNAME=%{base_name}-%{version}-%{release}wla.noarch.rpm
133         rpm -U \$RPMDIR/\$RPMNAME || \
134                 echo -e Install manually the file:\\\n   \$RPMDIR/\$RPMNAME )
135         if [ "\$BACKUP_SPEC" -eq 1 ]; then
136                 mv -f \$SPECDIR/%{base_name}.spec.prev \$SPECDIR/%{base_name}.spec
137         fi
138 else
139         cat %{_datadir}/%{base_name}/Microsot-EULA.txt
140         echo "
141 If you accept the above license rebuild the package using:
142
143 \$0 --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
144 "
145 fi
146 EOF
147
148 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
149 install %{SOURCE20} $RPM_BUILD_ROOT%{_datadir}/%{base_name}
150
151 %else
152 install -d $RPM_BUILD_ROOT%{ttffontsdir}
153 install *.ttf $RPM_BUILD_ROOT%{ttffontsdir}
154 %endif
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %if %{with license_agreement}
160 %post
161 fontpostinst TTF
162
163 %postun
164 fontpostinst TTF
165
166 %else
167 %pre
168 echo "
169 If you accept the license enclosed in the file
170 %{_datadir}/%{base_name}/Microsoft-EULA.txt
171 and want to install real fonts, then rebuild the package with the
172 following command:
173
174 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
175 "
176 %endif
177
178 %files
179 %defattr(644,root,root,755)
180 %if %{with license_agreement}
181 %doc licen.txt
182 %{ttffontsdir}/*
183 %else
184 %attr(755,root,root) %{_bindir}/%{base_name}.install
185 %{_datadir}/%{base_name}
186 %endif
This page took 0.062487 seconds and 3 git commands to generate.