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