diff --git a/Makefile b/Makefile index cb31df6..ba8d6e6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NAME := yum +NAME := python2-yum SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common diff --git a/yum.spec b/python2-yum.spec similarity index 89% rename from yum.spec rename to python2-yum.spec index c91ad69..1ce7d33 100644 --- a/yum.spec +++ b/python2-yum.spec @@ -6,6 +6,7 @@ %define yum_updatesd 0 %define disable_check 1 %define yum_cron_systemd 1 +%define namer yum %if %{auto_sitelib} @@ -27,13 +28,13 @@ %define compdir %{_sysconfdir}/bash_completion.d %endif -Summary: RPM package installer/updater/manager -Name: yum +Summary: Python 2 yum modules +Name: python2-yum Version: 3.4.3 Release: 168.2%{?dist} License: GPLv2+ Group: System Environment/Base -Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz +Source0: http://yum.baseurl.org/download/3.4/%{namer}-%{version}.tar.gz Source1: yum.conf.centos Source2: yum-updatesd.conf.fedora Patch1: yum-distro-configs.patch @@ -194,6 +195,15 @@ Patch1000: centos-branding-yum.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch + +Requires: python2 +Requires: python2-rpmUtils = %{version}-%{release} +Requires: python2-urlgrabber +Requires: yum-metadata-parser +Requires: python2-backports-lzma + + + BuildRequires: python2 BuildRequires: gettext BuildRequires: intltool @@ -206,111 +216,16 @@ BuildRequires: rpm-python, rpm >= 0:4.4.2 # BuildRequires: yum-metadata-parser >= 1.1.0 # BuildRequires: pygpgme # End of CheckRequires -Conflicts: pirut < 1.1.4 Requires: python2 -Requires: yum-plugin-fastestmirror -Requires: rpm-python, rpm >= 0:4.11.3-22 -Requires: python-iniparse -Requires: python-sqlite -Requires: python-urlgrabber >= 3.10-8 -Requires: yum-metadata-parser >= 1.1.0 -Requires: pygpgme -# rawhide is >= 0.5.3-7.fc18 ... as this is added. -Requires: pyliblzma -# Not really a suggests anymore, due to metadata using it. -Requires: pyxattr -# Suggests, needed for yum fs diff -Requires: diffutils -Requires: cpio -Requires: python2-yum = %{version}-%{release} - - -Conflicts: rpm >= 5-0 -# Zif is a re-implementation of yum in C, however: -# -# 1. There is no co-operation/etc. with us. -# 2. It touches our private data directly. -# -# ...both of which mean that even if there were _zero_ bugs in zif, we'd -# never be able to change anything after the first user started using it. And -# of course: -# -# 3. Users will never be able to tell that it isn't weird yum bugs, when they -# hit them (and we'll probably never be able to debug them, without becoming -# zif experts). -# -# ...so we have two sane choices: i) Conflict with it. 2) Stop developing yum. -# -# Upstream says that #2 will no longer be true after this release. -Conflicts: zif <= 0.1.3-3.fc15 - -Obsoletes: yum-skip-broken <= 1.1.18 -Provides: yum-skip-broken = 1.1.18.yum -Obsoletes: yum-basearchonly <= 1.1.9 -Obsoletes: yum-plugin-basearchonly <= 1.1.9 -Provides: yum-basearchonly = 1.1.9.yum -Provides: yum-plugin-basearchonly = 1.1.9.yum -Obsoletes: yum-allow-downgrade < 1.1.20-0 -Obsoletes: yum-plugin-allow-downgrade < 1.1.22-0 -Provides: yum-allow-downgrade = 1.1.20-0.yum -Provides: yum-plugin-allow-downgrade = 1.1.22-0.yum -Obsoletes: yum-plugin-protect-packages < 1.1.27-0 -Provides: yum-protect-packages = 1.1.27-0.yum -Provides: yum-plugin-protect-packages = 1.1.27-0.yum -Obsoletes: yum-plugin-download-order <= 0.2-2 -Obsoletes: yum-plugin-downloadonly <= 1.1.31-7.fc18 -Provides: yum-plugin-downloadonly = 3.4.3-44.yum -Obsoletes: yum-presto < 3.4.3-66.yum -Provides: yum-presto = 3.4.3-66.yum -Obsoletes: yum-plugin-security < 1.1.32 -Provides: yum-plugin-security = 3.4.3-84.yum +#Requires: python-urlgrabber >= 3.10-8 +#Requires: yum-metadata-parser >= 1.1.0 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description -Yum is a utility that can check for and automatically download and -install updated RPM packages. Dependencies are obtained and downloaded -automatically, prompting the user for permission as necessary. - -%package updatesd -Summary: Update notification daemon -Group: Applications/System -Requires: yum = %{version}-%{release} -Requires: dbus-python -Requires: pygobject2 -Requires(preun): /sbin/chkconfig -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(post): /sbin/service -Requires(postun): /sbin/chkconfig -Requires(postun): /sbin/service - - -%description updatesd -yum-updatesd provides a daemon which checks for available updates and -can notify you when they are available via email, syslog or dbus. - -%package cron -Summary: Files needed to run yum updates as a cron job -Group: System Environment/Base -Requires: yum >= 3.4.3-84 cronie crontabs findutils -%if %{yum_cron_systemd} -BuildRequires: systemd-units -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -%else -Requires(post): /sbin/chkconfig -Requires(post): /sbin/service -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(postun): /sbin/service -%endif - -%description cron -These are the files needed to run yum updates as a cron job. -Install this package if you want auto yum updates nightly via cron. +The python2-yum package contains modules that permit applications written in the Python programming language to use the interface supplied by the YUM Package Manager Libraries. +This package should be installed if you want to develop Python 2 programs that will manipulate RPM packages and YUM repositories and databases. %package -n python2-rpmUtils Summary: Python 2 rpmUtils modules @@ -326,23 +241,9 @@ Package Manager Libraries. This package should be installed if you want to develop Python 2 programs that will query and manipulate the RPM database. -%package -n python2-yum -Summary: Python 2 yum modules -Group: System Environment/Base -Requires: python2 -Requires: python2-rpmUtils = %{version}-%{release} -Requires: python2-urlgrabber -Requires: yum-metadata-parser -Requires: python2-backports-lzma - -%description -n python2-yum -The python2-yum package contains modules that permit applications written in the Python programming language to use the interface supplied by the YUM Package Manager Libraries. - -This package should be installed if you want to develop Python 2 programs taht will manipulate RPM packages and YUM repositories and databases. - %prep -%setup -q +%setup -q -n %{namer}-%{version} %patch5 -p1 %patch6 -p1 %patch7 -p1 @@ -556,7 +457,7 @@ chmod +x $RPM_BUILD_ROOT/%{_datadir}/yum-cli/*.py chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/yum/*.py chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rpmUtils/*.py -%find_lang %name +##%#find_lang %name %if %{yum_cron_systemd} # Remove the yum-cron sysV stuff to make rpmbuild happy.. @@ -570,165 +471,11 @@ rm -f $RPM_BUILD_ROOT/%{_unitdir}/yum-cron.service [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -%if %{yum_updatesd} -%post updatesd -/sbin/chkconfig --add yum-updatesd -/sbin/service yum-updatesd condrestart >/dev/null 2>&1 -exit 0 - -%preun updatesd -if [ $1 = 0 ]; then - /sbin/chkconfig --del yum-updatesd - /sbin/service yum-updatesd stop >/dev/null 2>&1 -fi -exit 0 -%endif - -%post cron - -%if %{yum_cron_systemd} -#systemd_post yum-cron.service -# Do this manually because it's a fake service for a cronjob, and cronjobs -# are default on atm. This may change in the future. -if [ $1 = 1 ]; then - systemctl enable yum-cron >/dev/null 2>&1 -else -# Note that systemctl preset is being run here ... but _only_ on initial -# install. So try this... - -if [ -f /var/lock/subsys/yum-cron -a -f /etc/rc.d/init.d/yum-cron ]; then - systemctl enable yum-cron >/dev/null 2>&1 -fi -fi - -# Also note: -# systemctl list-unit-files | fgrep yum-cron -%else -# SYSV init post cron -# Make sure chkconfig knows about the service -/sbin/chkconfig --add yum-cron -# if an upgrade: -if [ "$1" -ge "1" ]; then -# if there's a /etc/rc.d/init.d/yum file left, assume that there was an -# older instance of yum-cron which used this naming convention. Clean -# it up, do a conditional restart - if [ -f /etc/init.d/yum ]; then -# was it on? - /sbin/chkconfig yum - RETVAL=$? - if [ $RETVAL = 0 ]; then -# if it was, stop it, then turn on new yum-cron - /sbin/service yum stop 1> /dev/null 2>&1 - /sbin/service yum-cron start 1> /dev/null 2>&1 - /sbin/chkconfig yum-cron on - fi -# remove it from the service list - /sbin/chkconfig --del yum - fi -fi -exit 0 -%endif - -%preun cron -%if %{yum_cron_systemd} -%systemd_preun yum-cron.service -%else -# SYSV init preun cron -# if this will be a complete removeal of yum-cron rather than an upgrade, -# remove the service from chkconfig control -if [ $1 = 0 ]; then - /sbin/chkconfig --del yum-cron - /sbin/service yum-cron stop 1> /dev/null 2>&1 -fi -exit 0 -%endif - -%postun cron -%if %{yum_cron_systemd} -%systemd_postun_with_restart yum-cron.service -%else -# SYSV init postun cron - -# If there's a yum-cron package left after uninstalling one, do a -# conditional restart of the service -if [ "$1" -ge "1" ]; then - /sbin/service yum-cron condrestart 1> /dev/null 2>&1 -fi -exit 0 -%endif - - -%files -f %{name}.lang -%defattr(-, root, root, -) -%doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS docs/comps.rng -%if %{move_yum_conf_back} -%config(noreplace) %{_sysconfdir}/yum.conf -%dir %{_sysconfdir}/yum.repos.d -%else -%config(noreplace) %{_sysconfdir}/yum/yum.conf -%dir %{_sysconfdir}/yum/repos.d -%endif -%config(noreplace) %{_sysconfdir}/yum/version-groups.conf -%dir %{_sysconfdir}/yum -%dir %{_sysconfdir}/yum/protected.d -%dir %{_sysconfdir}/yum/fssnap.d -%dir %{_sysconfdir}/yum/vars -%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 -%(dirname %{compdir}) -%else -%{compdir} -%endif -%dir %{_datadir}/yum-cli -%{_datadir}/yum-cli/* -%exclude %{_datadir}/yum-cli/completion-helper.py? -%if %{yum_updatesd} -%exclude %{_datadir}/yum-cli/yumupd.py* -%endif -%{_bindir}/yum -%dir /var/cache/yum -%dir /var/lib/yum -%ghost /var/lib/yum/uuid -%ghost /var/lib/yum/history -%ghost /var/lib/yum/plugins -%ghost /var/lib/yum/yumdb -%{_mandir}/man*/yum.* -%{_mandir}/man*/yum-shell* -# plugin stuff -%dir %{_sysconfdir}/yum/pluginconf.d -%dir %{yum_pluginslib} -%dir %{yum_pluginsshare} - -%files cron -%defattr(-,root,root) -%doc COPYING -%{_sysconfdir}/cron.daily/0yum-daily.cron -%{_sysconfdir}/cron.hourly/0yum-hourly.cron -%config(noreplace) %{_sysconfdir}/yum/yum-cron.conf -%config(noreplace) %{_sysconfdir}/yum/yum-cron-hourly.conf -%if %{yum_cron_systemd} -%{_unitdir}/yum-cron.service -%else -%{_sysconfdir}/rc.d/init.d/yum-cron -%endif -%{_sbindir}/yum-cron -%{_mandir}/man*/yum-cron.* - -%if %{yum_updatesd} -%files updatesd -%defattr(-, root, root) -%config(noreplace) %{_sysconfdir}/yum/yum-updatesd.conf -%config %{_sysconfdir}/rc.d/init.d/yum-updatesd -%config %{_sysconfdir}/dbus-1/system.d/yum-updatesd.conf -%{_datadir}/yum-cli/yumupd.py* -%{_sbindir}/yum-updatesd -%{_mandir}/man*/yum-updatesd* -%endif %files -n python2-rpmUtils %{python_sitelib}/rpmUtils -%files -n python2-yum +%files %{python_sitelib}/yum