[mock/el6] import 1.2.1 from upstream

Miroslav Suchý msuchy at fedoraproject.org
Sun Nov 16 17:00:53 UTC 2014


commit 868497f0df9eca787beba5e1f7559e70c85084e3
Author: Miroslav Suchý <msuchy at redhat.com>
Date:   Sun Nov 16 17:29:51 2014 +0100

    import 1.2.1 from upstream

 .gitignore |    1 +
 mock.spec  |  115 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 sources    |    2 +-
 3 files changed, 97 insertions(+), 21 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 418f372..3fae736 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ mock-1.1.4.tar.gz
 /mock-1.1.40.tar.xz
 /mock-1.1.41.tar.xz
 /mock-1.2.0.tar.xz
+/mock-1.2.1.tar.xz
diff --git a/mock.spec b/mock.spec
index 6eee1d8..99057f6 100644
--- a/mock.spec
+++ b/mock.spec
@@ -1,12 +1,26 @@
 # next four lines substituted by autoconf
 %define major 1
 %define minor 2
-%define sub 0
+%define sub 1
 %define extralevel %{nil}
 %define release_version %{major}.%{minor}.%{sub}%{extralevel}
 
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
+%if 0%{?fedora} > 21
+%global use_python3 1
+%global use_python2 0
+%else
+%global use_python3 0
+%global use_python2 1
+%endif
+
+%if %{use_python3}
+%global python_sitelib %{python3_sitelib}
+%else
+%global python_sitelib %{python_sitelib}
+%endif
+
 # mock group id allocate for Fedora
 %global mockgid  135
 
@@ -18,11 +32,9 @@ License: GPLv2+
 Source: https://git.fedorahosted.org/cgit/mock.git/snapshot/%{name}-%{version}.tar.xz
 URL: http://fedoraproject.org/wiki/Projects/Mock
 BuildArch: noarch
-Requires: python >= 2.6
 Requires: yum >= 2.4
 Requires: tar
 Requires: pigz
-Requires: python-ctypes
 Requires: usermode
 Requires: yum-utils
 Requires: createrepo_c
@@ -32,10 +44,24 @@ Requires: systemd
 %endif
 Requires(pre): shadow-utils
 Requires(post): coreutils
-BuildRequires: python-devel, autoconf, automake
+BuildRequires: autoconf, automake
 %if 0%{?fedora} || 0%{?rhel} > 6
 BuildRequires: bash-completion
 %endif
+%if %{use_python3}
+Requires: python3
+Requires: python3-six
+Requires: python3-requests
+Requires: rpm-python3
+BuildRequires: python3-devel
+%else
+Requires: python-ctypes
+Requires: python-six
+Requires: python-requests
+Requires: python >= 2.6
+BuildRequires: python-devel
+%endif
+
 
 %description
 Mock takes an SRPM and builds it in a chroot.
@@ -51,7 +77,7 @@ Requires: tar
 %description scm
 Mock SCM integration module.
 
-%if 0%{?rhel} != 6
+%if 0%{?rhel} != 6 && %{use_python2}
 # lvm plugin requires lvm2-python-libs, kernel >= 3.0 and glibc >= 2.14, which
 # are not available on el6
 %package lvm
@@ -71,6 +97,12 @@ of the buildroot.
 %if 0%{?rhel} == 6
 sed -i "s|^USE_NSPAWN = True|USE_NSPAWN = False|" py/mockbuild/util.py
 %endif
+%if %{use_python3}
+sed -i 's/AM_PATH_PYTHON/AM_PATH_PYTHON([3])/' configure.ac
+for file in py/mock.py py/mockchain.py; do
+  sed -i 1"s|#!/usr/bin/python |#!/usr/bin/python3 |" $file
+done
+%endif
 
 %build
 autoreconf -vif
@@ -114,22 +146,22 @@ exit 0
 # fix cache permissions from old installs
 chmod 2775 %{_localstatedir}/cache/%{name}
 
-if [ ! -e %{_sysconfdir}/%{name}/default.cfg ]; then
-    if [ -e /etc/fedora-release ]
-    then
-        if grep -Fq Rawhide /etc/fedora-release; then
-            ver=rawhide
-        else
-            ver=$(rpm -q --nosignature --qf "%{VERSION}" --whatprovides fedora-release)
-        fi
+if [ -e /etc/os-release ]; then
+    # fedora and rhel7
+    if grep -Fq Rawhide /etc/os-release; then
+        ver=rawhide
     else
-        ver=$(rpm -q --nosignature --qf "%{VERSION}" --whatprovides redhat-release | cut -d. -f1 | grep -o '[0-9]\+')
+        ver=$(source /etc/os-release && echo $VERSION_ID | cut -d. -f1 | grep -o '[0-9]\+')
     fi
-
-    mock_arch=$(python -c "import rpmUtils.arch; baseArch = rpmUtils.arch.getBaseArch(); print baseArch")
-    cfg=%{?fedora:fedora}%{?rhel:epel}-$ver-${mock_arch}.cfg
-    [ -e %{_sysconfdir}/%{name}/$cfg ] || exit -2
-    ln -s -f $cfg %{_sysconfdir}/%{name}/default.cfg
+else
+    # rhel6 or something obsure, use buildtime version
+    ver=%{?rhel}%{?fedora}
+fi
+mock_arch=$(python -c "import rpmUtils.arch; baseArch = rpmUtils.arch.getBaseArch(); print baseArch")
+cfg=%{?fedora:fedora}%{?rhel:epel}-$ver-${mock_arch}.cfg
+[ -e %{_sysconfdir}/%{name}/$cfg ] || exit -2
+if [ "$(readlink %{_sysconfdir}/%{name}/default.cfg)" != "$cfg" ]; then
+  ln -s $cfg %{_sysconfdir}/%{name}/default.cfg 2>/dev/null || ln -s -f $cfg %{_sysconfdir}/%{name}/default.cfg.rpmnew
 fi
 :
 
@@ -170,12 +202,55 @@ fi
 %files scm
 %{python_sitelib}/mockbuild/scm.py*
 
-%if 0%{?rhel} != 6
+%if 0%{?rhel} != 6 && %{use_python2}
 %files lvm
 %{python_sitelib}/mockbuild/plugins/lvm_root.*
 %endif
 
 %changelog
+* Sat Nov 15 2014 Miroslav Suchý <msuchy at redhat.com> - 1.2.1-1
+- allow mockchain to accept path as config
+- end yum's installroot path with a slash [RHBZ#1160428]
+- add --mount option [RHBZ#1162637]
+- add some missing bash completation strings
+- run --shell as root with --new-chroot
+- Don't fail scrub when there's no pool [RHBZ#1162631]
+- Globbing and tilde expansion
+- move restoring priviledges to finally [RHBZ#1162720]
+- Remove "Buildroot must be already initialized" note
+- Add missing --print-root-path to manpage
+- Do not print ANSI escape characters into log [RHBZ#1163037]
+- in site-defaults.cfg initialize dictionary of plugins [RHBZ#1162595]
+- Disable empty names and values in config_opts[macros] [RHBZ#1160765]
+- Disable single macros in -D cmd option [RHBZ#1160765]
+- rpmbuild is in /usr/bin [RHBZ#1161112]
+- man page for --macro-file [RHBZ#1160326]
+- Added option [--macro-file] to support external rpm macros file [RHBZ#1160326]
+- Don't output installation/build output when redirected
+- Better log message for intial buildroot installation
+- Be more specific when installing configs
+- Install into correct sitelib when using Python 3
+- Fix nosync on aarch64
+- wrap all remaining getcwd() [RHBZ#1159300]
+- do not use rpm in %post scriptlet [RHBZ#1131279]
+- Fix unclear legal host output [RHBZ#1159794]
+- allow running from directory, which is deleted [RHBZ#1159300]
+- create compress_logs plugin [RHBZ#1100923]
+- when default.cfg exists create default.cfg.rpmnew [RHBZ#1085308]
+- accept paths to target definition files [RHBZ#1126117]
+- set title bar in xterm [RHBZ#1126235]
+- pass --enablerepo/--disablerepo to yum in the same order as provided to mock [RHBZ#1154604]
+- Fix incorrect printing of binary strings on py3
+- Add missing Requires rpm-python3
+- Don't print Yum and build output when quiet
+- Prevent output being printed twice with --verbose (rhbz#1152971)
+- Fix printing non-ascii characters with output redirected (rhbz#1152952)
+- replace urlgrabber by python-requests
+- use python3 for Fedora22+
+- Don't print we're doing rpmbuild -bb, when it may not be true
+- 'prep' choice missing in short-circuit option parser
+- Don't execute prebuild in short-circuit mode
+
 * Thu Oct  9 2014 Miroslav Suchý <msuchy at redhat.com> - 1.2.0-1
 - update configs for secondary architecture (Dan Horák)
 - caching of buildroots using LVM (Michael Simacek)
diff --git a/sources b/sources
index 25d60b5..c02ff51 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-30ed62d7eac7506b9a01549ad2cee491  mock-1.2.0.tar.xz
+e46681d59a01cc2c1396f8a6e772b93e  mock-1.2.1.tar.xz


More information about the scm-commits mailing list