1 |
# Do not change this spec directly but in the svn |
2 |
# $Id: rpm.spec 134789 2007-03-27 15:13:43Z nanardon $ |
3 |
|
4 |
%define lib64arches x86_64 ppc64 sparc64 |
5 |
|
6 |
%ifarch %lib64arches |
7 |
%define _lib lib64 |
8 |
%else |
9 |
%define _lib lib |
10 |
%endif |
11 |
|
12 |
%define _prefix /usr |
13 |
%define _libdir %_prefix/%_lib |
14 |
%define _bindir %_prefix/bin |
15 |
%define _sysconfdir /etc |
16 |
%define _datadir /usr/share |
17 |
%define _defaultdocdir %_datadir/doc |
18 |
%define _localstatedir /var |
19 |
%define _infodir %_datadir/info |
20 |
|
21 |
%if %{?apply_patches:0}%{?!apply_patches:1} |
22 |
%define apply_patches %(for p in `grep '^Patch.*:' "%{_specdir}/rpm.spec" | cut -d':' -f2-`; do echo "patch -p1 -F0 -i %{_sourcedir}/$p"; done ) |
23 |
%endif |
24 |
|
25 |
# Define directory which holds rpm config files, and some binaries actually |
26 |
# NOTE: it remains */lib even on lib64 platforms as only one version |
27 |
# of rpm is supported anyway, per architecture |
28 |
%define rpmdir %{_prefix}/lib/rpm |
29 |
|
30 |
%if %{?mklibname:0}%{?!mklibname:1} |
31 |
%define mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel} |
32 |
%endif |
33 |
|
34 |
%if %{?distsuffix:0}%{?!distsuffix:1} |
35 |
%define distsuffix .mga |
36 |
%endif |
37 |
|
38 |
%if %{?mkrel:0}%{?!mkrel:1} |
39 |
%define mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?mageia_release:%mageia_release}%{?subrel:.%subrel} |
40 |
%endif |
41 |
|
42 |
%if %{?mips:0}%{?!mips:1} |
43 |
%define mips mips mipsel mips32 mips32el mips64 mips64el |
44 |
%endif |
45 |
|
46 |
%if %{?pyver:0}%{?!pyver:1} |
47 |
%define pyver %(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".") |
48 |
%endif |
49 |
|
50 |
%define __find_requires %{rpmdir}/mageia/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}} |
51 |
%define __find_provides %{rpmdir}/mageia/find-provides |
52 |
|
53 |
%define rpmversion 4.6.1 |
54 |
%define srcver %rpmversion |
55 |
%define libver 4.6 |
56 |
%define release %mkrel 6 |
57 |
%define librpmname %mklibname rpm %{libver} |
58 |
%define librpmnamedevel %mklibname -d rpm |
59 |
|
60 |
%define buildpython 1 |
61 |
|
62 |
%define rpmsetup_version 1.34 |
63 |
|
64 |
%define builddebug 0 |
65 |
%{?_with_debug:%define builddebug 1} |
66 |
|
67 |
%{?_with_python:%define buildpython 1} |
68 |
%{?_without_python:%define buildpython 0} |
69 |
|
70 |
Summary: The RPM package management system |
71 |
Name: rpm |
72 |
Epoch: 1 |
73 |
Version: %{rpmversion} |
74 |
Release: %{release} |
75 |
Group: System/Configuration/Packaging |
76 |
|
77 |
Source: http://www.rpm.org/releases/rpm-%{libver}.x/rpm-%{srcver}.tar.bz2 |
78 |
|
79 |
# Add some undocumented feature to gendiff |
80 |
Patch17: rpm-4.4.2.2-gendiff-improved.patch |
81 |
|
82 |
# if %post of foo-2 fails, |
83 |
# or if %preun of foo-1 fails, |
84 |
# or if %postun of foo-1 fails, |
85 |
# => foo-1 is not removed, so we end up with both packages in rpmdb |
86 |
# this patch makes rpm ignore the error in those cases |
87 |
# failing %pre must still make the rpm install fail (#23677) |
88 |
# |
89 |
# (nb: the exit code for pretrans/posttrans & trigger/triggerun/triggerpostun |
90 |
# scripts is ignored with or without this patch) |
91 |
Patch22: rpm-4.6.0-rc1-non-pre-scripts-dont-fail.patch |
92 |
|
93 |
# (fredl) add loging facilities through syslog |
94 |
Patch31: rpm-4.6.0-rc1-syslog.patch |
95 |
|
96 |
# part of Backport from 4.2.1 provides becoming obsoletes bug (fpons) |
97 |
# (is it still needed?) |
98 |
Patch49: rpm-4.6.0-rc1-provides-obsoleted.patch |
99 |
|
100 |
# - force /usr/lib/rpm/manbo/rpmrc instead of /usr/lib/rpm/<vendor>/rpmrc |
101 |
# - read /usr/lib/rpm/manbo/rpmpopt (not only /usr/lib/rpm/rpmpopt) |
102 |
Patch64: rpm-4.6.0-rc2-manbo-rpmrc-rpmpopt.patch |
103 |
|
104 |
# In original rpm, -bb --short-circuit does not work and run all stage |
105 |
# From popular request, we allow to do this |
106 |
# http://qa.mandriva.com/show_bug.cgi?id=15896 |
107 |
Patch70: rpm-4.6.0-rc1-bb-shortcircuit.patch |
108 |
|
109 |
# http://www.redhat.com/archives/rpm-list/2005-April/msg00131.html |
110 |
# http://www.redhat.com/archives/rpm-list/2005-April/msg00132.html |
111 |
# is this useful? "at least erasure ordering is just as non-existent as it was in 4.4.x" says Panu |
112 |
Patch71: rpm-4.6.0-ordererase.patch |
113 |
|
114 |
# don't conflict for doc files |
115 |
# (to be able to install lib*-devel together with lib64*-devel even if they have conflicting manpages) |
116 |
Patch83: rpm-4.6.0-no-doc-conflicts.patch |
117 |
|
118 |
# Fix http://qa.mandriva.com/show_bug.cgi?id=19392 |
119 |
# (is this working??) |
120 |
Patch84: rpm-4.4.2.2-rpmqv-ghost.patch |
121 |
|
122 |
# Fix diff issue when buildroot contains some "//" |
123 |
Patch111: rpm-check-file-trim-double-slash-in-buildroot.patch |
124 |
|
125 |
# [Dec 2008] macrofiles from rpmrc does not overrides MACROFILES anymore |
126 |
Patch114: rpm-4.6.0-rc1-read-macros_d-dot-macros.patch |
127 |
|
128 |
# remove unused skipDir functionality that conflicts with patch124 below |
129 |
Patch1124: rpm-4.6.0-rc1-revert-unused-skipDir-functionality.patch |
130 |
|
131 |
# [pixel] without this patch, "rpm -e" or "rpm -U" will need to stat(2) every dirnames of |
132 |
# files from the package (eg COPYING) in the db. This is quite costly when not in cache |
133 |
# (eg on a test here: >300 stats, and so 3 seconds after a "echo 3 > /proc/sys/vm/drop_caches") |
134 |
# this breaks urpmi test case test_rpm_i_fail('gd') in superuser--file-conflicts.t, |
135 |
# but this is bad design anyway |
136 |
Patch124: rpm-4.6.0-rc1-speedup-by-not-checking-same-files-with-different-paths-through-symlink.patch |
137 |
|
138 |
# [from SuSE] handle "Suggests" via RPMTAG_SUGGESTSNAME |
139 |
Patch133: rpm-4.6.0-rc1-weakdeps.patch |
140 |
|
141 |
# convert data in the header to a specific encoding which used in the selected locale. |
142 |
Patch137: rpm-4.6.0-rc1-headerIconv.patch |
143 |
|
144 |
Patch140: rpm-russian-translation.patch |
145 |
|
146 |
# Mandriva does not need the (broken) ldconfig hack since it uses filetriggers |
147 |
Patch141: rpm-4.6.0-rc1-drop-skipping-ldconfig-hack.patch |
148 |
|
149 |
# without this patch, "#%define foo bar" is surprisingly equivalent to "%define foo bar" |
150 |
# with this patch, "#%define foo bar" is a fatal error |
151 |
Patch145: rpm-forbid-badly-commented-define-in-spec.patch |
152 |
|
153 |
# cf http://wiki.mandriva.com/en/Rpm_filetriggers |
154 |
Patch146: rpm-4.6.0-rc1-filetriggers.patch |
155 |
|
156 |
# add two fatal errors (during package build) |
157 |
Patch147: rpm-rpmbuild-check-useless-tags-in-non-existant-binary-packages.patch |
158 |
|
159 |
# (nb: see the patch for more info about this issue) |
160 |
Patch151: rpm-4.6.0-rc1-protect-against-non-robust-futex.patch |
161 |
|
162 |
Patch152: rpm-4.6.0-rc1-fix-nss-detection.patch |
163 |
|
164 |
Patch157: introduce-_after_setup-which-is-called-after-setup.patch |
165 |
Patch158: introduce-_patch-and-allow-easy-override-when-the-p.patch |
166 |
Patch159: introduce-apply_patches-and-lua-var-patches_num.patch |
167 |
|
168 |
# fixes backported from 4.7.1, see patch files for full changelog entries |
169 |
# fixes ignored Requires(pre) and (post) when they have a plain Requires counterpart |
170 |
Patch161: rpm-fix-corequisites.patch |
171 |
Patch162: rpm-fix-islegacyprereq.patch |
172 |
# map PreReq into Requires(pre,preun) at build |
173 |
Patch163: rpm-map-prereq.patch |
174 |
|
175 |
# avoid "canonicalization unexpectedly shrank by one character" error from |
176 |
# debugedit by adding '/' to the end of the string when the error would be |
177 |
# triggered |
178 |
# see https://bugzilla.redhat.com/show_bug.cgi?id=304121 and |
179 |
# https://bugzilla.redhat.com/show_bug.cgi?id=482903 |
180 |
|
181 |
Patch164: rpm-4.6.1-updated-debugedit-for-debug_pubtypes-section.patch |
182 |
Patch165: rpm-4.6.0-fix-debugedit-canonicalization-error.patch |
183 |
|
184 |
#Patch1001: rpm-4.6.0-rc1-new-liblzma.patch |
185 |
|
186 |
# default behaviour in rpm-jbj >= 4.4.6 |
187 |
Patch1005: rpm-allow-conflicting-ghost-files.patch |
188 |
|
189 |
# (nb: see the patch for more info about this issue) |
190 |
Patch1006: rpm-4.6.0-rc1-compat-PayloadIsLzma.patch |
191 |
|
192 |
Patch1007: rpm-4.6.0-rc3-xz-support.patch |
193 |
|
194 |
# Prevents $DOCDIR from being wiped out when using %%doc <fileinbuilddir>, |
195 |
# as this breaks stuff that installs files to $DOCDIR during %%install |
196 |
Patch1008: rpm-4.6.0-rc3-no_rm_-rf_DOCDIR.patch |
197 |
|
198 |
# Exposes packagecolor tag and adds new tags from rpm5 as it otherwise will |
199 |
# break when these unknown tags might be found in the rpmdb. Notice that this |
200 |
# will only make rpm recognize these, not implement actual support for them.. |
201 |
Patch1009: rpm-4.6.0-rpm5-tags.patch |
202 |
|
203 |
# Avoid adding Lua sources/patches twice when recursing. (backport from upstream git) |
204 |
Patch1010: rpm-4.6.0-lua-add-sources-and-patches-only-once.patch |
205 |
|
206 |
# Check chroot return code before running lua script |
207 |
Patch1011: rpm-4.6.0-do-not-run-lua-scripts-when-chroot-fails.patch |
208 |
|
209 |
# Check chroot return code before running external script |
210 |
Patch1012: rpm-4.6.0-do-not-run-scripts-when-chroot-fails.patch |
211 |
|
212 |
# Make sure files in debug packages have good default perms, fixes bug #57758 |
213 |
Patch1013: rpm-4.6.0-fix-debug-info-default-permissions.patch |
214 |
|
215 |
# Remove BDB XA support to fix compilation with db 4.8 (upstream) |
216 |
Patch1014: rpm-4.6.0-bdb-xa-removal.patch |
217 |
|
218 |
# Refuse to build a rpm with 2 identical triggers (#60699) |
219 |
#Patch1015: rpm-4.6.0-duplicate-triggers.patch |
220 |
|
221 |
# fix %exclude behaviour to only exclude files from a specific package, not |
222 |
# from adding the files to list of files that's not unpackaged. |
223 |
# Reintroduces past behaviour as with rpm 4.4.8 & enforces compatibility with |
224 |
# rpm5.org |
225 |
Patch1016: rpm-4.6.0-dont-add-excluded-files-to-check_fileList.patch |
226 |
|
227 |
# make rpmvercmp handle missing values and make versioned conflicts behave |
228 |
# consistently with requires. (#55810) |
229 |
Patch1017: rpm-4.6.0-rpmvercmp-handle-missing-values.patch |
230 |
|
231 |
# Automatically handle ruby gem extraction in %setup |
232 |
PAtch1018: rpm-4.6.1-setup-rubygems.patch |
233 |
|
234 |
# Turbolinux patches |
235 |
# add writeHeaderListTofile function into rpm-python (needed by "buildman" build system) (Toshihiro, 2003) |
236 |
Patch2002: rpm-4.6.0-rc1-python-writeHdlist.patch |
237 |
# Crusoe CPUs say that their CPU family is "5" but they have enough features for i686. |
238 |
Patch2003: rpm-4.4.2.3-rc1-transmeta-crusoe-is-686.patch |
239 |
|
240 |
# The following patch isn't needed for Mandriva, but Turbolinux has it and it can't hurt much |
241 |
# |
242 |
# This patch fixes the problem when the post-scripts launched by rpm-build. |
243 |
# The post-scripts launched by rpm-build works in LANG environment. If LANG is |
244 |
# other locale except C, then some commands launched by post-scripts will not |
245 |
# display characters which you expected. |
246 |
Patch2005: rpm-4.6.0-rc1-buildlang.patch |
247 |
|
248 |
Patch3000: mips_macros.patch |
249 |
Patch3001: fix_stack_protector_check.patch |
250 |
Patch3002: rpm-4.6.1-mips_define_isa_macros.patch |
251 |
Patch3003: rpm-4.6.1-arm_mips_isa_macros.patch |
252 |
Patch3004: rpm_add_armv5tl.patch |
253 |
|
254 |
License: GPL |
255 |
BuildRequires: autoconf >= 2.57 |
256 |
BuildRequires: zlib-devel |
257 |
BuildRequires: bzip2-devel |
258 |
BuildRequires: liblzma-devel >= 4.999.6-0.alpha.5 |
259 |
BuildRequires: automake >= 1.8 |
260 |
BuildRequires: elfutils-devel |
261 |
BuildRequires: sed >= 4.0.3 |
262 |
BuildRequires: libbeecrypt-devel |
263 |
BuildRequires: ed, gettext-devel |
264 |
BuildRequires: libsqlite3-devel |
265 |
BuildRequires: db4.8-devel |
266 |
BuildRequires: neon-devel |
267 |
BuildRequires: popt-devel |
268 |
BuildRequires: nss-devel |
269 |
BuildRequires: magic-devel |
270 |
BuildRequires: rpm-mageia-setup-build %{?rpmsetup_version:>= %{rpmsetup_version}} |
271 |
BuildRequires: readline-devel |
272 |
BuildRequires: ncurses-devel |
273 |
BuildRequires: openssl-devel >= 0.9.8 |
274 |
BuildRequires: lua-devel |
275 |
# Need for doc |
276 |
#BuildRequires: graphviz |
277 |
BuildRequires: tetex |
278 |
%if %buildpython |
279 |
BuildRequires: python-devel |
280 |
%endif |
281 |
|
282 |
Requires: bzip2 >= 0.9.0c-2 |
283 |
Requires: lzma |
284 |
Requires: cpio |
285 |
Requires: gawk |
286 |
Requires: glibc >= 2.1.92 |
287 |
Requires: mktemp |
288 |
Requires: setup >= 2.2.0-8 |
289 |
Requires: rpm-mageia-setup >= 1.85 |
290 |
Requires: update-alternatives |
291 |
Requires: %librpmname = %epoch:%version-%release |
292 |
Conflicts: patch < 2.5 |
293 |
Conflicts: menu < 2.1.5-29 |
294 |
Conflicts: locales < 2.3.1.1 |
295 |
Conflicts: man-pages-fr < 0.9.7-16 |
296 |
Conflicts: man-pages-pl < 0.4-9 |
297 |
Conflicts: perl-URPM < 1.63-3 |
298 |
# rpm 4.6.0 dropped support for --repackage, so urpmi-recover can not work anymore: |
299 |
Conflicts: urpmi-recover |
300 |
URL: http://rpm.org/ |
301 |
%define git_url http://rpm.org/git/rpm.git |
302 |
Requires(pre): rpm-helper >= 0.8 |
303 |
Requires(pre): coreutils |
304 |
Requires(postun): rpm-helper >= 0.8 |
305 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
306 |
|
307 |
%description |
308 |
RPM is a powerful command line driven package management system capable of |
309 |
installing, uninstalling, verifying, querying, and updating software packages. |
310 |
Each software package consists of an archive of files along with information |
311 |
about the package like its version, a description, etc. |
312 |
|
313 |
%package -n %librpmname |
314 |
Summary: Library used by rpm |
315 |
Group: System/Libraries |
316 |
Provides: librpm = %version-%release |
317 |
|
318 |
%description -n %librpmname |
319 |
RPM is a powerful command line driven package management system capable of |
320 |
installing, uninstalling, verifying, querying, and updating software packages. |
321 |
This package contains common files to all applications based on rpm. |
322 |
|
323 |
%package -n %librpmnamedevel |
324 |
Summary: Development files for applications which will manipulate RPM packages |
325 |
Group: Development/C |
326 |
Requires: rpm = %epoch:%{version}-%{release} |
327 |
Provides: librpm-devel = %version-%release |
328 |
Provides: rpm-devel = %version-%release |
329 |
Obsoletes: rpm-devel < 4.4.1 |
330 |
Obsoletes: %{_lib}rpm4.4-devel |
331 |
Obsoletes: %{_lib}rpm4.2-devel |
332 |
|
333 |
%description -n %librpmnamedevel |
334 |
This package contains the RPM C library and header files. These |
335 |
development files will simplify the process of writing programs |
336 |
which manipulate RPM packages and databases and are intended to make |
337 |
it easier to create graphical package managers or any other tools |
338 |
that need an intimate knowledge of RPM packages in order to function. |
339 |
|
340 |
This package should be installed if you want to develop programs that |
341 |
will manipulate RPM packages and databases. |
342 |
|
343 |
%package build |
344 |
Summary: Scripts and executable programs used to build packages |
345 |
Group: System/Configuration/Packaging |
346 |
Requires: autoconf |
347 |
Requires: automake |
348 |
Requires: file |
349 |
Requires: gcc-c++ |
350 |
# We need cputoolize & amd64-* alias to x86_64-* in config.sub |
351 |
Requires: libtool-base >= 1.4.3-5 |
352 |
Requires: patch >= 2.5.9-7 |
353 |
Requires: make |
354 |
Requires: tar |
355 |
Requires: unzip |
356 |
Requires: elfutils |
357 |
Requires: rpm = %epoch:%{version}-%{release} |
358 |
Requires: rpm-mageia-setup-build %{?rpmsetup_version:>= %{rpmsetup_version}} |
359 |
|
360 |
%description build |
361 |
This package contains scripts and executable programs that are used to |
362 |
build packages using RPM. |
363 |
|
364 |
%if %buildpython |
365 |
%package -n python-rpm |
366 |
Summary: Python bindings for apps which will manipulate RPM packages |
367 |
Group: Development/Python |
368 |
Requires: python >= %{pyver} |
369 |
Requires: rpm = %epoch:%{version}-%{release} |
370 |
Obsoletes: rpm-python < %epoch:%version-%release |
371 |
Provides: rpm-python = %version-%release |
372 |
|
373 |
%description -n python-rpm |
374 |
The rpm-python package contains a module which permits applications |
375 |
written in the Python programming language to use the interface |
376 |
supplied by RPM (RPM Package Manager) libraries. |
377 |
|
378 |
This package should be installed if you want to develop Python |
379 |
programs that will manipulate RPM packages and databases. |
380 |
%endif |
381 |
|
382 |
%prep |
383 |
%setup -q -n %name-%srcver |
384 |
%apply_patches |
385 |
|
386 |
%build |
387 |
|
388 |
autoreconf |
389 |
|
390 |
%if %builddebug |
391 |
RPM_OPT_FLAGS=-g |
392 |
%endif |
393 |
CFLAGS="$RPM_OPT_FLAGS -fPIC" CXXFLAGS="$RPM_OPT_FLAGS -fPIC" \ |
394 |
%configure \ |
395 |
--enable-nls \ |
396 |
--enable-python \ |
397 |
--enable-sqlite3 \ |
398 |
--without-javaglue \ |
399 |
%if %builddebug |
400 |
--enable-debug \ |
401 |
%endif |
402 |
--with-external-db \ |
403 |
%if %buildpython |
404 |
--with-python=%{pyver} \ |
405 |
%else |
406 |
--without-python \ |
407 |
%endif |
408 |
--with-glob \ |
409 |
--without-selinux \ |
410 |
--without-apidocs |
411 |
|
412 |
%make |
413 |
|
414 |
%install |
415 |
rm -rf $RPM_BUILD_ROOT |
416 |
|
417 |
make DESTDIR=%buildroot install |
418 |
|
419 |
%ifarch ppc powerpc |
420 |
ln -sf ppc-mageia-linux $RPM_BUILD_ROOT%{rpmdir}/powerpc-mageia-linux |
421 |
%endif |
422 |
|
423 |
#mv -f $RPM_BUILD_ROOT/%{rpmdir}/rpmdiff $RPM_BUILD_ROOT/%{_bindir} |
424 |
|
425 |
# Save list of packages through cron |
426 |
mkdir -p ${RPM_BUILD_ROOT}/etc/cron.daily |
427 |
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}/etc/cron.daily/rpm |
428 |
|
429 |
mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d |
430 |
install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}/etc/logrotate.d/rpm |
431 |
|
432 |
mkdir -p $RPM_BUILD_ROOT/var/lib/rpm |
433 |
for dbi in \ |
434 |
Basenames Conflictname Dirnames Group Installtid Name Providename \ |
435 |
Provideversion Removetid Requirename Requireversion Triggername \ |
436 |
Packages __db.001 __db.002 __db.003 __db.004 |
437 |
do |
438 |
touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi |
439 |
done |
440 |
|
441 |
test -d doc-copy || mkdir doc-copy |
442 |
rm -rf doc-copy/* |
443 |
ln -f doc/manual/* doc-copy/ |
444 |
rm -f doc-copy/Makefile* |
445 |
|
446 |
mkdir -p $RPM_BUILD_ROOT/var/spool/repackage |
447 |
|
448 |
mkdir -p %buildroot%_sysconfdir/rpm/macros.d |
449 |
cat > %buildroot%_sysconfdir/rpm/macros <<EOF |
450 |
# Put your own system macros here |
451 |
# usually contains |
452 |
|
453 |
# Set this one according your locales |
454 |
# %%_install_langs |
455 |
|
456 |
EOF |
457 |
|
458 |
# Get rid of unpackaged files |
459 |
(cd $RPM_BUILD_ROOT; |
460 |
rm -rf .%{_includedir}/beecrypt/ |
461 |
rm -f .%{_libdir}/libbeecrypt.{a,la,so*} |
462 |
rm -f .%{_libdir}/python*/site-packages/rpmmodule.{a,la} |
463 |
rm -f .%{rpmdir}/{Specfile.pm,cpanflute2,cpanflute,sql.prov,sql.req,tcl.req} |
464 |
rm -f .%{rpmdir}/{config.site,cross-build,rpmdiff.cgi} |
465 |
rm -f .%{rpmdir}/trpm |
466 |
rm -f .%{_bindir}/rpmdiff |
467 |
) |
468 |
|
469 |
%{rpmdir}/%{_host_vendor}/find-lang.pl $RPM_BUILD_ROOT %{name} |
470 |
|
471 |
%clean |
472 |
rm -rf $RPM_BUILD_ROOT |
473 |
|
474 |
%pre |
475 |
if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then |
476 |
echo " |
477 |
You have both |
478 |
/var/lib/rpm/packages.rpm db1 format installed package headers |
479 |
/var/lib/rpm/Packages db3 format installed package headers |
480 |
Please remove (or at least rename) one of those files, and re-install. |
481 |
" |
482 |
exit 1 |
483 |
fi |
484 |
|
485 |
/usr/share/rpm-helper/add-user rpm $1 rpm /var/lib/rpm /bin/false |
486 |
|
487 |
rm -rf /usr/lib/rpm/*-mandrake-* |
488 |
rm -rf /usr/lib/rpm/*-mandriva-* |
489 |
|
490 |
|
491 |
%post |
492 |
# nuke __db.00? when updating to this rpm |
493 |
rm -f /var/lib/rpm/__db.00? |
494 |
|
495 |
if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f %{rpmdir}/convertrpmrc.sh ] |
496 |
then |
497 |
sh %{rpmdir}/convertrpmrc.sh 2>&1 > /dev/null |
498 |
fi |
499 |
|
500 |
if [ -f /var/lib/rpm/packages.rpm ]; then |
501 |
/bin/chown rpm.rpm /var/lib/rpm/*.rpm |
502 |
elif [ ! -f /var/lib/rpm/Packages ]; then |
503 |
/bin/rpm --initdb |
504 |
fi |
505 |
|
506 |
%postun |
507 |
/usr/share/rpm-helper/del-user rpm $1 rpm |
508 |
|
509 |
%triggerpostun -- rpm < 1:4.4.2.3-11 |
510 |
if [ -f /etc/rpm/macros.cdb.rpmsave ]; then |
511 |
echo "warning: restoring /etc/rpm/macros.cdb from macros.cdb.rpmsave, please check you really need the changes" |
512 |
mv /etc/rpm/macros.cdb.rpmsave /etc/rpm/macros.cdb |
513 |
fi |
514 |
|
515 |
%define rpmattr %attr(0755, rpm, rpm) |
516 |
|
517 |
%files -f %{name}.lang |
518 |
%defattr(-,root,root) |
519 |
%doc GROUPS CHANGES doc/manual/[a-z]* |
520 |
%attr(0755,rpm,rpm) /bin/rpm |
521 |
%attr(0755, rpm, rpm) %{_bindir}/rpm2cpio |
522 |
%attr(0755, rpm, rpm) %{_bindir}/gendiff |
523 |
%attr(0755, rpm, rpm) %{_bindir}/rpmdb |
524 |
%attr(0755, rpm, rpm) %{_bindir}/rpmgraph |
525 |
%attr(0755, rpm, rpm) %{_bindir}/rpmsign |
526 |
%attr(0755, rpm, rpm) %{_bindir}/rpmquery |
527 |
%attr(0755, rpm, rpm) %{_bindir}/rpmverify |
528 |
|
529 |
%dir %{_localstatedir}/spool/repackage |
530 |
%dir %{rpmdir} |
531 |
%dir /etc/rpm |
532 |
%config(noreplace) /etc/rpm/macros |
533 |
%dir /etc/rpm/macros.d |
534 |
%attr(0755, rpm, rpm) %{rpmdir}/config.guess |
535 |
%attr(0755, rpm, rpm) %{rpmdir}/config.sub |
536 |
#%attr(0755, rpm, rpm) %{rpmdir}/convertrpmrc.sh |
537 |
%attr(0755, rpm, rpm) %{rpmdir}/rpmdb_* |
538 |
%attr(0644, rpm, rpm) %{rpmdir}/macros |
539 |
%attr(0755, rpm, rpm) %{rpmdir}/mkinstalldirs |
540 |
%attr(0755, rpm, rpm) %{rpmdir}/rpm.* |
541 |
%attr(0644, rpm, rpm) %{rpmdir}/rpmpopt* |
542 |
%attr(0644, rpm, rpm) %{rpmdir}/rpmrc |
543 |
|
544 |
%rpmattr %{rpmdir}/rpm2cpio.sh |
545 |
%rpmattr %{rpmdir}/tgpg |
546 |
|
547 |
%dir %attr( -, rpm, rpm) %{rpmdir}/platform/ |
548 |
%ifarch %{ix86} x86_64 |
549 |
%attr( -, rpm, rpm) %{rpmdir}/platform/i*86-* |
550 |
%attr( -, rpm, rpm) %{rpmdir}/platform/athlon-* |
551 |
%attr( -, rpm, rpm) %{rpmdir}/platform/pentium*-* |
552 |
%attr( -, rpm, rpm) %{rpmdir}/platform/geode-* |
553 |
%endif |
554 |
%ifarch alpha |
555 |
%attr( -, rpm, rpm) %{rpmdir}/platform/alpha* |
556 |
%endif |
557 |
%ifarch %{sunsparc} |
558 |
%attr( -, rpm, rpm) %{rpmdir}/platform/sparc* |
559 |
%endif |
560 |
%ifarch ppc powerpc |
561 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc-* |
562 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc32-* |
563 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc64-* |
564 |
%attr( -, rpm, rpm) %{rpmdir}/platform/powerpc-* |
565 |
%endif |
566 |
%ifarch ppc powerpc ppc64 |
567 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc*series-* |
568 |
%endif |
569 |
%ifarch ppc64 |
570 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc-* |
571 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc32-* |
572 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ppc64-* |
573 |
%endif |
574 |
%ifarch ia64 |
575 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ia64-* |
576 |
%endif |
577 |
%ifarch x86_64 |
578 |
%attr( -, rpm, rpm) %{rpmdir}/platform/amd64-* |
579 |
%attr( -, rpm, rpm) %{rpmdir}/platform/x86_64-* |
580 |
%attr( -, rpm, rpm) %{rpmdir}/platform/ia32e-* |
581 |
%endif |
582 |
%ifarch %arm |
583 |
%attr( -, rpm, rpm) %{rpmdir}/platform/armv* |
584 |
%endif |
585 |
%ifarch %mips |
586 |
%attr( -, rpm, rpm) %{rpmdir}/platform/mips* |
587 |
%endif |
588 |
%attr( -, rpm, rpm) %{rpmdir}/platform/noarch* |
589 |
|
590 |
%{_mandir}/man[18]/*.[18]* |
591 |
%lang(pl) %{_mandir}/pl/man[18]/*.[18]* |
592 |
%lang(ru) %{_mandir}/ru/man[18]/*.[18]* |
593 |
%lang(ja) %{_mandir}/ja/man[18]/*.[18]* |
594 |
%lang(sk) %{_mandir}/sk/man[18]/*.[18]* |
595 |
%lang(fr) %{_mandir}/fr/man[18]/*.[18]* |
596 |
%lang(ko) %{_mandir}/ko/man[18]/*.[18]* |
597 |
|
598 |
%config(noreplace,missingok) /etc/cron.daily/rpm |
599 |
%config(noreplace,missingok) /etc/logrotate.d/rpm |
600 |
|
601 |
%attr(0755, rpm, rpm) %dir %_localstatedir/lib/rpm |
602 |
|
603 |
%define rpmdbattr %attr(0644, rpm, rpm) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) |
604 |
|
605 |
%rpmdbattr /var/lib/rpm/Basenames |
606 |
%rpmdbattr /var/lib/rpm/Conflictname |
607 |
%rpmdbattr /var/lib/rpm/__db.0* |
608 |
%rpmdbattr /var/lib/rpm/Dirnames |
609 |
%rpmdbattr /var/lib/rpm/Group |
610 |
%rpmdbattr /var/lib/rpm/Installtid |
611 |
%rpmdbattr /var/lib/rpm/Name |
612 |
%rpmdbattr /var/lib/rpm/Packages |
613 |
%rpmdbattr /var/lib/rpm/Providename |
614 |
%rpmdbattr /var/lib/rpm/Provideversion |
615 |
%rpmdbattr /var/lib/rpm/Removetid |
616 |
%rpmdbattr /var/lib/rpm/Requirename |
617 |
%rpmdbattr /var/lib/rpm/Requireversion |
618 |
%rpmdbattr /var/lib/rpm/Triggername |
619 |
|
620 |
%files build |
621 |
%defattr(-,root,root) |
622 |
%doc CHANGES |
623 |
%doc doc-copy/* |
624 |
%rpmattr %{_bindir}/rpmbuild |
625 |
%rpmattr %{_prefix}/lib/rpm/brp-* |
626 |
%rpmattr %{_prefix}/lib/rpm/check-files |
627 |
%rpmattr %{_prefix}/lib/rpm/debugedit |
628 |
%rpmattr %{_prefix}/lib/rpm/find-debuginfo.sh |
629 |
%rpmattr %{_prefix}/lib/rpm/find-lang.sh |
630 |
%rpmattr %{_prefix}/lib/rpm/find-provides |
631 |
%rpmattr %{_prefix}/lib/rpm/find-requires |
632 |
%rpmattr %{_prefix}/lib/rpm/perldeps.pl |
633 |
%rpmattr %{_prefix}/lib/rpm/perl.prov |
634 |
%rpmattr %{_prefix}/lib/rpm/perl.req |
635 |
|
636 |
%rpmattr %{_prefix}/lib/rpm/check-buildroot |
637 |
%rpmattr %{_prefix}/lib/rpm/check-prereqs |
638 |
%rpmattr %{_prefix}/lib/rpm/check-rpaths |
639 |
%rpmattr %{_prefix}/lib/rpm/check-rpaths-worker |
640 |
%rpmattr %{_prefix}/lib/rpm/javadeps |
641 |
%rpmattr %{_prefix}/lib/rpm/libtooldeps.sh |
642 |
%rpmattr %{_prefix}/lib/rpm/macros.perl |
643 |
%rpmattr %{_prefix}/lib/rpm/macros.php |
644 |
%rpmattr %{_prefix}/lib/rpm/macros.python |
645 |
%rpmattr %{_prefix}/lib/rpm/mono-find-provides |
646 |
%rpmattr %{_prefix}/lib/rpm/mono-find-requires |
647 |
%rpmattr %{_prefix}/lib/rpm/osgideps.pl |
648 |
%rpmattr %{_prefix}/lib/rpm/pkgconfigdeps.sh |
649 |
%rpmattr %{_prefix}/lib/rpm/rpmdiff |
650 |
|
651 |
%rpmattr %{_prefix}/lib/rpm/rpmdeps |
652 |
#%rpmattr %{_prefix}/lib/rpm/trpm |
653 |
%rpmattr %{_prefix}/lib/rpm/pythondeps.sh |
654 |
|
655 |
%{_mandir}/man8/rpmbuild.8* |
656 |
%{_mandir}/man8/rpmdeps.8* |
657 |
|
658 |
%if %buildpython |
659 |
%files -n python-rpm |
660 |
%defattr(-,root,root) |
661 |
%{_libdir}/python*/site-packages/rpm |
662 |
%endif |
663 |
|
664 |
%files -n %librpmname |
665 |
%defattr(-,root,root) |
666 |
%{_libdir}/librpm-%{libver}.so |
667 |
%{_libdir}/librpmio-%{libver}.so |
668 |
%{_libdir}/librpmbuild-%{libver}.so |
669 |
|
670 |
%files -n %librpmnamedevel |
671 |
%defattr(-,root,root) |
672 |
%{_includedir}/rpm |
673 |
%{_libdir}/librpm.la |
674 |
%{_libdir}/librpm.so |
675 |
%{_libdir}/librpmio.la |
676 |
%{_libdir}/librpmio.so |
677 |
%{_libdir}/librpmbuild.la |
678 |
%{_libdir}/librpmbuild.so |
679 |
%{_libdir}/pkgconfig/rpm.pc |