1 %define rpmlibdir %{_prefix}/lib
2 %define rpmhome %{rpmlibdir}/rpm
5 Summary: The Package Manager
6 License: LGPL-2.0+ and GPL-2.0+
7 Group: Base/Package Management
10 Url: http://www.rpm.org
11 BuildRequires: binutils
13 BuildRequires: file-devel
14 BuildRequires: findutils
16 BuildRequires: gettext-tools
17 BuildRequires: glibc-devel
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)
27 BuildRequires: pkgconfig(ncurses)
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: pkgconfig(libarchive)
38 BuildRequires: libdw-devel
39 BuildRequires: libelf-devel
40 BuildRequires: pkgconfig(libzstd)
45 Source1: db-4.8.30.tar.bz2
46 Source2: db-4.8.30-integration.dif
47 Source4: rpm-tizen_macros
48 Source8: rpmconfigcheck
49 Source13: find-docs.sh
50 Source14: find-isufiles.sh
51 Source22: device-sec-policy
52 Source23: find-provides.ksyms
53 Source24: debug.manifest
54 Source1001: rpm.manifest
55 Source0: rpm-%{version}.tar.bz2
56 Source9: libsymlink.attr
58 # avoid bootstrapping problem
59 %define _binary_payload w9.bzdio
62 RPM Package Manager is the main tool for managing the software packages
65 RPM can be used to install and remove software packages. With rpm, it
66 is easy to update packages. RPM keeps track of all these manipulations
67 in a central database. This way it is possible to get an overview of
68 all installed packages. RPM also supports database queries.
71 Summary: Include Files and Libraries mandatory for Development
72 Requires: rpm = %{version}
73 Requires: pkgconfig(popt)
76 This package contains the RPM C library and header files. These
77 development files will simplify the process of writing programs which
78 manipulate RPM packages and databases and are intended to make it
79 easier to create graphical package managers or any other tools that
80 need an intimate knowledge of RPM packages in order to function.
83 Summary: Tools and Scripts to create rpm packages
84 Requires: rpm = %{version}
85 Provides: rpmbuild rpm:%{_bindir}/rpmbuild
97 If you want to build a rpm, you need this package. It provides rpmbuild
98 and requires some packages that are usually required
100 %package security-plugin
101 Summary: MSM security plugin for rpm
102 Requires: rpm = %{version}-%{release}
106 %description security-plugin
107 This package contains the MSM security plugin for rpm that performs
108 security-related functionality.
110 %post security-plugin
111 echo "%__transaction_plugins msm" >> %{rpmhome}/macros
112 echo "%__plugindir %{_libdir}/rpm-plugins" >> %{rpmhome}/macros
113 echo "%__transaction_msm %{__plugindir}/msm.so" >> %{rpmhome}/macros
114 echo "%__transaction_msm_default_policy %{_libdir}/rpm-plugins/msm-device-sec-policy" >> %{rpmhome}/macros
116 %package -n python-rpm
117 Summary: Python Bindings for Manipulating RPM Packages
118 Requires: rpm = %{version}
119 BuildRequires: pkgconfig(python)
121 %description -n python-rpm
122 The python-rpm package contains a module that permits applications
123 written in the Python programming language to use the interface
124 supplied by RPM Package Manager libraries.
126 This package should be installed if you want to develop Python programs
127 that will manipulate RPM packages and databases.
130 %setup -q -n rpm-%{version}
136 # will get linked from db3
139 if [ -s %{_sysconfdir}/rpm/tizen_macros ]; then
140 cp -a %{_sysconfdir}/rpm/tizen_macros %{SOURCE4}
142 cp -a %{SOURCE4} tizen_macros
146 # Change hard-coded paths in man pages and .rc files
147 #[[ x"/usr/lib/rpm" != x%{rpmhome} ]] && \
148 /bin/bash -c '/usr/bin/find %{_builddir} -type f -exec sed -e "s|/usr/lib/rpm|%{rpmhome}|g" -i {} \;'
151 CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
153 export CFLAGS="%{optflags} -ffunction-sections -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE"
154 export LDFLAGS="${LDFLAGS} -pie -Wl,-Bsymbolic-functions -ffunction-sections"
156 export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
160 --disable-dependency-tracking \
166 --with-vendor=tizen \
169 --with-rpmconfigdir=%{rpmhome}
174 mkdir -p %{buildroot}%{rpmlibdir}
175 mkdir -p %{buildroot}%{_datadir}/locale
176 ln -s ../share/locale %{buildroot}%{rpmlibdir}/locale
178 install -m 644 db3/db.h %{buildroot}%{_includedir}/rpm
179 mkdir -p %{buildroot}%{_sysconfdir}/rpm
180 mkdir -p %{buildroot}%{rpmhome}/tizen
181 cp -a tizen_macros %{buildroot}%{rpmhome}
182 install -m 755 %{SOURCE13} %{buildroot}%{rpmhome}/tizen
183 install -m 755 %{SOURCE14} %{buildroot}%{rpmhome}/tizen
184 install -m 755 %{SOURCE23} %{buildroot}%{rpmhome}
185 install -m 644 %{SOURCE9} %{buildroot}%{rpmhome}/fileattrs/libsymlink.attr
186 install -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/device-sec-policy
187 install -m 644 %{SOURCE22} %{buildroot}%{__plugindir}/msm-device-sec-policy
188 ln -s ../tizen_macros %{buildroot}%{rpmhome}/tizen/macros
189 for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
190 mkdir -p %{buildroot}%{_usrsrc}/packages/$d
191 chmod 755 %{buildroot}%{_usrsrc}/packages/$d
193 for d in %{buildroot}%{rpmhome}/platform/*-linux/macros ; do
194 dd=${d%%-linux/macros}
196 mkdir -p %{buildroot}%{_usrsrc}/packages/RPMS/$dd
197 chmod 755 %{buildroot}%{_usrsrc}/packages/RPMS/$dd
199 mkdir -p %{buildroot}%{_localstatedir}/lib/rpm
200 gzip -9 %{buildroot}%{_mandir}/man[18]/*.[18]
201 export RPM_BUILD_ROOT
203 rm -rf doc/manual/Makefile*
204 rm -f %{buildroot}%{rpmlibdir}/rpmpopt
205 rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
206 rm -f %{buildroot}%{_datadir}/locale/de/LC_MESSAGES/rpm.mo
207 rm -f %{buildroot}%{rpmhome}/cpanflute %{buildroot}%{rpmhome}/cpanflute2
208 install -m 755 scripts/find-supplements %{buildroot}%{rpmhome}
209 install -m 755 scripts/find-supplements.ksyms %{buildroot}%{rpmhome}
210 install -m 755 scripts/firmware.prov %{buildroot}%{rpmhome}
211 install -m 755 scripts/debuginfo.prov %{buildroot}%{rpmhome}
212 install -m 644 %{SOURCE24} %{buildroot}%{rpmhome}
213 rm -f %{buildroot}%{rpmlibdir}/locale %{buildroot}%{rpmlibdir}/rpmrc
214 mkdir -p %{buildroot}%{_sysconfdir}/rpm
215 chmod 755 %{buildroot}%{_sysconfdir}/rpm
216 mkdir -p %{buildroot}%{rpmhome}/macros.d
217 # remove some nonsense or non-working scripts
218 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
219 magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
220 vpkg-provides*.sh http.req sql.req tcl.req \
221 rpmdb_* brp-sparc64-linux brp-java-gcjcompile
223 rm -f %{buildroot}%{rpmhome}/$f
225 for i in %{_datadir}/automake-*/*; do
226 if test -f "$i" && test -f %{buildroot}%{rpmhome}/"${i##*/}"; then
227 rm -f %{buildroot}%{rpmhome}/"${i##*/}"
230 %ifarch aarch64 ppc64le
231 install -m 755 config.guess %{buildroot}%{rpmhome}
232 install -m 755 config.sub %{buildroot}%{rpmhome}
234 rm -f %{buildroot}%{_libdir}/*.la
235 rm -f %{buildroot}%{__plugindir}/*.la
237 %fdupes %{buildroot}%{rpmhome}/platform
239 sh %{buildroot}%{rpmhome}/find-lang.sh %{buildroot} rpm
241 %ifarch armv7hl armv7l
242 # rpm is using the host_cpu as default for the platform,
243 #but armv7hl is not known by the kernel.
244 # so we need to enforce the platform here.
245 echo -n %{_target_cpu}-tizen-linux-gnueabi > %{buildroot}%{_sysconfdir}/rpm/platform
248 grep -Rn '/usr/lib/rpm' %{_builddir} || echo "No hard-coded paths found"
252 test -f %{_dbpath}/Packages || rpm --initdb
253 rm -f %{_dbpath}/Filemd5s \
254 %{_dbpath}/Filedigests \
255 %{_dbpath}/Requireversion \
256 %{_dbpath}/Provideversion
262 %manifest %{name}.manifest
263 %defattr(-,root,root)
273 %{_bindir}/rpm2archive
274 %attr(0755, root, root) %dir %{rpmhome}
279 %attr(0755, root, root) %dir %{rpmhome}/tizen
280 %{rpmhome}/tizen/macros
281 %{rpmhome}/tizen_macros
286 %{__plugindir}/ima.so
287 %{__plugindir}/prioreset.so
288 %{__plugindir}/syslog.so
289 %{_libdir}/librpm.so.*
290 %{_libdir}/librpmio.so.*
291 %{_libdir}/librpmbuild.so.*
292 %{_libdir}/librpmsign.so.*
293 %dir %{_localstatedir}/lib/rpm
294 %dir %attr(755,root,root) %{_usrsrc}/packages/BUILD
295 %dir %attr(755,root,root) %{_usrsrc}/packages/SPECS
296 %dir %attr(755,root,root) %{_usrsrc}/packages/SOURCES
297 %dir %attr(755,root,root) %{_usrsrc}/packages/SRPMS
298 %dir %attr(755,root,root) %{_usrsrc}/packages/RPMS
299 %dir %attr(755,root,root) %{_usrsrc}/packages/BUILDROOT
300 %dir %attr(755,root,root) %{_usrsrc}/packages/RPMS/*
303 %manifest %{name}.manifest
304 %defattr(-,root,root)
310 %attr(0755, root, root) %dir %{rpmhome}/tizen
311 %{rpmhome}/tizen/find-*
313 %{rpmhome}/find-supplements*
316 %{rpmhome}/sepdebugcrcfix
317 %{rpmhome}/python-macro-helper
318 %{rpmhome}/find-debuginfo.sh
319 %{rpmhome}/find-lang.sh
320 %{rpmhome}/find-provides.ksyms
321 %{rpmhome}/*provides*
322 %{rpmhome}/*requires*
328 %{rpmhome}/debug.manifest
329 %ifarch aarch64 ppc64le
334 %manifest %{name}.manifest
335 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_bindir}/rpmgraph
340 %{_libdir}/librpmbuild.so
341 %{_libdir}/librpmio.so
342 %{_libdir}/librpmsign.so
343 %{_libdir}/pkgconfig/rpm.pc
345 %files security-plugin
346 %manifest %{name}.manifest
347 %defattr(-,root,root)
349 %{__plugindir}/msm.so
350 %{__plugindir}/msm-device-sec-policy
351 %config(noreplace) %{_sysconfdir}/device-sec-policy
354 %defattr(-,root,root)
356 %{python_sitearch}/rpm
357 %attr(755,root,root) %{python_sitearch}/rpm/transaction.py