Modify eu-strip option to perform strip in post script of rpm package & add option...
[platform/upstream/rpm.git] / packaging / rpm.spec
1 %define rpmlibdir %{_prefix}/lib
2 %define rpmhome %{rpmlibdir}/rpm
3
4 Name:           rpm
5 Summary:        The Package Manager
6 License:        GPL-2.0+
7 Group:          Base/Package Management
8 Version:        4.11.0.1
9 Release:        0
10 Url:            http://www.rpm.org
11 BuildRequires:  binutils
12 BuildRequires:  bzip2
13 BuildRequires:  file-devel
14 BuildRequires:  findutils
15 BuildRequires:  gcc
16 BuildRequires:  gettext-tools
17 BuildRequires:  glibc-devel
18 BuildRequires:  gzip
19 BuildRequires:  libacl-devel
20 BuildRequires:  libattr-devel
21 BuildRequires:  pkgconfig(bzip2)
22 BuildRequires:  pkgconfig(libcap)
23 BuildRequires:  libelf-devel
24 BuildRequires:  libtool
25 BuildRequires:  pkgconfig(lua)
26 BuildRequires:  make
27 BuildRequires:  pkgconfig(ncurses)
28 BuildRequires:  patch
29 BuildRequires:  pkgconfig(popt)
30 BuildRequires:  xz-devel
31 BuildRequires:  pkgconfig(zlib)
32 BuildRequires:  pkgconfig(nss)
33 BuildRequires:  uthash-devel
34 BuildRequires:  pkgconfig(libxml-2.0)
35 BuildRequires:  pkgconfig(libsmack)
36 BuildRequires:  fdupes
37
38 Provides:       rpminst
39 Provides:       rpm-libs
40
41 Source1:        db-4.8.30.tar.bz2
42 Source2:        db-4.8.30-integration.dif
43 Source4:        rpm-tizen_macros
44 Source8:        rpmconfigcheck
45 Source13:       find-docs.sh
46 Source22:       device-sec-policy
47 Source23:       find-provides.ksyms
48 Source1001:     rpm.manifest
49 Source0:        rpm-%{version}.tar.bz2
50
51 # avoid bootstrapping problem
52 %define _binary_payload w9.bzdio
53
54 %description
55 RPM Package Manager is the main tool for managing the software packages
56 of Tizen.
57
58 RPM can be used to install and remove software packages. With rpm, it
59 is easy to update packages.  RPM keeps track of all these manipulations
60 in a central database.  This way it is possible to get an overview of
61 all installed packages.  RPM also supports database queries.
62
63 %package devel
64 Summary:        Include Files and Libraries mandatory for Development
65 Requires:       rpm = %{version}
66 Requires:       pkgconfig(popt)
67
68 %description devel
69 This package contains the RPM C library and header files.  These
70 development files will simplify the process of writing programs which
71 manipulate RPM packages and databases and are intended to make it
72 easier to create graphical package managers or any other tools that
73 need an intimate knowledge of RPM packages in order to function.
74
75 %package build
76 Summary:        Tools and Scripts to create rpm packages
77 Requires:       rpm = %{version}
78 Provides:       rpmbuild rpm:%{_bindir}/rpmbuild
79 Requires:       bzip2
80 Requires:       xz
81 Requires:       gzip
82 Requires:       binutils
83 Requires:       make
84 Requires:       gcc
85 Requires:       findutils
86 Requires:       patch
87 Requires:       glibc-devel
88
89 %description build
90 If you want to build a rpm, you need this package. It provides rpmbuild
91 and requires some packages that are usually required
92
93 %package security-plugin
94 Summary: MSM security plugin for rpm
95 Requires: rpm = %{version}-%{release}
96 Requires: smack
97 Requires: nss
98
99 %description security-plugin
100 This package contains the MSM security plugin for rpm that performs
101 security-related functionality.
102
103 %package -n python-rpm
104 Summary: Python Bindings for Manipulating RPM Packages
105 Requires:       rpm = %{version}
106 BuildRequires:  pkgconfig(python)
107
108 %description -n python-rpm
109 The python-rpm package contains a module that permits applications
110 written in the Python programming language to use the interface
111 supplied by RPM Package Manager libraries.
112
113 This package should be installed if you want to develop Python programs
114 that will manipulate RPM packages and databases.
115
116 %prep
117 %setup -q -n rpm-%{version}
118 cp %{SOURCE1001} .
119 rm -rf sqlite
120 tar xjf %{S:1}
121 ln -sfn db-4.8.30 db
122 chmod -R u+w db/*
123 # will get linked from db3
124 rm -f rpmdb/db.h
125 patch -p0 < %{S:2}
126 if [ -s %{_sysconfdir}/rpm/tizen_macros ]; then
127     cp -a %{_sysconfdir}/rpm/tizen_macros %{SOURCE4}
128 fi
129 cp -a %{SOURCE4} tizen_macros
130 rm -f m4/libtool.m4
131 rm -f m4/lt*.m4
132
133 %build
134 CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
135 export CPPFLAGS
136 export CFLAGS="%{optflags} -ffunction-sections"
137 export LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic-functions -ffunction-sections"
138 %ifarch armv5tel
139 export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
140 %endif
141
142 %reconfigure \
143     --disable-dependency-tracking \
144     --with-lua \
145     --with-acl \
146     --with-cap \
147     --enable-shared \
148     --enable-python \
149     --with-vendor=tizen \
150     --with-msm 
151
152 make %{?_smp_mflags}
153
154 %install
155 mkdir -p %{buildroot}%{rpmlibdir}
156 mkdir -p %{buildroot}%{_datadir}/locale
157 ln -s ../share/locale %{buildroot}%{rpmlibdir}/locale
158 %make_install
159 install -m 644 db3/db.h %{buildroot}%{_includedir}/rpm
160 mkdir -p %{buildroot}%{_sysconfdir}/rpm
161 cp -a tizen_macros %{buildroot}%{rpmhome}
162 mkdir -p %{buildroot}%{rpmhome}/tizen
163 install -m 755 %{SOURCE13} %{buildroot}%{rpmhome}/tizen
164 install -m 755 %{SOURCE23} %{buildroot}%{rpmhome}
165 install -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/device-sec-policy
166 install -m 644 %{SOURCE22} %{buildroot}%{__plugindir}/msm-device-sec-policy
167 ln -s ../tizen_macros %{buildroot}%{rpmhome}/tizen/macros
168 for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
169   mkdir -p %{buildroot}%{_usrsrc}/packages/$d
170   chmod 755 %{buildroot}%{_usrsrc}/packages/$d
171 done
172 for d in %{buildroot}%{rpmhome}/platform/*-linux/macros ; do
173   dd=${d%%-linux/macros}
174   dd=${dd##*/}
175   mkdir -p %{buildroot}%{_usrsrc}/packages/RPMS/$dd
176   chmod 755 %{buildroot}%{_usrsrc}/packages/RPMS/$dd
177 done
178 mkdir -p %{buildroot}%{_localstatedir}/lib/rpm
179 gzip -9 %{buildroot}%{_mandir}/man[18]/*.[18]
180 export RPM_BUILD_ROOT
181 chmod 755 doc/manual
182 rm -rf doc/manual/Makefile*
183 rm -f %{buildroot}%{rpmlibdir}/rpmpopt
184 rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
185 rm -f %{buildroot}%{_datadir}/locale/de/LC_MESSAGES/rpm.mo
186 rm -f %{buildroot}%{rpmhome}/cpanflute %{buildroot}%{rpmhome}/cpanflute2
187 install -m 755 scripts/find-supplements %{buildroot}%{rpmhome}
188 install -m 755 scripts/find-supplements.ksyms %{buildroot}%{rpmhome}
189 install -m 755 scripts/firmware.prov %{buildroot}%{rpmhome}
190 install -m 755 scripts/debuginfo.prov %{buildroot}%{rpmhome}
191 rm -f %{buildroot}%{rpmlibdir}/locale %{buildroot}%{rpmlibdir}/rpmrc
192 mkdir -p %{buildroot}%{_sysconfdir}/rpm
193 chmod 755 %{buildroot}%{_sysconfdir}/rpm
194 mkdir -p %{buildroot}%{rpmhome}/macros.d
195 # remove some nonsense or non-working scripts
196 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
197          magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
198          vpkg-provides*.sh http.req sql.req tcl.req \
199          rpmdb_* brp-sparc64-linux brp-java-gcjcompile
200 do
201     rm -f %{buildroot}%{rpmhome}/$f
202 done
203 for i in %{_datadir}/automake-*/*; do
204   if test -f "$i" && test -f %{buildroot}%{rpmhome}/"${i##*/}"; then
205     rm -f %{buildroot}%{rpmhome}/"${i##*/}"
206   fi
207 done
208 %ifarch aarch64 ppc64le
209 install -m 755 config.guess %{buildroot}/usr/lib/rpm
210 install -m 755 config.sub %{buildroot}/usr/lib/rpm
211 %endif
212 rm -f %{buildroot}%{_libdir}/*.la
213 rm -f %{buildroot}%{__plugindir}/*.la
214
215 %fdupes %{buildroot}%{rpmhome}/platform
216
217 sh %{buildroot}%{rpmhome}/find-lang.sh %{buildroot} rpm
218
219 %ifarch armv7hl armv7l
220 # rpm is using the host_cpu as default for the platform,
221 #but armv7hl is not known by the kernel.
222 # so we need to enforce the platform here.
223 echo -n %{_target_cpu}-tizen-linux-gnueabi > %{buildroot}%{_sysconfdir}/rpm/platform
224 %endif
225
226 %post
227 /sbin/ldconfig
228 test -f %{_dbpath}/Packages || rpm --initdb
229 rm -f %{_dbpath}/Filemd5s \
230       %{_dbpath}/Filedigests \
231       %{_dbpath}/Requireversion \
232       %{_dbpath}/Provideversion
233
234 %postun
235 /sbin/ldconfig
236
237 %files
238 %manifest %{name}.manifest
239 %defattr(-,root,root)
240 %license COPYING
241 %{_sysconfdir}/rpm
242 /bin/rpm
243 %{_bindir}/rpm2cpio
244 %{_bindir}/rpmdb
245 %{_bindir}/rpmkeys
246 %{_bindir}/rpmquery
247 %{_bindir}/rpmverify
248 %{_bindir}/rpmqpack
249 %attr(0755, root, root) %dir %{rpmhome}
250 %{rpmhome}/macros
251 %{rpmhome}/macros.d
252 %{rpmhome}/rpmpopt*
253 %{rpmhome}/rpmrc
254 %{rpmhome}/tizen/macros
255 %{rpmhome}/tizen_macros
256 %{rpmhome}/rpm.supp
257 %{rpmhome}/tgpg
258 %{rpmhome}/platform
259 %dir    %{__plugindir}
260 %{__plugindir}/exec.so
261 %{_libdir}/librpm.so.*
262 %{_libdir}/librpmio.so.*
263 %{_libdir}/librpmbuild.so.*
264 %{_libdir}/librpmsign.so.*
265 %dir    %{_localstatedir}/lib/rpm
266 %dir    %attr(755,root,root) %{_usrsrc}/packages/BUILD
267 %dir    %attr(755,root,root) %{_usrsrc}/packages/SPECS
268 %dir    %attr(755,root,root) %{_usrsrc}/packages/SOURCES
269 %dir    %attr(755,root,root) %{_usrsrc}/packages/SRPMS
270 %dir    %attr(755,root,root) %{_usrsrc}/packages/RPMS
271 %dir    %attr(755,root,root) %{_usrsrc}/packages/BUILDROOT
272 %dir    %attr(755,root,root) %{_usrsrc}/packages/RPMS/*
273
274 %files build
275 %manifest %{name}.manifest
276 %defattr(-,root,root)
277 %{_bindir}/rpmbuild
278 %{_bindir}/gendiff
279 %{_bindir}/rpmspec
280 %{_bindir}/rpmsign
281 %{rpmhome}/tizen/find-*
282 %{rpmhome}/brp-*
283 %{rpmhome}/find-supplements*
284 %{rpmhome}/check-*
285 %{rpmhome}/debugedit
286 %{rpmhome}/find-debuginfo.sh
287 %{rpmhome}/find-lang.sh
288 %{rpmhome}/find-provides.ksyms
289 %{rpmhome}/*provides*
290 %{rpmhome}/*requires*
291 %{rpmhome}/*deps*
292 %{rpmhome}/*.prov
293 %{rpmhome}/*.req
294 %{rpmhome}/macros.*
295 %{rpmhome}/fileattrs
296 %ifarch aarch64 ppc64le
297 %{rpmhome}/config.*
298 %endif
299
300 %files devel
301 %manifest %{name}.manifest
302 %defattr(644,root,root,755)
303 %attr(755,root,root) %{_bindir}/rpmgraph
304 %{_includedir}/rpm
305 %{_libdir}/librpm.so
306 %{_libdir}/librpmbuild.so
307 %{_libdir}/librpmio.so
308 %{_libdir}/librpmsign.so
309 %{_libdir}/pkgconfig/rpm.pc
310
311 %files security-plugin
312 %manifest %{name}.manifest
313 %defattr(-,root,root)
314 %{__plugindir}/msm.so
315 %{__plugindir}/msm-device-sec-policy
316 %config(noreplace) %{_sysconfdir}/device-sec-policy
317
318 %files -n python-rpm
319 %defattr(-,root,root)
320 %{python_sitearch}/rpm
321 %attr(755,root,root) %{python_sitearch}/rpm/transaction.py
322
323 %lang_package
324
325 %docs_package
326 %doc     GROUPS