]> git.pld-linux.org Git - packages/fonts-TTF-microsoft-tahoma.git/blob - fonts-TTF-microsoft-tahoma.spec
- R: cabextract
[packages/fonts-TTF-microsoft-tahoma.git] / fonts-TTF-microsoft-tahoma.spec
1 #
2 # Conditional build:
3 %bcond_with     license_agreement
4 # _with_license_agreement       - generates package (may require Windows license?)
5 #
6 Summary:        Microsoft Tahoma True Type font
7 Summary(pl):    Font True Type Tahoma firmy Microsoft
8 %define         base_name               fonts-TTF-microsoft-tahoma
9 %if %{with license_agreement}
10 Name:           %{base_name}
11 %else
12 Name:           %{base_name}-installer
13 %endif
14 Version:        20020525
15 Release:        1%{?with_license_agreement:wla}
16 # part of IE update - may require Windows license to use
17 License:        ?
18 Group:          Fonts
19 %if %{with license_agreement}
20 # also at http://dl.sourceforge.net/corefonts/
21 Source0:        http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/EN-US/IELPKTH.CAB
22 # NoSource0-md5: 358584cddb75ac90472c25f01b308ebe
23 BuildRequires:  cabextract
24 Requires:       %{_fontsdir}/TTF
25 Requires(post,postun):  fontpostinst
26 %else
27 Requires:       cabextract
28 Requires:       rpm-build-tools
29 Requires:       wget
30 %endif
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         ttffontsdir     %{_fontsdir}/TTF
35
36 %description
37 Microsoft Tahoma True Type font.
38 %if ! %{with license_agreement}
39 License issues made us not to include inherent files into this package
40 by default (it probably requires Windows license). If you want to
41 create full working package please build it with one of the following
42 command:
43
44 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
45 %{base_name}.install --with license_agreement ftp://ftp.pld-linux.org/dists/ac/PLD/<your_arch>/PLD/RPMS/%{base_name}-{version}-{release}.src.rpm
46 %endif
47
48 %description -l pl
49 Font True Type Tahoma firmy Microsoft.
50 %if ! %{with license_agreement}
51 Kwestie licencji zmusi³y nas do niedo³±czania do tego pakietu istotnych
52 plików (prawdopodobnie wymaga licencji na Windows). Je¶li chcesz stworzyæ
53 w pe³ni funkcjonalny pakiet, zbuduj go za pomoc± polecenia:
54
55 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
56 %{base_name}.install --with license_agreement ftp://ftp.pld-linux.org/dists/ac/PLD/<your_arch>/PLD/RPMS/%{base_name}-{version}-{release}.src.rpm
57 %endif
58
59 %prep
60 %if %{with license_agreement}
61 %setup -q -c -T
62 /usr/bin/cabextract -L %{SOURCE0}
63 %endif
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 %if ! %{with license_agreement}
68 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
69
70 cat <<EOF >$RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
71 #!/bin/sh
72 if [ "\$1" = "--with" -a "\$2" = "license_agreement" ]
73 then
74         TMPDIR=\`rpm --eval "%%{tmpdir}"\`; export TMPDIR
75         SPECDIR=\`rpm --eval "%%{_specdir}"\`; export SPECDIR
76         SRPMDIR=\`rpm --eval "%%{_srcrpmdir}"\`; export SRPMDIR
77         SOURCEDIR=\`rpm --eval "%%{_sourcedir}"\`; export SOURCEDIR
78         BUILDDIR=\`rpm --eval "%%{_builddir}"\`; export BUILDDIR
79         RPMDIR=\`rpm --eval "%%{_rpmdir}"\`; export RPMDIR
80         BACKUP_SPEC=0
81         mkdir -p \$TMPDIR \$SPECDIR \$SRPMDIR \$RPMDIR \$SRPMDIR \$SOURCEDIR \$BUILDDIR
82         if [ -f \$SPECDIR/%{base_name}.spec ]; then
83                 BACKUP_SPEC=1
84                 mv -f \$SPECDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec.prev
85         fi
86         if echo "\$3" | grep '\.src\.rpm$' >/dev/null; then
87                 ( cd \$SRPMDIR
88                 if echo "\$3" | grep '://' >/dev/null; then
89                         wget --passive-ftp -t0 "\$3"
90                 else
91                         cp -f "\$3" .
92                 fi
93                 rpm2cpio \`basename "\$3"\` | ( cd \$TMPDIR; cpio -i %{base_name}.spec ) )
94                 if ! cp -i \$TMPDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec; then
95                         exit 1
96                 fi
97         else
98                 if ! cp -i "\$3" \$SPECDIR; then
99                         exit 1
100                 fi
101         fi
102         ( cd \$SPECDIR
103         %{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
104         if [ "\$?" -ne 0 ]; then
105                 exit 2
106         fi
107         RPMNAME=%{base_name}-%{version}-%{release}wla.noarch.rpm
108         rpm -U \$RPMDIR/\$RPMNAME || \
109                 echo -e Install manually the file:\\\n   \$RPMDIR/\$RPMNAME )
110         if [ "\$BACKUP_SPEC" -eq 1 ]; then
111                 mv -f \$SPECDIR/%{base_name}.spec.prev \$SPECDIR/%{base_name}.spec
112         fi
113 else
114         cat %{_datadir}/%{base_name}/Microsot-EULA.txt
115         echo "
116 License issues made us not to include inherent files into this package
117 by default (it probably requires Windows license). If you want to
118 create full working package please build it with the following command:
119
120 \$0 --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
121 "
122 fi
123 EOF
124
125 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
126
127 %else
128 install -d $RPM_BUILD_ROOT%{ttffontsdir}
129 install *.ttf $RPM_BUILD_ROOT%{ttffontsdir}
130 %endif
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %if %{with license_agreement}
136 %post
137 fontpostinst TTF
138
139 %postun
140 fontpostinst TTF
141
142 %else
143 %pre
144 echo "
145 License issues made us not to include inherent files into this package
146 by default (it probably requires Windows license). If you want to
147 create full working package please build it with the following command:
148
149 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
150 "
151 %endif
152
153 %files
154 %defattr(644,root,root,755)
155 %if %{with license_agreement}
156 %{ttffontsdir}/*
157 %else
158 %attr(755,root,root) %{_bindir}/%{base_name}.install
159 %{_datadir}/%{base_name}
160 %endif
This page took 0.069156 seconds and 4 git commands to generate.