1 # Use custom autoreq script for filtering out all librpm* stuff
2 # (basically everything that the package would auto-provide) in order to make
3 # the package installable
4 %define _use_internal_dependency_generator 0
5 %define __find_requires bash -c "/usr/lib/rpm/find-requires | grep -v librpm"
7 %define rpmlibdir %{_prefix}/lib
8 %define rpmhome %{rpmlibdir}/rpm
11 Summary: The RPM libraries for git-buildpackage
13 Group: Development/Tools/Building
14 Version: 4.14.1.1.tizen20230628
16 Url: http://www.rpm.org
17 BuildRequires: binutils
19 BuildRequires: file-devel
20 BuildRequires: findutils
22 BuildRequires: glibc-devel
24 BuildRequires: libacl-devel
25 BuildRequires: pkgconfig(libcap)
26 BuildRequires: libelf-devel
27 BuildRequires: libtool
29 BuildRequires: pkgconfig(lua)
31 BuildRequires: lua-devel
34 BuildRequires: pkgconfig(ncurses)
36 %if 0%{?fedora} || 0%{?centos_ver} || 0%{?centos_version}
37 BuildRequires: popt-devel
39 BuildRequires: pkgconfig(popt)
41 BuildRequires: pkgconfig(zlib)
42 BuildRequires: pkgconfig(nss)
43 BuildRequires: pkg-config
44 %if 0%{?centos_ver} || 0%{?centos_version}
45 BuildRequires: python-devel
47 BuildRequires: pkgconfig(python3)
51 BuildRequires: uthash-devel
52 BuildRequires: pkgconfig(libxml-2.0)
53 BuildRequires: pkgconfig(libsmack)
55 BuildRequires: libarchive-devel
59 %if 0%{?fedora} || 0%{?centos_ver} >= 7
60 BuildRequires: libdb-devel
62 BuildRequires: db-devel
64 BuildRequires: pkgconfig(libzstd)
66 Source4: rpm-tizen_macros
67 Source8: rpmconfigcheck
68 Source13: find-docs.sh
69 Source22: device-sec-policy
70 Source23: find-provides.ksyms
71 Source1001: rpm.manifest
72 Source0: rpm-%{version}.tar.gz
75 Provides: rpm-tizen = %{version}-tizen20230628
77 # avoid bootstrapping problem
78 %define _binary_payload w9.bzdio
81 %define python_mod_name rpm_tizen
84 RPM Package Manager is the main tool for managing the software packages
87 RPM can be used to install and remove software packages. With rpm, it
88 is easy to update packages. RPM keeps track of all these manipulations
89 in a central database. This way it is possible to get an overview of
90 all installed packages. RPM also supports database queries.
92 This is a special stripped-down version of RPM, only intended to be used by the
93 git-buildpackage tool. This package doesn't interfere with the RPM libraries of
94 the host system and it only contains rpmlib and rpm-python.
97 %setup -q -n rpm-%{version}
100 if [ -s %{_sysconfdir}/rpm/tizen_macros ]; then
101 cp -a %{_sysconfdir}/rpm/tizen_macros %{SOURCE4}
103 cp -a %{SOURCE4} tizen_macros
108 CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
110 export CFLAGS="%{optflags} -ffunction-sections -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE"
111 export LDFLAGS="${LDFLAGS} -pie -Wl,-Bsymbolic-functions -ffunction-sections"
113 export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
117 export CPPFLAGS="$CPPFLAGS -DHWASAN_BUILD"
123 --libdir=%{_libdir}/%{name} \
124 --disable-dependency-tracking \
130 --with-vendor=tizen \
134 PYTHON_MODULENAME=%{python_mod_name}
139 # Install into a temporary location
140 make install DESTDIR="`pwd`/tmp_install"
142 # And only copy the files that we want
143 install -d %{buildroot}%{_libdir}/%{name}
144 install -d %{buildroot}%{python3_sitearch}
145 cp -ax tmp_install/%{_libdir}/%{name} %{buildroot}%{_libdir}/
146 cp -ax tmp_install/%{python3_sitearch}/%{python_mod_name} %{buildroot}%{python3_sitearch}/
148 # Install extra sources
149 install -m644 %{SOURCE4} %{buildroot}%{_libdir}/%{name}/rpm/tizen_macros
150 install -d %{buildroot}%{_libdir}/%{name}/rpm/tizen
151 ln -s ../tizen_macros %{buildroot}%{_libdir}/%{name}/rpm/tizen/macros
153 # Delete unwanted development files etc.
154 find %{buildroot} -name "*.la" | xargs rm -f --
155 find %{buildroot}/%{_libdir}/%{name} -name "*.so" | xargs rm -f --
156 rm -rf "%{buildroot}%{_libdir}/%{name}/pkgconfig"
157 rm -rf "%{buildroot}%{_libdir}/%{name}/rpm-plugins"
159 # Compile python modules (Fedora does this automatically) and find duplicates
160 %if 0%{?suse_version}
161 %py3_compile %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
162 %py3_compile -O %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
164 %fdupes %{buildroot}/%{python3_sitearch}/
168 %defattr(-,root,root,-)
169 %dir %{_libdir}/%{name}
170 %dir %{python3_sitearch}/%{python_mod_name}/
171 %{_libdir}/%{name}/*.so.*
172 %{_libdir}/%{name}/rpm
173 %{python3_sitearch}/%{python_mod_name}/*