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 export CPPFLAGS="$CPPFLAGS -DHWASAN_BUILD"
164 --disable-dependency-tracking \
170 --with-vendor=tizen \
173 --with-rpmconfigdir=%{rpmhome}
178 mkdir -p %{buildroot}%{rpmlibdir}
179 mkdir -p %{buildroot}%{_datadir}/locale
180 ln -s ../share/locale %{buildroot}%{rpmlibdir}/locale
182 install -m 644 db3/db.h %{buildroot}%{_includedir}/rpm
183 mkdir -p %{buildroot}%{_sysconfdir}/rpm
184 mkdir -p %{buildroot}%{rpmhome}/tizen
185 cp -a tizen_macros %{buildroot}%{rpmhome}
186 install -m 755 %{SOURCE13} %{buildroot}%{rpmhome}/tizen
187 install -m 755 %{SOURCE14} %{buildroot}%{rpmhome}/tizen
188 install -m 755 %{SOURCE23} %{buildroot}%{rpmhome}
189 install -m 644 %{SOURCE9} %{buildroot}%{rpmhome}/fileattrs/libsymlink.attr
190 install -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/device-sec-policy
191 install -m 644 %{SOURCE22} %{buildroot}%{__plugindir}/msm-device-sec-policy
192 ln -s ../tizen_macros %{buildroot}%{rpmhome}/tizen/macros
193 for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
194 mkdir -p %{buildroot}%{_usrsrc}/packages/$d
195 chmod 755 %{buildroot}%{_usrsrc}/packages/$d
197 for d in %{buildroot}%{rpmhome}/platform/*-linux/macros ; do
198 dd=${d%%-linux/macros}
200 mkdir -p %{buildroot}%{_usrsrc}/packages/RPMS/$dd
201 chmod 755 %{buildroot}%{_usrsrc}/packages/RPMS/$dd
203 mkdir -p %{buildroot}%{_localstatedir}/lib/rpm
204 gzip -9 %{buildroot}%{_mandir}/man[18]/*.[18]
205 export RPM_BUILD_ROOT
207 rm -rf doc/manual/Makefile*
208 rm -f %{buildroot}%{rpmlibdir}/rpmpopt
209 rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
210 rm -f %{buildroot}%{_datadir}/locale/de/LC_MESSAGES/rpm.mo
211 rm -f %{buildroot}%{rpmhome}/cpanflute %{buildroot}%{rpmhome}/cpanflute2
212 install -m 755 scripts/find-supplements %{buildroot}%{rpmhome}
213 install -m 755 scripts/find-supplements.ksyms %{buildroot}%{rpmhome}
214 install -m 755 scripts/firmware.prov %{buildroot}%{rpmhome}
215 install -m 755 scripts/debuginfo.prov %{buildroot}%{rpmhome}
216 install -m 644 %{SOURCE24} %{buildroot}%{rpmhome}
217 rm -f %{buildroot}%{rpmlibdir}/locale %{buildroot}%{rpmlibdir}/rpmrc
218 mkdir -p %{buildroot}%{_sysconfdir}/rpm
219 chmod 755 %{buildroot}%{_sysconfdir}/rpm
220 mkdir -p %{buildroot}%{rpmhome}/macros.d
221 # remove some nonsense or non-working scripts
222 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
223 magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
224 vpkg-provides*.sh http.req sql.req tcl.req \
225 rpmdb_* brp-sparc64-linux brp-java-gcjcompile
227 rm -f %{buildroot}%{rpmhome}/$f
229 for i in %{_datadir}/automake-*/*; do
230 if test -f "$i" && test -f %{buildroot}%{rpmhome}/"${i##*/}"; then
231 rm -f %{buildroot}%{rpmhome}/"${i##*/}"
234 %ifarch aarch64 ppc64le
235 install -m 755 config.guess %{buildroot}%{rpmhome}
236 install -m 755 config.sub %{buildroot}%{rpmhome}
238 rm -f %{buildroot}%{_libdir}/*.la
239 rm -f %{buildroot}%{__plugindir}/*.la
241 %fdupes %{buildroot}%{rpmhome}/platform
243 sh %{buildroot}%{rpmhome}/find-lang.sh %{buildroot} rpm
245 %ifarch armv7hl armv7l
246 # rpm is using the host_cpu as default for the platform,
247 #but armv7hl is not known by the kernel.
248 # so we need to enforce the platform here.
249 echo -n %{_target_cpu}-tizen-linux-gnueabi > %{buildroot}%{_sysconfdir}/rpm/platform
252 grep -Rn '/usr/lib/rpm' %{_builddir} || echo "No hard-coded paths found"
256 test -f %{_dbpath}/Packages || rpm --initdb
257 rm -f %{_dbpath}/Filemd5s \
258 %{_dbpath}/Filedigests \
259 %{_dbpath}/Requireversion \
260 %{_dbpath}/Provideversion
266 %manifest %{name}.manifest
267 %defattr(-,root,root)
277 %{_bindir}/rpm2archive
278 %attr(0755, root, root) %dir %{rpmhome}
283 %attr(0755, root, root) %dir %{rpmhome}/tizen
284 %{rpmhome}/tizen/macros
285 %{rpmhome}/tizen_macros
290 %{__plugindir}/ima.so
291 %{__plugindir}/prioreset.so
292 %{__plugindir}/syslog.so
293 %{_libdir}/librpm.so.*
294 %{_libdir}/librpmio.so.*
295 %{_libdir}/librpmbuild.so.*
296 %{_libdir}/librpmsign.so.*
297 %dir %{_localstatedir}/lib/rpm
298 %dir %attr(755,root,root) %{_usrsrc}/packages/BUILD
299 %dir %attr(755,root,root) %{_usrsrc}/packages/SPECS
300 %dir %attr(755,root,root) %{_usrsrc}/packages/SOURCES
301 %dir %attr(755,root,root) %{_usrsrc}/packages/SRPMS
302 %dir %attr(755,root,root) %{_usrsrc}/packages/RPMS
303 %dir %attr(755,root,root) %{_usrsrc}/packages/BUILDROOT
304 %dir %attr(755,root,root) %{_usrsrc}/packages/RPMS/*
307 %manifest %{name}.manifest
308 %defattr(-,root,root)
314 %attr(0755, root, root) %dir %{rpmhome}/tizen
315 %{rpmhome}/tizen/find-*
317 %{rpmhome}/find-supplements*
320 %{rpmhome}/sepdebugcrcfix
321 %{rpmhome}/python-macro-helper
322 %{rpmhome}/find-debuginfo.sh
323 %{rpmhome}/find-lang.sh
324 %{rpmhome}/find-provides.ksyms
325 %{rpmhome}/*provides*
326 %{rpmhome}/*requires*
332 %{rpmhome}/debug.manifest
333 %ifarch aarch64 ppc64le
338 %manifest %{name}.manifest
339 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_bindir}/rpmgraph
344 %{_libdir}/librpmbuild.so
345 %{_libdir}/librpmio.so
346 %{_libdir}/librpmsign.so
347 %{_libdir}/pkgconfig/rpm.pc
349 %files security-plugin
350 %manifest %{name}.manifest
351 %defattr(-,root,root)
353 %{__plugindir}/msm.so
354 %{__plugindir}/msm-device-sec-policy
355 %config(noreplace) %{_sysconfdir}/device-sec-policy
358 %defattr(-,root,root)
360 %{python_sitearch}/rpm
361 %attr(755,root,root) %{python_sitearch}/rpm/transaction.py