- fix: db1 end-of-file not detected in legacy compatible way.
[tools/librpm-tizen.git] / rpm.spec
1 %define with_python_subpackage  1 %{nil}
2 %define with_bzip2              1 %{nil}
3 %define with_apidocs            1 %{nil}
4 %define with_internal_db        1 %{nil}
5 %define strip_binaries          1
6
7 # XXX legacy requires './' payload prefix to be omitted from rpm packages.
8 %define _noPayloadPrefix        1
9
10 %define __prefix        /usr
11 %{expand:%%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)}
12
13 Summary: The Red Hat package management system.
14 Name: rpm
15 %define version 4.1
16 Version: %{version}
17 Release: 0.1
18 Group: System Environment/Base
19 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{version}.tar.gz
20 Copyright: GPL
21 Conflicts: patch < 2.5
22 %ifos linux
23 Prereq: gawk fileutils textutils mktemp
24 Requires: popt
25 %endif
26
27 %if !%{with_internal_db}
28 BuildRequires: db3-devel
29
30 # XXX glibc-2.1.92 has incompatible locale changes that affect statically
31 # XXX linked binaries like /bin/rpm.
32 %ifnarch ia64
33 Requires: glibc >= 2.1.92
34 # XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides.
35 Requires: db1 = 1.85
36 %endif
37 %endif
38
39 # XXX Red Hat 5.2 has not bzip2 or python
40 %if %{with_bzip2}
41 BuildRequires: bzip2 >= 0.9.0c-2
42 %endif
43 %if %{with_python_subpackage}
44 BuildRequires: python-devel >= 1.5.2
45 %endif
46
47 BuildRoot: %{_tmppath}/%{name}-root
48
49 %description
50 The RPM Package Manager (RPM) is a powerful command line driven
51 package management system capable of installing, uninstalling,
52 verifying, querying, and updating software packages.  Each software
53 package consists of an archive of files along with information about
54 the package like its version, a description, etc.
55
56 %package devel
57 Summary: Development files for applications which will manipulate RPM packages.
58 Group: Development/Libraries
59 Requires: rpm = %{version}, popt
60
61 %description devel
62 This package contains the RPM C library and header files.  These
63 development files will simplify the process of writing programs which
64 manipulate RPM packages and databases. These files are intended to
65 simplify the process of creating graphical package managers or any
66 other tools that need an intimate knowledge of RPM packages in order
67 to function.
68
69 This package should be installed if you want to develop programs that
70 will manipulate RPM packages and databases.
71
72 %package build
73 Summary: Scripts and executable programs used to build packages.
74 Group: Development/Tools
75 Requires: rpm = %{version}
76
77 %description build
78 This package contains scripts and executable programs that are used to
79 build packages using RPM.
80
81 %if %{with_python_subpackage}
82 %package python
83 Summary: Python bindings for apps which will manipulate RPM packages.
84 Group: Development/Libraries
85 BuildRequires: popt >= 1.5
86 Requires: rpm = %{version}
87 Requires: popt >= 1.5
88 Requires: python >= 1.5.2
89
90 %description python
91 The rpm-python package contains a module which permits applications
92 written in the Python programming language to use the interface
93 supplied by RPM (RPM Package Manager) libraries.
94
95 This package should be installed if you want to develop Python
96 programs that will manipulate RPM packages and databases.
97 %endif
98
99 %package -n popt
100 Summary: A C library for parsing command line parameters.
101 Group: Development/Libraries
102 Version: 1.7
103
104 %description -n popt
105 Popt is a C library for parsing command line parameters.  Popt was
106 heavily influenced by the getopt() and getopt_long() functions, but it
107 improves on them by allowing more powerful argument expansion.  Popt
108 can parse arbitrary argv[] style arrays and automatically set
109 variables based on command line arguments.  Popt allows command line
110 arguments to be aliased via configuration files and includes utility
111 functions for parsing arbitrary strings into argv[] arrays using
112 shell-like rules.
113
114 Install popt if you're a C programmer and you'd like to use its
115 capabilities.
116
117 %prep
118 %setup -q
119
120 %build
121 %ifos linux
122 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} --sysconfdir=/etc --localstatedir=/var --infodir='${prefix}%{__share}/info' --mandir='${prefix}%{__share}/man'
123 %else
124 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix}
125 %endif
126
127 make
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131
132 make DESTDIR="$RPM_BUILD_ROOT" install
133
134 mkdir -p $RPM_BUILD_ROOT/etc/rpm
135 cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.db1
136 %%_dbapi                1
137 E_O_F
138
139 %if %{with_apidocs}
140 gzip -9n apidocs/man/man*/* || :
141 %endif
142
143 %if %{strip_binaries}
144 { cd $RPM_BUILD_ROOT
145   strip ./bin/rpm
146   strip .%{__prefix}/bin/rpm2cpio
147 }
148 %endif
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %pre
154 if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then
155 #    echo "
156 #You have both
157 #       /var/lib/rpm/packages.rpm       db1 format installed package headers
158 #       /var/lib/rpm/Packages           db3 format installed package headers
159 #Please remove (or at least rename) one of those files, and re-install.
160 #"
161     exit 1
162 fi
163 exit 0
164
165 %post
166 %ifos linux
167 /sbin/ldconfig
168 %endif
169 if [ -f /var/lib/rpm/packages.rpm ]; then
170     : # do nothing
171 elif [ -f /var/lib/rpm/Packages ]; then
172     # undo db1 configuration
173     rm -f /etc/rpm/macros.db1
174 else
175     # initialize db3 database
176     rm -f /etc/rpm/macros.db1
177     /bin/rpm --initdb
178 fi
179
180 %ifos linux
181 %postun -p /sbin/ldconfig
182
183 %post devel -p /sbin/ldconfig
184 %postun devel -p /sbin/ldconfig
185
186 %post -n popt -p /sbin/ldconfig
187 %postun -n popt -p /sbin/ldconfig
188 %endif
189
190 %if %{with_python_subpackage}
191 %post python -p /sbin/ldconfig
192 %postun python -p /sbin/ldconfig
193 %endif
194
195 %files
196 %defattr(-,root,root)
197 %doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]*
198 /bin/rpm
199 %dir                    /etc/rpm
200 %config(missingok)      /etc/rpm/macros.db1
201 %{__prefix}/bin/rpm2cpio
202 %{__prefix}/bin/gendiff
203 %{__prefix}/bin/rpmdb
204 %{__prefix}/bin/rpm[eiukqv]
205 %{__prefix}/bin/rpmsign
206 %{__prefix}/bin/rpmquery
207 %{__prefix}/bin/rpmverify
208 %{__prefix}/lib/librpm.so.*
209 %{__prefix}/lib/librpmio.so.*
210 %{__prefix}/lib/librpmbuild.so.*
211
212 %{__prefix}/lib/rpm/config.guess
213 %{__prefix}/lib/rpm/config.sub
214 %{__prefix}/lib/rpm/convertrpmrc.sh
215 %{__prefix}/lib/rpm/macros
216 %{__prefix}/lib/rpm/mkinstalldirs
217 %{__prefix}/lib/rpm/rpmdb
218 %{__prefix}/lib/rpm/rpm[eiukqv]
219 %{__prefix}/lib/rpm/rpmpopt*
220 %{__prefix}/lib/rpm/rpmrc
221
222 %ifarch i386 i486 i586 i686
223 %{__prefix}/lib/rpm/i[3456]86*
224 %endif
225 %ifarch alpha
226 %{__prefix}/lib/rpm/alpha*
227 %endif
228 %ifarch sparc sparc64
229 %{__prefix}/lib/rpm/sparc*
230 %endif
231 %ifarch ia64
232 %{__prefix}/lib/rpm/ia64*
233 %endif
234 %ifarch powerpc ppc
235 %{__prefix}/lib/rpm/ppc*
236 %endif
237 %ifarch armv3l armv4l
238 %{__prefix}/lib/rpm/armv[34][lb]*
239 %endif
240
241 %lang(cs)       %{__prefix}/*/locale/cs/LC_MESSAGES/rpm.mo
242 %lang(da)       %{__prefix}/*/locale/da/LC_MESSAGES/rpm.mo
243 %lang(de)       %{__prefix}/*/locale/de/LC_MESSAGES/rpm.mo
244 %lang(fi)       %{__prefix}/*/locale/fi/LC_MESSAGES/rpm.mo
245 %lang(fr)       %{__prefix}/*/locale/fr/LC_MESSAGES/rpm.mo
246 %lang(is)       %{__prefix}/*/locale/is/LC_MESSAGES/rpm.mo
247 %lang(ja)       %{__prefix}/*/locale/ja/LC_MESSAGES/rpm.mo
248 %lang(no)       %{__prefix}/*/locale/no/LC_MESSAGES/rpm.mo
249 %lang(pl)       %{__prefix}/*/locale/pl/LC_MESSAGES/rpm.mo
250 %lang(pt)       %{__prefix}/*/locale/pt/LC_MESSAGES/rpm.mo
251 %lang(pt_BR)    %{__prefix}/*/locale/pt_BR/LC_MESSAGES/rpm.mo
252 %lang(ro)       %{__prefix}/*/locale/ro/LC_MESSAGES/rpm.mo
253 %lang(ru)       %{__prefix}/*/locale/ru/LC_MESSAGES/rpm.mo
254 %lang(sk)       %{__prefix}/*/locale/sk/LC_MESSAGES/rpm.mo
255 %lang(sl)       %{__prefix}/*/locale/sl/LC_MESSAGES/rpm.mo
256 %lang(sr)       %{__prefix}/*/locale/sr/LC_MESSAGES/rpm.mo
257 %lang(sv)       %{__prefix}/*/locale/sv/LC_MESSAGES/rpm.mo
258 %lang(tr)       %{__prefix}/*/locale/tr/LC_MESSAGES/rpm.mo
259
260 %{__prefix}%{__share}/man/man[18]/*.[18]*
261 %lang(pl) %{__prefix}%{__share}/man/pl/man[18]/*.[18]*
262 %lang(ru) %{__prefix}%{__share}/man/ru/man[18]/*.[18]*
263 %lang(sk) %{__prefix}%{__share}/man/sk/man[18]/*.[18]*
264
265 %files build
266 %defattr(-,root,root)
267 %dir %{__prefix}/src/redhat
268 %dir %{__prefix}/src/redhat/BUILD
269 %dir %{__prefix}/src/redhat/SPECS
270 %dir %{__prefix}/src/redhat/SOURCES
271 %dir %{__prefix}/src/redhat/SRPMS
272 %dir %{__prefix}/src/redhat/RPMS
273 %{__prefix}/src/redhat/RPMS/*
274 %{__prefix}/bin/rpmbuild
275 %{__prefix}/lib/rpm/brp-*
276 %{__prefix}/lib/rpm/check-prereqs
277 %{__prefix}/lib/rpm/cpanflute
278 %{__prefix}/lib/rpm/find-lang.sh
279 %{__prefix}/lib/rpm/find-prov.pl
280 %{__prefix}/lib/rpm/find-provides
281 %{__prefix}/lib/rpm/find-provides.perl
282 %{__prefix}/lib/rpm/find-req.pl
283 %{__prefix}/lib/rpm/find-requires
284 %{__prefix}/lib/rpm/find-requires.perl
285 %{__prefix}/lib/rpm/get_magic.pl
286 %{__prefix}/lib/rpm/getpo.sh
287 %{__prefix}/lib/rpm/http.req
288 %{__prefix}/lib/rpm/javadeps
289 %{__prefix}/lib/rpm/magic.prov
290 %{__prefix}/lib/rpm/magic.req
291 %{__prefix}/lib/rpm/perl.prov
292 %{__prefix}/lib/rpm/perl.req
293 %{__prefix}/lib/rpm/rpm[bt]
294 %{__prefix}/lib/rpm/rpmdiff
295 %{__prefix}/lib/rpm/rpmdiff.cgi
296 %{__prefix}/lib/rpm/u_pkg.sh
297 %{__prefix}/lib/rpm/vpkg-provides.sh
298 %{__prefix}/lib/rpm/vpkg-provides2.sh
299
300 %if %{with_python_subpackage}
301 %files python
302 %defattr(-,root,root)
303 %{__prefix}/lib/python1.5/site-packages/rpmmodule.so
304 %endif
305
306 %files devel
307 %defattr(-,root,root)
308 %if %{with_apidocs}
309 %doc apidocs
310 %endif
311 %{__prefix}/include/rpm
312 %{__prefix}/lib/librpm.a
313 %{__prefix}/lib/librpm.la
314 %{__prefix}/lib/librpm.so
315 %{__prefix}/lib/librpmio.a
316 %{__prefix}/lib/librpmio.la
317 %{__prefix}/lib/librpmio.so
318 %{__prefix}/lib/librpmbuild.a
319 %{__prefix}/lib/librpmbuild.la
320 %{__prefix}/lib/librpmbuild.so
321
322 %files -n popt
323 %defattr(-,root,root)
324 %{__prefix}/lib/libpopt.so.*
325 %{__prefix}%{__share}/man/man3/popt.3*
326 %lang(cs)       %{__prefix}/*/locale/cs/LC_MESSAGES/popt.mo
327 %lang(da)       %{__prefix}/*/locale/da/LC_MESSAGES/popt.mo
328 %lang(gl)       %{__prefix}/*/locale/gl/LC_MESSAGES/popt.mo
329 %lang(hu)       %{__prefix}/*/locale/hu/LC_MESSAGES/popt.mo
330 %lang(is)       %{__prefix}/*/locale/is/LC_MESSAGES/popt.mo
331 %lang(no)       %{__prefix}/*/locale/no/LC_MESSAGES/popt.mo
332 %lang(pt)       %{__prefix}/*/locale/pt/LC_MESSAGES/popt.mo
333 %lang(ro)       %{__prefix}/*/locale/ro/LC_MESSAGES/popt.mo
334 %lang(ru)       %{__prefix}/*/locale/ru/LC_MESSAGES/popt.mo
335 %lang(sk)       %{__prefix}/*/locale/sk/LC_MESSAGES/popt.mo
336 %lang(sl)       %{__prefix}/*/locale/sl/LC_MESSAGES/popt.mo
337 %lang(sv)       %{__prefix}/*/locale/sv/LC_MESSAGES/popt.mo
338 %lang(tr)       %{__prefix}/*/locale/tr/LC_MESSAGES/popt.mo
339 %lang(uk)       %{__prefix}/*/locale/uk/LC_MESSAGES/popt.mo
340 %lang(wa)       %{__prefix}/*/locale/wa/LC_MESSAGES/popt.mo
341 %lang(zh_CN)    %{__prefix}/*/locale/zh_CN.GB2312/LC_MESSAGES/popt.mo
342
343 # XXX These may end up in popt-devel but it hardly seems worth the effort now.
344 %{__prefix}/lib/libpopt.a
345 %{__prefix}/lib/libpopt.la
346 %{__prefix}/lib/libpopt.so
347 %{__prefix}/include/popt.h
348
349 %changelog
350 * Mon Feb 19 2001 Jeff Johnson <jbj@redhat.com>
351 - start rpm-4.0.3 with --repackage.