Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / packaging / rpm.spec
index 9555fca..23fbb8f 100644 (file)
@@ -3,10 +3,10 @@
 
 Name:           rpm
 Summary:        The Package Manager
-License:        GPL-2.0+
+License:        LGPL-2.0+ and GPL-2.0+
 Group:          Base/Package Management
-Version:        4.11.0.1
-Release:        0
+Version:        4.14.1.1
+Release:        1
 Url:            http://www.rpm.org
 BuildRequires:  binutils
 BuildRequires:  bzip2
@@ -33,7 +33,11 @@ BuildRequires:  pkgconfig(nss)
 BuildRequires:  uthash-devel
 BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(libsmack)
+BuildRequires:  pkgconfig(libarchive)
 BuildRequires:  fdupes
+BuildRequires:  libdw-devel
+BuildRequires:  libelf-devel
+BuildRequires:  pkgconfig(libzstd)
 
 Provides:       rpminst
 Provides:       rpm-libs
@@ -43,10 +47,13 @@ Source2:        db-4.8.30-integration.dif
 Source4:        rpm-tizen_macros
 Source8:        rpmconfigcheck
 Source13:       find-docs.sh
+Source14:       find-isufiles.sh
 Source22:       device-sec-policy
 Source23:       find-provides.ksyms
+Source24:       debug.manifest
 Source1001:     rpm.manifest
 Source0:        rpm-%{version}.tar.bz2
+Source9:        libsymlink.attr
 
 # avoid bootstrapping problem
 %define _binary_payload w9.bzdio
@@ -100,6 +107,12 @@ Requires: nss
 This package contains the MSM security plugin for rpm that performs
 security-related functionality.
 
+%post security-plugin
+echo "%__transaction_plugins     msm" >> %{rpmhome}/macros
+echo "%__plugindir                           %{_libdir}/rpm-plugins" >> %{rpmhome}/macros
+echo "%__transaction_msm                     %{__plugindir}/msm.so" >> %{rpmhome}/macros
+echo "%__transaction_msm_default_policy      %{_libdir}/rpm-plugins/msm-device-sec-policy" >> %{rpmhome}/macros
+
 %package -n python-rpm
 Summary: Python Bindings for Manipulating RPM Packages
 Requires:       rpm = %{version}
@@ -130,11 +143,15 @@ cp -a %{SOURCE4} tizen_macros
 rm -f m4/libtool.m4
 rm -f m4/lt*.m4
 
+# Change hard-coded paths in man pages and .rc files
+#[[ x"/usr/lib/rpm" != x%{rpmhome} ]] && \
+   /bin/bash -c '/usr/bin/find %{_builddir} -type f -exec sed -e "s|/usr/lib/rpm|%{rpmhome}|g" -i {} \;'
+
 %build
 CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
 export CPPFLAGS
-export CFLAGS="%{optflags} -ffunction-sections"
-export LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic-functions -ffunction-sections"
+export CFLAGS="%{optflags} -ffunction-sections -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE"
+export LDFLAGS="${LDFLAGS} -pie -Wl,-Bsymbolic-functions -ffunction-sections"
 %ifarch armv5tel
 export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
 %endif
@@ -147,7 +164,9 @@ export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
     --enable-shared \
     --enable-python \
     --with-vendor=tizen \
-    --with-msm 
+    --with-msm \
+    --enable-zstd \
+    --with-rpmconfigdir=%{rpmhome}
 
 make %{?_smp_mflags}
 
@@ -158,10 +177,12 @@ ln -s ../share/locale %{buildroot}%{rpmlibdir}/locale
 %make_install
 install -m 644 db3/db.h %{buildroot}%{_includedir}/rpm
 mkdir -p %{buildroot}%{_sysconfdir}/rpm
-cp -a tizen_macros %{buildroot}%{rpmhome}
 mkdir -p %{buildroot}%{rpmhome}/tizen
+cp -a tizen_macros %{buildroot}%{rpmhome}
 install -m 755 %{SOURCE13} %{buildroot}%{rpmhome}/tizen
+install -m 755 %{SOURCE14} %{buildroot}%{rpmhome}/tizen
 install -m 755 %{SOURCE23} %{buildroot}%{rpmhome}
+install -m 644 %{SOURCE9} %{buildroot}%{rpmhome}/fileattrs/libsymlink.attr
 install -m 644 %{SOURCE22} %{buildroot}%{_sysconfdir}/device-sec-policy
 install -m 644 %{SOURCE22} %{buildroot}%{__plugindir}/msm-device-sec-policy
 ln -s ../tizen_macros %{buildroot}%{rpmhome}/tizen/macros
@@ -188,6 +209,7 @@ install -m 755 scripts/find-supplements %{buildroot}%{rpmhome}
 install -m 755 scripts/find-supplements.ksyms %{buildroot}%{rpmhome}
 install -m 755 scripts/firmware.prov %{buildroot}%{rpmhome}
 install -m 755 scripts/debuginfo.prov %{buildroot}%{rpmhome}
+install -m 644 %{SOURCE24} %{buildroot}%{rpmhome}
 rm -f %{buildroot}%{rpmlibdir}/locale %{buildroot}%{rpmlibdir}/rpmrc
 mkdir -p %{buildroot}%{_sysconfdir}/rpm
 chmod 755 %{buildroot}%{_sysconfdir}/rpm
@@ -195,8 +217,8 @@ mkdir -p %{buildroot}%{rpmhome}/macros.d
 # remove some nonsense or non-working scripts
 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
          magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
-         brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
-         rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
+         vpkg-provides*.sh http.req sql.req tcl.req \
+         rpmdb_* brp-sparc64-linux brp-java-gcjcompile
 do
     rm -f %{buildroot}%{rpmhome}/$f
 done
@@ -206,8 +228,8 @@ for i in %{_datadir}/automake-*/*; do
   fi
 done
 %ifarch aarch64 ppc64le
-install -m 755 config.guess %{buildroot}/usr/lib/rpm
-install -m 755 config.sub %{buildroot}/usr/lib/rpm
+install -m 755 config.guess %{buildroot}%{rpmhome}
+install -m 755 config.sub %{buildroot}%{rpmhome}
 %endif
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{__plugindir}/*.la
@@ -223,6 +245,8 @@ sh %{buildroot}%{rpmhome}/find-lang.sh %{buildroot} rpm
 echo -n %{_target_cpu}-tizen-linux-gnueabi > %{buildroot}%{_sysconfdir}/rpm/platform
 %endif
 
+grep -Rn '/usr/lib/rpm' %{_builddir} || echo "No hard-coded paths found"
+
 %post
 /sbin/ldconfig
 test -f %{_dbpath}/Packages || rpm --initdb
@@ -246,18 +270,22 @@ rm -f %{_dbpath}/Filemd5s \
 %{_bindir}/rpmquery
 %{_bindir}/rpmverify
 %{_bindir}/rpmqpack
+%{_bindir}/rpm2archive
 %attr(0755, root, root) %dir %{rpmhome}
 %{rpmhome}/macros
 %{rpmhome}/macros.d
 %{rpmhome}/rpmpopt*
 %{rpmhome}/rpmrc
+%attr(0755, root, root) %dir %{rpmhome}/tizen
 %{rpmhome}/tizen/macros
 %{rpmhome}/tizen_macros
 %{rpmhome}/rpm.supp
 %{rpmhome}/tgpg
 %{rpmhome}/platform
 %dir    %{__plugindir}
-%{__plugindir}/exec.so
+%{__plugindir}/ima.so
+%{__plugindir}/prioreset.so
+%{__plugindir}/syslog.so
 %{_libdir}/librpm.so.*
 %{_libdir}/librpmio.so.*
 %{_libdir}/librpmbuild.so.*
@@ -274,15 +302,19 @@ rm -f %{_dbpath}/Filemd5s \
 %files build
 %manifest %{name}.manifest
 %defattr(-,root,root)
+%license COPYING
 %{_bindir}/rpmbuild
 %{_bindir}/gendiff
 %{_bindir}/rpmspec
 %{_bindir}/rpmsign
+%attr(0755, root, root) %dir %{rpmhome}/tizen
 %{rpmhome}/tizen/find-*
 %{rpmhome}/brp-*
 %{rpmhome}/find-supplements*
 %{rpmhome}/check-*
 %{rpmhome}/debugedit
+%{rpmhome}/sepdebugcrcfix
+%{rpmhome}/python-macro-helper
 %{rpmhome}/find-debuginfo.sh
 %{rpmhome}/find-lang.sh
 %{rpmhome}/find-provides.ksyms
@@ -293,6 +325,7 @@ rm -f %{_dbpath}/Filemd5s \
 %{rpmhome}/*.req
 %{rpmhome}/macros.*
 %{rpmhome}/fileattrs
+%{rpmhome}/debug.manifest
 %ifarch aarch64 ppc64le
 %{rpmhome}/config.*
 %endif
@@ -300,6 +333,7 @@ rm -f %{_dbpath}/Filemd5s \
 %files devel
 %manifest %{name}.manifest
 %defattr(644,root,root,755)
+%license COPYING
 %attr(755,root,root) %{_bindir}/rpmgraph
 %{_includedir}/rpm
 %{_libdir}/librpm.so
@@ -311,12 +345,14 @@ rm -f %{_dbpath}/Filemd5s \
 %files security-plugin
 %manifest %{name}.manifest
 %defattr(-,root,root)
+%license COPYING
 %{__plugindir}/msm.so
 %{__plugindir}/msm-device-sec-policy
 %config(noreplace) %{_sysconfdir}/device-sec-policy
 
 %files -n python-rpm
 %defattr(-,root,root)
+%license COPYING
 %{python_sitearch}/rpm
 %attr(755,root,root) %{python_sitearch}/rpm/transaction.py