diff --git a/fileattrs.diff b/fileattrs.diff index 35f2335..a122d87 100644 --- a/fileattrs.diff +++ b/fileattrs.diff @@ -37,9 +37,9 @@ Index: fileattrs/ksyms.attr --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ fileattrs/ksyms.attr 2011-12-15 13:47:26.787456907 +0100 @@ -0,0 +1,4 @@ -+%__ksyms_provides %{_rpmconfigdir}/find-provides.ksyms %name -+%__ksyms_requires %{_rpmconfigdir}/find-requires.ksyms %name -+%__ksyms_supplements %{_rpmconfigdir}/find-supplements.ksyms %name ++%__ksyms_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides.ksyms %name ++%__ksyms_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires.ksyms %name ++%__ksyms_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements.ksyms %name +%__ksyms_path (/lib/modules/.*\.ko(\.gz)?)|(/boot/vmlinu[xz].*)$ Index: fileattrs/Makefile.am =================================================================== diff --git a/perl-python-attr.patch b/perl-python-attr.patch new file mode 100644 index 0000000..4d422e2 --- /dev/null +++ b/perl-python-attr.patch @@ -0,0 +1,32 @@ +commit 9ddcc23d2b7ecaf5336530dbe37195b0057d0396 +Author: Ville Skyttä +Date: Tue Jan 10 10:48:13 2012 +0200 + + Adapt perl and python fileattrs to file 5.10 magics + + - file 5.10 has changed magics at least for perl and python scripts, samples: + + 5.09: a /usr/bin/perl -w script, ASCII text executable, with very long lines + 5.10: Perl script, ASCII text executable, with very long lines + + 5.09: a /usr/bin/python script, ASCII text executable + 5.10: Python script, ASCII text executable + + Signed-off-by: Panu Matilainen + +--- fileattrs/perl.attr ++++ fileattrs/perl.attr 2012-01-16 14:09:35.455146647 +0000 +@@ -1,4 +1,4 @@ + # disabled for now + #%__perl_requires %{_rpmconfigdir}/perl.req +-%__perl_magic ^.*perl .*$ ++%__perl_magic ^.*[Pp]erl .*$ + %__perl_flags exeonly +--- fileattrs/python.attr ++++ fileattrs/python.attr 2012-01-16 14:09:35.455146647 +0000 +@@ -1,4 +1,4 @@ + %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides + %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires + %__python_path ^((/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]\\.[[:digit:]]))$ +-%__python_magic ^python.*(executable|byte-compiled)$ ++%__python_magic ^[Pp]ython.*(executable|byte-compiled)$ diff --git a/python3-abi-kind.diff b/python3-abi-kind.diff new file mode 100644 index 0000000..5ed4310 --- /dev/null +++ b/python3-abi-kind.diff @@ -0,0 +1,11 @@ +--- configure.ac ++++ configure.ac +@@ -537,7 +537,7 @@ + ]) + CPPFLAGS="$save_CPPFLAGS" + save_LIBS="$LIBS" +- AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[ ++ AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}mu python${PYTHON_VERSION} python],[ + WITH_PYTHON_LIB="$ac_res" + ],[AC_MSG_ERROR([missing python library]) + ]) diff --git a/python3-rpm.changes b/python3-rpm.changes new file mode 100644 index 0000000..04d7fe1 --- /dev/null +++ b/python3-rpm.changes @@ -0,0 +1,13 @@ +------------------------------------------------------------------- +Tue Jan 17 10:29:20 UTC 2012 - saschpe@suse.de + +- Spec file cleanup: + * Don't rm -rf %{buildroot} + * Removed %clean section + * Removed authors from description + +------------------------------------------------------------------- +Mon Jan 9 17:12:41 CET 2012 - dmueller@suse.de + +- Initial package + diff --git a/python3-rpm.spec b/python3-rpm.spec new file mode 100644 index 0000000..5b826aa --- /dev/null +++ b/python3-rpm.spec @@ -0,0 +1,72 @@ +# +# spec file for package python3-rpm +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: python3-rpm +Version: 4.9.1.2 +Release: 0 +#!BuildIgnore: rpmlint-Factory +Summary: Python Bindings for Manipulating RPM Packages +License: GPL-2.0+ +Group: System/Packages +Source99: rpm.spec +BuildRequires: file-devel +BuildRequires: libacl-devel +BuildRequires: libbz2-devel +BuildRequires: libcap-devel +BuildRequires: libelf-devel +BuildRequires: libselinux-devel +BuildRequires: libsemanage-devel +BuildRequires: libtool +BuildRequires: lua51-devel +BuildRequires: ncurses-devel +BuildRequires: popt-devel +BuildRequires: python3-devel +BuildRequires: xz-devel +BuildRequires: zlib-devel +Requires: rpm = %{version} +%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)} +%global with_python 1 + +%description +The python3-rpm package contains a module that permits applications +written in the Python programming language to use the interface +supplied by RPM Package Manager libraries. + +This package should be installed if you want to develop Python programs +that will manipulate RPM packages and databases. + +%prep +%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')} + +%install +mkdir -p %{buildroot}%{_prefix}/lib +# only installing in python/ does not work because rpm links against +# installed libs at install time +%make_install +find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python3*/site-packages/rpm/\* -print0 | xargs -0 rm +pushd %{buildroot}/%{_libdir}/python3*/site-packages/rpm +rm -f _rpmmodule.a _rpmmodule.la +python3 %{_libdir}/python3*/py_compile.py *.py +python3 -O %{_libdir}/python3*/py_compile.py *.py +popd + +%files +%defattr(-,root,root) +%{_libdir}/python*/*/* + +%changelog diff --git a/rpm-python.changes b/rpm-python.changes index b332280..14132e7 100644 --- a/rpm-python.changes +++ b/rpm-python.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jan 17 10:28:42 UTC 2012 - saschpe@suse.de + +- Spec file cleanup: + * Don't rm -rf %{buildroot} + * Removed %clean section + * Removed authors from description + ------------------------------------------------------------------- Sun Dec 11 09:28:28 UTC 2011 - coolo@suse.com diff --git a/rpm-python.spec b/rpm-python.spec index 4178715..5af67c9 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -15,7 +15,15 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: rpm-python +Version: 4.9.1.2 +Release: 0 +#!BuildIgnore: rpmlint-Factory +Summary: Python Bindings for Manipulating RPM Packages +License: GPL-2.0+ +Group: System/Packages +Source99: rpm.spec BuildRequires: file-devel BuildRequires: libacl-devel BuildRequires: libbz2-devel @@ -30,15 +38,8 @@ BuildRequires: popt-devel BuildRequires: python-devel BuildRequires: xz-devel BuildRequires: zlib-devel -#!BuildIgnore: rpmlint-Factory -Summary: Python Bindings for Manipulating RPM Packages -License: GPL-2.0+ -Group: System/Packages -Version: 4.9.1.2 -Release: 0 Requires: rpm = %{version} %py_requires -Source99: rpm.spec %{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)} %global with_python 1 @@ -50,32 +51,21 @@ supplied by RPM Package Manager libraries. This package should be installed if you want to develop Python programs that will manipulate RPM packages and databases. - - -Authors: --------- - Erik Troan - Marc Ewing - %prep %{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')} %install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT/usr/lib +mkdir -p %{buildroot}%{_prefix}/lib # only installing in python/ does not work because rpm links against # installed libs at install time -make DESTDIR="$RPM_BUILD_ROOT" install -find "%{buildroot}" -not -type d -and -not -path %{buildroot}%{_libdir}/python%{py_ver}/site-packages/rpm/\* -print0 | xargs -0 rm -pushd $RPM_BUILD_ROOT/%py_sitedir/rpm +%make_install +find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python%{py_ver}/site-packages/rpm/\* -print0 | xargs -0 rm +pushd %{buildroot}/%py_sitedir/rpm rm -f _rpmmodule.a _rpmmodule.la python %py_libdir/py_compile.py *.py python -O %py_libdir/py_compile.py *.py popd -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(-,root,root) %{_libdir}/python*/*/* diff --git a/rpm.changes b/rpm.changes index 9929626..4fd283c 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,32 @@ +------------------------------------------------------------------- +Tue Jan 17 10:28:00 UTC 2012 - saschpe@suse.de + +- Spec file cleanup: + * Removed authors from description + * Spec-cleaner + +------------------------------------------------------------------- +Mon Jan 16 16:18:59 UTC 2012 - lnussel@suse.de + +- fix automatic kernel supplements (bnc#741543) + +------------------------------------------------------------------- +Mon Jan 16 14:12:58 UTC 2012 - werner@suse.de + +- Add patch from upstream to reflect changes of perl and python + fileattrs to file 5.10 magics + +------------------------------------------------------------------- +Fri Jan 13 14:16:14 UTC 2012 - coolo@suse.com + +- split rpmbuild into a package of its own, which then requires basic + tools to build rpms + +------------------------------------------------------------------- +Mon Jan 9 17:12:05 CET 2012 - dmueller@suse.de + +- add a python3-rpm subspecfile + ------------------------------------------------------------------- Sat Jan 7 10:50:31 CET 2012 - dmueller@suse.de diff --git a/rpm.spec b/rpm.spec index cde3558..7d0e027 100644 --- a/rpm.spec +++ b/rpm.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: rpm BuildRequires: file-devel BuildRequires: libacl-devel @@ -122,6 +123,8 @@ Patch77: mono-find-requires.diff Patch78: debugedit-stabs-warning.diff Patch79: headerchk.diff Patch80: rpm-deptracking.patch +Patch81: python3-abi-kind.diff +Patch82: perl-python-attr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -136,17 +139,12 @@ is easy to update packages. RPM keeps track of all these manipulations in a central database. This way it is possible to get an overview of all installed packages. RPM also supports database queries. - - -Authors: --------- - Erik Troan - Marc Ewing - %package devel Summary: Include Files and Libraries mandatory for Development Group: System/Packages Requires: rpm = %{version} +# for people confusing the one with the other +Recommends: rpm-build = %{version} Requires: popt-devel %description devel @@ -156,12 +154,27 @@ manipulate RPM packages and databases and are intended to make it easier to create graphical package managers or any other tools that need an intimate knowledge of RPM packages in order to function. +%package build +Summary: Tools and Scripts to create rpm packages +Group: System/Packages +Requires: rpm = %{version} +Provides: rpmbuild rpm:%_bindir/rpmbuild +# SUSE's build essentials +Requires: bzip2 +Requires: xz +Requires: gzip +Requires: binutils +Requires: make +Requires: gcc +Requires: gettext-tools +Requires: findutils +Requires: patch +Requires: glibc-devel +Requires: perl-base - -Authors: --------- - Erik Troan - Marc Ewing +%description build +If you want to build a rpm, you need this package. It provides rpmbuild +and requires some packages that are usually required %prep %setup -q -n rpm-%{version} @@ -183,7 +196,8 @@ rm -f rpmdb/db.h %patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49 %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 -%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 -P 80 +%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 +%patch -P 80 -P 81 -P 82 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov @@ -198,7 +212,7 @@ rm -f m4/libtool.m4 rm -f m4/lt*.m4 %build -export CFLAGS="$RPM_OPT_FLAGS -ffunction-sections" +export CFLAGS="%{optflags} -ffunction-sections" export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections" %ifarch alpha armv5tel export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections" @@ -229,58 +243,58 @@ make %{?_smp_mflags} make convertdb1 %install -mkdir -p $RPM_BUILD_ROOT/usr/lib -mkdir -p $RPM_BUILD_ROOT/usr/share/locale -ln -s ../share/locale $RPM_BUILD_ROOT/usr/lib/locale -make DESTDIR="$RPM_BUILD_ROOT" install -install -m 755 convertdb1 $RPM_BUILD_ROOT/usr/lib/rpm -install -m 644 db3/db.h $RPM_BUILD_ROOT/usr/include/rpm +mkdir -p %{buildroot}/usr/lib +mkdir -p %{buildroot}/usr/share/locale +ln -s ../share/locale %{buildroot}/usr/lib/locale +%make_install +install -m 755 convertdb1 %{buildroot}/usr/lib/rpm +install -m 644 db3/db.h %{buildroot}/usr/include/rpm # remove .la file and the static variant of libpopt # have to remove the dependency from other .la files as well -for f in $RPM_BUILD_ROOT/%{_libdir}/*.la; do +for f in %{buildroot}/%{_libdir}/*.la; do sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f done -mkdir -p $RPM_BUILD_ROOT/etc/init.d -install -m 755 %{SOURCE8} $RPM_BUILD_ROOT/etc/init.d -mkdir -p $RPM_BUILD_ROOT/usr/sbin -ln -sf ../../etc/init.d/rpmconfigcheck $RPM_BUILD_ROOT/usr/sbin/rcrpmconfigcheck -cp -a suse_macros $RPM_BUILD_ROOT/usr/lib/rpm -mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/suse -ln -s ../suse_macros $RPM_BUILD_ROOT/usr/lib/rpm/suse/macros +mkdir -p %{buildroot}/etc/init.d +install -m 755 %{SOURCE8} %{buildroot}/etc/init.d +mkdir -p %{buildroot}/usr/sbin +ln -sf ../../etc/init.d/rpmconfigcheck %{buildroot}/usr/sbin/rcrpmconfigcheck +cp -a suse_macros %{buildroot}/usr/lib/rpm +mkdir -p %{buildroot}/usr/lib/rpm/suse +ln -s ../suse_macros %{buildroot}/usr/lib/rpm/suse/macros for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do - mkdir -p $RPM_BUILD_ROOT/usr/src/packages/$d - chmod 755 $RPM_BUILD_ROOT/usr/src/packages/$d + mkdir -p %{buildroot}/usr/src/packages/$d + chmod 755 %{buildroot}/usr/src/packages/$d done -for d in $RPM_BUILD_ROOT/usr/lib/rpm/platform/*-linux/macros ; do +for d in %{buildroot}/usr/lib/rpm/platform/*-linux/macros ; do dd=${d%%-linux/macros} dd=${dd##*/} - mkdir $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd - chmod 755 $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd + mkdir %{buildroot}/usr/src/packages/RPMS/$dd + chmod 755 %{buildroot}/usr/src/packages/RPMS/$dd done -mkdir -p $RPM_BUILD_ROOT/var/lib/rpm -gzip -9 $RPM_BUILD_ROOT/%{_mandir}/man[18]/*.[18] +mkdir -p %{buildroot}/var/lib/rpm +gzip -9 %{buildroot}/%{_mandir}/man[18]/*.[18] export RPM_BUILD_ROOT %ifarch s390x [ -f scripts/brp-%_arch-linux ] && sh scripts/brp-%_arch-linux %endif chmod 755 doc/manual rm -rf doc/manual/Makefile* -rm -f $RPM_BUILD_ROOT/usr/lib/rpmpopt -rm -rf $RPM_BUILD_ROOT%{_mandir}/{fr,ja,ko,pl,ru,sk} -rm -f $RPM_BUILD_ROOT%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo -mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates -install -c -m0644 %{SOURCE9} $RPM_BUILD_ROOT/var/adm/fillup-templates/ -rm -f $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute2 -install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm -install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm -install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm -install -m 755 scripts/firmware.prov $RPM_BUILD_ROOT/usr/lib/rpm -install -m 755 scripts/debuginfo.prov $RPM_BUILD_ROOT/usr/lib/rpm -rm -f $RPM_BUILD_ROOT/usr/lib/locale $RPM_BUILD_ROOT/usr/lib/rpmrc -mkdir -p $RPM_BUILD_ROOT/etc/rpm -chmod 755 $RPM_BUILD_ROOT/etc/rpm +rm -f %{buildroot}/usr/lib/rpmpopt +rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk} +rm -f %{buildroot}%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo +mkdir -p %{buildroot}/var/adm/fillup-templates +install -c -m0644 %{SOURCE9} %{buildroot}/var/adm/fillup-templates/ +rm -f %{buildroot}/usr/lib/rpm/cpanflute %{buildroot}/usr/lib/rpm/cpanflute2 +install -m 755 %{SOURCE5} %{buildroot}/usr/lib/rpm +install -m 755 %{SOURCE6} %{buildroot}/usr/lib/rpm +install -m 755 scripts/find-supplements{,.ksyms} %{buildroot}/usr/lib/rpm +install -m 755 scripts/firmware.prov %{buildroot}/usr/lib/rpm +install -m 755 scripts/debuginfo.prov %{buildroot}/usr/lib/rpm +rm -f %{buildroot}/usr/lib/locale %{buildroot}/usr/lib/rpmrc +mkdir -p %{buildroot}/etc/rpm +chmod 755 %{buildroot}/etc/rpm # remove some nonsense or non-working scripts -pushd $RPM_BUILD_ROOT/usr/lib/rpm/ +pushd %{buildroot}/usr/lib/rpm/ 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 \ @@ -295,20 +309,17 @@ for i in /usr/share/automake-*/*; do done popd gzip -9 CHANGES -rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver} -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/rpm-plugins/*.la -sh $RPM_BUILD_ROOT/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT rpm +rm -rf %{buildroot}/%{_libdir}/python%{py_ver} +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{_libdir}/rpm-plugins/*.la +sh %{buildroot}/usr/lib/rpm/find-lang.sh %{buildroot} rpm %ifarch armv7hl # rpm is using the host_cpu as default for the platform, but armv7hl is not known by the kernel. # so we need to enforce the platform here. # We don't want to use armv7l because it would make us incompatible to Fedora and MeeGo plattforms. -echo -n armv7hl-suse-linux> $RPM_BUILD_ROOT/etc/rpm/platform +echo -n armv7hl-suse-linux> %{buildroot}/etc/rpm/platform %endif -%clean -rm -rf $RPM_BUILD_ROOT - %post %{fillup_only -an services} test -f var/lib/rpm/Packages || rpm --initdb @@ -332,6 +343,7 @@ rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion va /etc/rpm /bin/rpm /usr/bin/* + %exclude /usr/bin/rpmbuild /etc/init.d/rpmconfigcheck /usr/sbin/rcrpmconfigcheck /usr/lib/rpm @@ -351,6 +363,10 @@ rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion va %dir %attr(755,root,root) /usr/src/packages/RPMS/* /var/adm/fillup-templates/sysconfig.services-rpm +%files build +%defattr(-,root,root) +/usr/bin/rpmbuild + %files devel %defattr(644,root,root,755) /usr/include/rpm