SPECS/rpm/rpm.spec
c7daff96
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 
 Summary:        Package manager
 Name:           rpm
07857461
 Version:        4.14.2
6f03b51f
 Release:        2%{?dist}
c7daff96
 License:        GPLv2+
 URL:            http://rpm.org
 Group:          Applications/System
 Vendor:         VMware, Inc.
 Distribution:   Photon
b3ee0bbc
 Source0:        https://github.com/rpm-software-management/rpm/archive/%{name}-%{version}-release.tar.gz
07857461
 %define sha1    rpm=8cd4fb1df88c3c73ac506f8ac92be8c39fa610eb
ec017e0f
 Source1:        macros
 Source2:        brp-strip-debug-symbols
 Source3:        brp-strip-unneeded
07857461
 Patch0:         find-debuginfo-do-not-generate-dir-entries.patch
c7daff96
 Requires:       bash
b3ee0bbc
 Requires:       libdb
c7daff96
 Requires:       rpm-libs = %{version}-%{release}
f5cac196
 Requires:       libarchive
421d1f6b
 BuildRequires:  libarchive-devel
b3ee0bbc
 BuildRequires:  libdb-devel
c7daff96
 BuildRequires:  popt-devel
 BuildRequires:  nss-devel
 BuildRequires:  elfutils-devel
 BuildRequires:  libcap-devel
 BuildRequires:  xz-devel
cdd26197
 BuildRequires:  file-devel
c7daff96
 
f4d17450
 %description
 RPM package manager
 
 %package devel
c7daff96
 Summary:        Libraries and header files for rpm
 Provides:       pkgconfig(rpm)
 Requires:       %{name} = %{version}-%{release}
f4d17450
 %description devel
 Static libraries and header files for the support library for rpm
 
fb300e7c
 %package libs
c7daff96
 Summary:        Libraries for rpm
7fbd3a1e
 Requires:       nss-libs
c7daff96
 Requires:       popt
 Requires:       libgcc
 Requires:       libcap
 Requires:       zlib
7fbd3a1e
 Requires:       bzip2-libs
c7daff96
 Requires:       elfutils-libelf
7fbd3a1e
 Requires:       xz-libs
c7daff96
 %description    libs
fb300e7c
 Shared libraries librpm and librpmio
 
04a6f557
 %package build
c7daff96
 Requires:       perl
 Requires:       %{name}-devel = %{version}-%{release}
 Requires:       elfutils-libelf
04a6f557
 Summary: Binaries, scripts and libraries needed to build rpms.
 %description build
 Binaries, libraries and scripts to build rpms.
 
71e15024
 %package lang
c7daff96
 Summary:        Additional language files for rpm
 Group:          Applications/System
 Requires:       %{name} = %{version}-%{release}
71e15024
 %description lang
 These are the additional language files of rpm.
 
c7daff96
 %package -n     python-rpm
 Summary:        Python 2 bindings for rpm.
 Group:          Development/Libraries
 BuildRequires:  python2-devel
 Requires:       python2
 %description -n python-rpm
 
 %package -n     python3-rpm
 Summary:        Python 3 bindings for rpm.
 Group:          Development/Libraries
 BuildRequires:  python3-devel
 Requires:       python3
 
 %description -n python3-rpm
 Python3 rpm.
 
f4d17450
 %prep
b3ee0bbc
 %setup -n rpm-%{name}-%{version}-release
ef8c3db3
 %patch0 -p1
ec017e0f
 
f4d17450
 %build
421d1f6b
 sed -i '/define _GNU_SOURCE/a #include "../config.h"' tools/sepdebugcrcfix.c
855f4896
 
f4d17450
 ./autogen.sh --noconfigure
 ./configure \
55dba468
     CPPFLAGS='-I/usr/include/nspr -I/usr/include/nss -DLUA_COMPAT_APIINTCASTS' \
f4d17450
         --program-prefix= \
         --prefix=%{_prefix} \
         --exec-prefix=%{_prefix} \
         --bindir=%{_bindir} \
         --sbindir=%{_sbindir} \
         --sysconfdir=%{_sysconfdir} \
         --datadir=%{_datadir} \
         --includedir=%{_includedir} \
         --libdir=%{_libdir} \
         --libexecdir=%{_libexecdir} \
         --localstatedir=%{_var} \
         --sharedstatedir=%{_sharedstatedir} \
         --mandir=%{_mandir} \
         --infodir=%{_infodir} \
         --disable-dependency-tracking \
55dba468
         --disable-static \
f4d17450
         --enable-python \
55dba468
         --with-cap \
a078357f
         --without-lua \
ec017e0f
         --disable-silent-rules \
b3ee0bbc
         --with-external-db
f4d17450
 make %{?_smp_mflags}
c7daff96
 
 pushd python
 python2 setup.py build
 python3 setup.py build
 popd
 
c7da38e2
 %check
 make check
 
f4d17450
 %install
 make DESTDIR=%{buildroot} install
 find %{buildroot} -name '*.la' -delete
 %find_lang %{name}
55dba468
 # System macros and prefix
f4d17450
 install -dm 755 %{buildroot}%{_sysconfdir}/rpm
ec017e0f
 install -vm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/
 install -vm755 %{SOURCE2} %{buildroot}%{_libdir}/rpm/
ef8c3db3
 install -vm755 %{SOURCE3} %{buildroot}%{_libdir}/rpm/
d100feaf
 
c7daff96
 pushd python
 python2 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
 python3 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
 popd
 
fb300e7c
 %post libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
421d1f6b
 
f4d17450
 %clean
 rm -rf %{buildroot}
421d1f6b
 
71e15024
 %files
f4d17450
 %defattr(-,root,root)
07857461
 %{_bindir}/rpm
04a6f557
 %{_bindir}/gendiff
421d1f6b
 %{_bindir}/rpm2archive
04a6f557
 %{_bindir}/rpm2cpio
 %{_bindir}/rpmdb
 %{_bindir}/rpmgraph
 %{_bindir}/rpmkeys
 %{_bindir}/rpmquery
 %{_bindir}/rpmverify
 
988f4885
 %{_libdir}/rpm/rpmpopt-*
 %{_libdir}/rpm/rpmdb_*
04a6f557
 %{_libdir}/rpm/rpm.daily
 %{_libdir}/rpm/rpm.log
 %{_libdir}/rpm/rpm.supp
 %{_libdir}/rpm/rpm2cpio.sh
 %{_libdir}/rpm/tgpg
988f4885
 %{_libdir}/rpm/platform
f4d17450
 %{_libdir}/rpm-plugins/*
07857461
 %{_libdir}/rpm/python-macro-helper
 %{_libdir}/rpm/pythondistdeps.py
04a6f557
 %{_mandir}/man8/rpm.8.gz
 %{_mandir}/man8/rpm2cpio.8.gz
 %{_mandir}/man8/rpmdb.8.gz
 %{_mandir}/man8/rpmgraph.8.gz
 %{_mandir}/man8/rpmkeys.8.gz
07857461
 %{_mandir}/man8/rpm-misc.8.gz
 %{_mandir}/man8/rpm-plugin-systemd-inhibit.8.gz
04a6f557
 %exclude %{_mandir}/fr/man8/*.gz
 %exclude %{_mandir}/ja/man8/*.gz
 %exclude %{_mandir}/ko/man8/*.gz
 %exclude %{_mandir}/pl/man1/*.gz
 %exclude %{_mandir}/pl/man8/*.gz
 %exclude %{_mandir}/ru/man8/*.gz
 %exclude %{_mandir}/sk/man8/*.gz
 
fb300e7c
 %files libs
 %defattr(-,root,root)
19467f09
 %{_sysconfdir}/rpm/macros
fb300e7c
 %{_libdir}/librpmio.so.*
 %{_libdir}/librpm.so.*
19467f09
 %{_libdir}/rpm/macros
 %{_libdir}/rpm/rpmrc
 %{_libdir}/rpm/platform/*
fb300e7c
 
04a6f557
 %files build
 %{_bindir}/rpmbuild
 %{_bindir}/rpmsign
 %{_bindir}/rpmspec
fb300e7c
 %{_libdir}/librpmbuild.so
 %{_libdir}/librpmbuild.so.*
421d1f6b
 %{_libdir}/rpm/macros.*
04a6f557
 %{_libdir}/rpm/perl.req
 %{_libdir}/rpm/find-debuginfo.sh
 %{_libdir}/rpm/find-lang.sh
 %{_libdir}/rpm/find-provides
 %{_libdir}/rpm/find-requires
 %{_libdir}/rpm/brp-*
 %{_libdir}/rpm/mono-find-provides
 %{_libdir}/rpm/mono-find-requires
 %{_libdir}/rpm/ocaml-find-provides.sh
 %{_libdir}/rpm/ocaml-find-requires.sh
 %{_libdir}/rpm/fileattrs/*
05aa13e7
 %{_libdir}/rpm/script.req
988f4885
 %{_libdir}/rpm/check-buildroot
 %{_libdir}/rpm/check-files
 %{_libdir}/rpm/check-prereqs
 %{_libdir}/rpm/check-rpaths
 %{_libdir}/rpm/check-rpaths-worker
 %{_libdir}/rpm/config.guess
 %{_libdir}/rpm/config.sub
 %{_libdir}/rpm/debugedit
 %{_libdir}/rpm/elfdeps
 %{_libdir}/rpm/libtooldeps.sh
 %{_libdir}/rpm/mkinstalldirs
 %{_libdir}/rpm/pkgconfigdeps.sh
421d1f6b
 %{_libdir}/rpm/*.prov
 %{_libdir}/rpm/sepdebugcrcfix
 
988f4885
 
 %{_libdir}/rpm/pythondeps.sh
 %{_libdir}/rpm/rpmdeps
04a6f557
 
 %{_mandir}/man1/gendiff.1*
 %{_mandir}/man8/rpmbuild.8*
 %{_mandir}/man8/rpmdeps.8*
 %{_mandir}/man8/rpmspec.8*
 %{_mandir}/man8/rpmsign.8.gz
f4d17450
 
 %files devel
 %defattr(-,root,root)
 %{_includedir}/*
 %{_libdir}/pkgconfig/rpm.pc
 %{_libdir}/librpmio.so
 %{_libdir}/librpm.so
05aa13e7
 %{_libdir}/librpmsign.so
 %{_libdir}/librpmsign.so.*
f4d17450
 
71e15024
 %files lang -f %{name}.lang
 %defattr(-,root,root)
 
c7daff96
 %files -n python-rpm
 %defattr(-,root,root)
 %{python2_sitelib}/*
 
 %files -n python3-rpm
 %defattr(-,root,root)
 %{python3_sitelib}/*
 
f4d17450
 %changelog
6f03b51f
 *   Fri Sep 28 2018 Alexey Makhalov <amakhalov@vmware.com> 4.14.2-2
 -   macros: set _build_id_links to alldebug
07857461
 *   Fri Sep 14 2018 Keerthana K <keerthanak@vmware.com> 4.14.2-1
 -   Update to version 4.14.2
b3ee0bbc
 *   Thu Dec 21 2017 Xiaolin Li <xiaolinl@vmware.com> 4.13.0.1-7
 -   Fix CVE-2017-7501
855f4896
 *   Wed Oct 04 2017 Alexey Makhalov <amakhalov@vmware.com> 4.13.0.1-6
 -   make python{,3}-rpm depend on current version of librpm
cdd26197
 *   Wed Jun 28 2017 Xiaolin Li <xiaolinl@vmware.com> 4.13.0.1-5
 -   Add file-devel to BuildRequires
c7da38e2
 *   Mon Jun 26 2017 Chang Lee <changlee@vmware.com> 4.13.0.1-4
 -   Updated %check
f5cac196
 *   Mon Jun 05 2017 Bo Gan <ganb@vmware.com> 4.13.0.1-3
 -   Fix Dependency
18f188d5
 *   Thu May 18 2017 Xiaolin Li <xiaolinl@vmware.com> 4.13.0.1-2
 -   Remove python2 from requires of rpm-devel subpackages.
ec017e0f
 *   Wed May 10 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.13.0.1-1
 -   Update to 4.13.0.1
421d1f6b
 *   Fri Apr 21 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.13.0-1
 -   Update to 4.13.0
7fbd3a1e
 *   Wed Apr 19 2017 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-22
 -   Do not allow -debuginfo to own directories to avoid conflicts with
     filesystem package and between each other. Patch applied
 *   Fri Apr 14 2017 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-21
 -   rpm-libs requires nss-libs, xz-libs and bzip2-libs.
 *   Tue Mar 21 2017 Xiaolin Li <xiaolinl@vmware.com> 4.11.2-20
 -   Added python3 packages and moved python2 site packages from devel to python-rpm.
 *   Mon Jan 10 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.11.2-19
 -   added buildrequires for xz-devel for PayloadIsLzma cap
 *   Thu Dec 15 2016 Xiaolin Li <xiaolinl@vmware.com> 4.11.2-18
 -   Moved some files from rpm to rpm-build.
 *   Tue Dec 06 2016 Xiaolin Li <xiaolinl@vmware.com> 4.11.2-17
 -   Added -lang subpackage.
 *   Wed Nov 23 2016 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-16
 -   Move rpmrc and macros into -libs subpackage
 -   Move zlib and elfutils-libelf dependency from rpm to rpm-libs
 -   Add bzip2 dependency to rpm-libs
 *   Thu Nov 17 2016 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-15
 -   Added -libs subpackage
 *   Tue Nov 15 2016 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-14
 -   Disable lua support
 *   Tue Oct 18 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.11.2-13
 -   Apply patch for CVE-2014-8118
 *   Wed Oct 05 2016 ChangLee <changlee@vmware.com> 4.11.2-12
 -   Modified %check
 *   Fri Aug 26 2016 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-11
 -   find-debuginfo...patch: exclude non existing .build-id from packaging
 -   Move all files from rpm-system-configuring-scripts tarball to here 
 *   Wed May 25 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.11.2-10
 -   Exclude .build-id/.1 and .build-id/.1.debug from debuginfo pkg
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.11.2-9
 -   GA - Bump release of all rpms
 *   Thu May 05 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.11.2-8
 -   Update rpm version in lock-step with lua update to 5.3.2
 *   Fri Apr 08 2016 Mahmoud Bassiouny <mbassiouny@vmware.com> 4.11.2-7
 -   Build rpm with capabilities.
 *   Thu Aug 05 2015 Sharath George <sharathg@vmware.com> 4.11.2-6
 -   Moving build utils to a different package.
 *   Sat Jun 27 2015 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-5
 -   Update rpm-system-configuring-scripts. Use tar --no-same-owner for rpmbuild.
 *   Thu Jun 18 2015 Anish Swaminathan <anishs@vmware.com> 4.11.2-4
 -   Add pkgconfig Provides directive
 *   Thu Jun 18 2015 Alexey Makhalov <amakhalov@vmware.com> 4.11.2-3
 -   Do no strip debug info from .debug files
 *   Wed Jun 3 2015 Divya Thaluru <dthaluru@vmware.com> 4.11.2-2
 -   Removing perl-module-scandeps package from run time required packages
 *   Tue Jan 13 2015 Divya Thaluru <dthaluru@vmware.com> 4.11.2-1
 -   Initial build. First version