Remove hardcoded target.
[scm/bb/tizen.git] / proto-meta-Tizen_generic / specfile-initial / rpm / 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 -s 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-msm 
150
151 make %{?_smp_mflags}
152
153 %install
154 mkdir -p %{buildroot}%{rpmlibdir}
155 mkdir -p %{buildroot}%{_datadir}/locale
156 ln -s ../share/locale %{buildroot}%{rpmlibdir}/locale
157 %make_install
158 install -m 644 db3/db.h %{buildroot}%{_includedir}/rpm
159 mkdir -p %{buildroot}%{_sysconfdir}/rpm
160 cp -a tizen_macros %{buildroot}%{rpmhome}
161 mkdir -p %{buildroot}%{rpmhome}/tizen
162 install -m 755 %{SOURCE13} %{buildroot}%{rpmhome}/tizen
163 install -m 755 %{SOURCE23} %{buildroot}%{rpmhome}
164 install -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/device-sec-policy
165 install -m 644 %{SOURCE22} %{buildroot}%{__plugindir}/msm-device-sec-policy
166 ln -s ../tizen_macros %{buildroot}%{rpmhome}/tizen/macros
167 for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
168   mkdir -p %{buildroot}%{_usrsrc}/packages/$d
169   chmod 755 %{buildroot}%{_usrsrc}/packages/$d
170 done
171 for d in %{buildroot}%{rpmhome}/platform/*-linux/macros ; do
172   dd=${d%%-linux/macros}
173   dd=${dd##*/}
174   mkdir -p %{buildroot}%{_usrsrc}/packages/RPMS/$dd
175   chmod 755 %{buildroot}%{_usrsrc}/packages/RPMS/$dd
176 done
177 mkdir -p %{buildroot}%{_localstatedir}/lib/rpm
178 gzip -9 %{buildroot}%{_mandir}/man[18]/*.[18]
179 export RPM_BUILD_ROOT
180 chmod 755 doc/manual
181 rm -rf doc/manual/Makefile*
182 rm -f %{buildroot}%{rpmlibdir}/rpmpopt
183 rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
184 rm -f %{buildroot}%{_datadir}/locale/de/LC_MESSAGES/rpm.mo
185 rm -f %{buildroot}%{rpmhome}/cpanflute %{buildroot}%{rpmhome}/cpanflute2
186 install -m 755 scripts/find-supplements{,.ksyms} %{buildroot}%{rpmhome}
187 install -m 755 scripts/firmware.prov %{buildroot}%{rpmhome}
188 install -m 755 scripts/debuginfo.prov %{buildroot}%{rpmhome}
189 rm -f %{buildroot}%{rpmlibdir}/locale %{buildroot}%{rpmlibdir}/rpmrc
190 mkdir -p %{buildroot}%{_sysconfdir}/rpm
191 chmod 755 %{buildroot}%{_sysconfdir}/rpm
192 mkdir -p %{buildroot}%{rpmhome}/macros.d
193 # remove some nonsense or non-working scripts
194 pushd %{buildroot}%{rpmhome}/
195 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
196          magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
197          brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
198          rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
199 do
200     rm -f $f
201 done
202 for i in %{_datadir}/automake-*/*; do
203   if test -f "$i" && test -f "${i##*/}"; then
204     rm -f "${i##*/}"
205   fi
206 done
207 popd
208 rm -f %{buildroot}%{_libdir}/*.la
209 rm -f %{buildroot}%{__plugindir}/*.la
210
211 %fdupes %{buildroot}%{rpmhome}/platform
212
213 sh %{buildroot}%{rpmhome}/find-lang.sh %{buildroot} rpm
214
215 %ifarch armv7hl armv7l
216 # rpm is using the host_cpu as default for the platform,
217 #but armv7hl is not known by the kernel.
218 # so we need to enforce the platform here.
219 echo -n %{_target_cpu}-tizen-linux-gnueabi > %{buildroot}%{_sysconfdir}/rpm/platform
220 %endif
221
222 %post
223 /sbin/ldconfig
224 test -f %{_dbpath}/Packages || rpm --initdb
225 rm -f %{_dbpath}/Filemd5s \
226       %{_dbpath}/Filedigests \
227       %{_dbpath}/Requireversion \
228       %{_dbpath}/Provideversion
229
230 %postun
231 /sbin/ldconfig
232
233 %files
234 %manifest %{name}.manifest
235 %defattr(-,root,root)
236 %license COPYING
237 %{_sysconfdir}/rpm
238 /bin/rpm
239 %{_bindir}/rpm2cpio
240 %{_bindir}/rpmdb
241 %{_bindir}/rpmkeys
242 %{_bindir}/rpmquery
243 %{_bindir}/rpmverify
244 %{_bindir}/rpmqpack
245 %attr(0755, root, root) %dir %{rpmhome}
246 %{rpmhome}/macros
247 %{rpmhome}/macros.d
248 %{rpmhome}/rpmpopt*
249 %{rpmhome}/rpmrc
250 %{rpmhome}/tizen/macros
251 %{rpmhome}/tizen_macros
252 %{rpmhome}/rpm.supp
253 %{rpmhome}/tgpg
254 %{rpmhome}/platform
255 %dir    %{__plugindir}
256 %{__plugindir}/exec.so
257 %{_libdir}/librpm.so.*
258 %{_libdir}/librpmio.so.*
259 %{_libdir}/librpmbuild.so.*
260 %{_libdir}/librpmsign.so.*
261 %dir    %{_localstatedir}/lib/rpm
262 %dir    %attr(755,root,root) %{_usrsrc}/packages/BUILD
263 %dir    %attr(755,root,root) %{_usrsrc}/packages/SPECS
264 %dir    %attr(755,root,root) %{_usrsrc}/packages/SOURCES
265 %dir    %attr(755,root,root) %{_usrsrc}/packages/SRPMS
266 %dir    %attr(755,root,root) %{_usrsrc}/packages/RPMS
267 %dir    %attr(755,root,root) %{_usrsrc}/packages/BUILDROOT
268 %dir    %attr(755,root,root) %{_usrsrc}/packages/RPMS/*
269
270 %files build
271 %manifest %{name}.manifest
272 %defattr(-,root,root)
273 %{_bindir}/rpmbuild
274 %{_bindir}/gendiff
275 %{_bindir}/rpmspec
276 %{_bindir}/rpmsign
277 %{rpmhome}/tizen/find-*
278 %{rpmhome}/brp-*
279 %{rpmhome}/find-supplements*
280 %{rpmhome}/check-*
281 %{rpmhome}/debugedit
282 %{rpmhome}/find-debuginfo.sh
283 %{rpmhome}/find-lang.sh
284 %{rpmhome}/find-provides.ksyms
285 %{rpmhome}/*provides*
286 %{rpmhome}/*requires*
287 %{rpmhome}/*deps*
288 %{rpmhome}/*.prov
289 %{rpmhome}/*.req
290 %{rpmhome}/macros.*
291 %{rpmhome}/fileattrs
292
293 %files devel
294 %manifest %{name}.manifest
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_bindir}/rpmgraph
297 %{_includedir}/rpm
298 %{_libdir}/librpm.so
299 %{_libdir}/librpmbuild.so
300 %{_libdir}/librpmio.so
301 %{_libdir}/librpmsign.so
302 %{_libdir}/pkgconfig/rpm.pc
303
304 %files security-plugin
305 %manifest %{name}.manifest
306 %defattr(-,root,root)
307 %{__plugindir}/msm.so
308 %{__plugindir}/msm-device-sec-policy
309 %config(noreplace) %{_sysconfdir}/device-sec-policy
310
311 %files -n python-rpm
312 %defattr(-,root,root)
313 %{_libdir}/python*/site-packages/rpm
314 %attr(755,root,root) %{_libdir}/python*/site-packages/rpm/transaction.py
315
316 %lang_package
317
318 %docs_package
319 %doc     GROUPS