From d9bf0ed93b7e843f71d0e24313e5a2da65a7af4e Mon Sep 17 00:00:00 2001 From: Miroslav Suchý Date: Jan 01 2017 11:36:28 +0000 Subject: Merge branch 'master' into f24 --- diff --git a/.gitignore b/.gitignore index 1f58974..e656600 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,5 @@ mock-1.1.4.tar.gz /mock-1.2.19.tar.xz /mock-1.2.20.tar.xz /mock-1.2.21.tar.xz +/mock-1.3.2.tar.gz +/mock-1.3.3.tar.gz diff --git a/mock.spec b/mock.spec index 1e6e503..3da06cb 100644 --- a/mock.spec +++ b/mock.spec @@ -1,10 +1,3 @@ -# next four lines substituted by autoconf -%global major 1 -%global minor 2 -%global sub 21 -%global extralevel %{nil} -%global release_version %{major}.%{minor}.%{sub}%{extralevel} - %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %if 0%{?fedora} > 21 @@ -26,11 +19,11 @@ Summary: Builds packages inside chroots Name: mock -Version: %{release_version} +Version: 1.3.3 Release: 1%{?dist} License: GPLv2+ -Source: https://fedorahosted.org/releases/m/o/mock/%{name}-%{version}.tar.xz -URL: https://fedoraproject.org/wiki/Mock +Source: https://fedorahosted.org/releases/m/o/mock/%{name}-%{version}.tar.gz +URL: https://github.com/rpm-software-management/mock/ BuildArch: noarch %if 0%{?fedora} > 21 Requires: yum >= 3.4.3-505 @@ -42,7 +35,7 @@ Requires: pigz Requires: usermode Requires: yum-utils Requires: createrepo_c -Requires: distribution-gpg-keys >= 1.6 +Requires: distribution-gpg-keys >= 1.9 %if 0%{?use_python2} Requires: pyliblzma %endif @@ -66,13 +59,17 @@ BuildRequires: bash-completion %endif %if %{use_python3} Requires: python3 -Requires: python3-six +Requires: python3-distro +Requires: python3-six >= 1.4.0 Requires: python3-requests Requires: rpm-python3 BuildRequires: python3-devel +#check +BuildRequires: python3-pylint %else Requires: python-ctypes -Requires: python-six +Requires: python2-distro +Requires: python-six >= 1.4.0 Requires: python-requests Requires: python >= 2.6 Requires: rpm-python @@ -86,7 +83,7 @@ Recommends: btrfs-progs %if 0%{?rhel} >= 7 Requires: btrfs-progs %endif - +BuildRequires: perl %description Mock takes an SRPM and builds it in a chroot. @@ -117,51 +114,81 @@ of the buildroot. 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 -%configure -make +for i in py/mock.py py/mockchain.py; do + perl -p -i -e 's|^__VERSION__\s*=.*|__VERSION__="%{version}"|' $i + perl -p -i -e 's|^SYSCONFDIR\s*=.*|SYSCONFDIR="%{_sysconfdir}"|' $i + perl -p -i -e 's|^PYTHONDIR\s*=.*|PYTHONDIR="%{python_sitelib}"|' $i + perl -p -i -e 's|^PKGPYTHONDIR\s*=.*|PKGPYTHONDIR="%{python_sitelib}/mockbuild"|' $i +done +for i in docs/mockchain.1 docs/mock.1; do + perl -p -i -e 's|@VERSION@|%{version}"|' $i +done %install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -mkdir -p $RPM_BUILD_ROOT/var/lib/mock -mkdir -p $RPM_BUILD_ROOT/var/cache/mock -ln -s consolehelper $RPM_BUILD_ROOT/usr/bin/mock +install -d %{buildroot}%{_bindir} +install -d %{buildroot}%{_libexecdir}/mock +install py/mockchain.py %{buildroot}%{_bindir}/mockchain +install py/mock.py %{buildroot}%{_libexecdir}/mock/mock +ln -s consolehelper %{buildroot}%{_bindir}/mock -echo "%defattr(0644, root, mock)" > %{name}.cfgs -find $RPM_BUILD_ROOT%{_sysconfdir}/mock -name "*.cfg" \ - | sed -e "s|^$RPM_BUILD_ROOT|%%config(noreplace) |" >> %{name}.cfgs +install -d %{buildroot}%{_sysconfdir}/pam.d +cp -a etc/pam/* %{buildroot}%{_sysconfdir}/pam.d/ -# just for %%ghosting purposes -ln -s fedora-rawhide-x86_64.cfg $RPM_BUILD_ROOT%{_sysconfdir}/mock/default.cfg +install -d %{buildroot}%{_sysconfdir}/mock +cp -a etc/mock/* %{buildroot}%{_sysconfdir}/mock/ + +install -d %{buildroot}%{_sysconfdir}/security/console.apps/ +cp -a etc/consolehelper/mock %{buildroot}%{_sysconfdir}/security/console.apps/%{name} + +install -d %{buildroot}%{_datadir}/bash-completion/completions/ +cp -a etc/bash_completion.d/* %{buildroot}%{_datadir}/bash-completion/completions/ +ln -s mock %{buildroot}%{_datadir}/bash-completion/completions/mockchain + +install -d %{buildroot}%{_sysconfdir}/pki/mock +cp -a etc/pki/* %{buildroot}%{_sysconfdir}/pki/mock/ + +install -d %{buildroot}%{python_sitelib}/ +cp -a py/mockbuild %{buildroot}%{python_sitelib}/ -if [ -d $RPM_BUILD_ROOT%{_datadir}/bash-completion ]; then +install -d %{buildroot}%{_mandir}/man1 +cp -a docs/mockchain.1 docs/mock.1 %{buildroot}%{_mandir}/man1/ + +install -d %{buildroot}/var/lib/mock +install -d %{buildroot}/var/cache/mock + +# generate files section with config - there is many of them +echo "%defattr(0644, root, mock)" > %{name}.cfgs +find %{buildroot}%{_sysconfdir}/mock -name "*.cfg" \ + | sed -e "s|^%{buildroot}|%%config(noreplace) |" >> %{name}.cfgs +# just for %%ghosting purposes +ln -s fedora-rawhide-x86_64.cfg %{buildroot}%{_sysconfdir}/mock/default.cfg +# bash-completion +if [ -d %{buildroot}%{_datadir}/bash-completion ]; then echo %{_datadir}/bash-completion/completions/mock >> %{name}.cfgs echo %{_datadir}/bash-completion/completions/mockchain >> %{name}.cfgs -elif [ -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d ]; then +elif [ -d %{buildroot}%{_sysconfdir}/bash_completion.d ]; then echo %{_sysconfdir}/bash_completion.d/mock >> %{name}.cfgs fi %if 0%{?rhel} == 6 # can be removed when yum-utils >= 1.1.31 lands in el6 - echo "config_opts['plugin_conf']['package_state_enable'] = False" >> $RPM_BUILD_ROOT%{_sysconfdir}/mock/site-defaults.cfg - echo "config_opts['use_nspawn'] = False" >> $RPM_BUILD_ROOT%{_sysconfdir}/mock/site-defaults.cfg + echo "config_opts['plugin_conf']['package_state_enable'] = False" >> %{buildroot}%{_sysconfdir}/mock/site-defaults.cfg + echo "config_opts['use_nspawn'] = False" >> %{buildroot}%{_sysconfdir}/mock/site-defaults.cfg %endif -%pre + +%pre # check for existence of mock group, create it if not found getent group mock > /dev/null || groupadd -f -g %mockgid -r mock exit 0 %post - # fix cache permissions from old installs chmod 2775 %{_localstatedir}/cache/%{name} @@ -188,13 +215,17 @@ else fi : +%check +# ignore the errors for now, just print them and hopefully somebody will fix it one day +python3-pylint py/mockbuild/ py/*.py || : + %files -f %{name}.cfgs %defattr(-, root, root) # executables %{_bindir}/mock %{_bindir}/mockchain -%attr(0755, root, root) %{_sbindir}/mock +%{_libexecdir}/mock # python stuff %{python_sitelib}/* @@ -215,7 +246,6 @@ fi # docs %{_mandir}/man1/mock.1* %{_mandir}/man1/mockchain.1* -%doc ChangeLog # cache & build dirs %defattr(0775, root, mock, 02775) @@ -229,8 +259,60 @@ fi %{python_sitelib}/mockbuild/plugins/lvm_root.* %changelog +* Sun Jan 01 2017 Miroslav Suchý 1.3.3-1 +- use F25 for tests +- handle cwd directories with spaces [RHBZ#1389663] +- add config option `hostname` to set hostname + (constantine.peresypk@rackspace.com) +- use DNF on RHEL, when it is installed and configured [RHBZ#1405783] +- use best=1 for DNF +- error is not iterable [RHBZ#1387895] +- use best=true for dnf.conf for repos passed to mockchain using -a +- add epel-7-aarch64 config +- better naming for tmp directories +- Remove tmpdirs regardless of buildroot existence (msimacek@redhat.com) +- clarify examples of using more_buildreqs feature + (gitDeveloper@bitthinker.com) +- fix more_buildreqs case: correctly compare if req is basestring + (gitDeveloper@bitthinker.com) +- fix formating a bit (gitDeveloper@bitthinker.com) +- add missing step in 'getting & compiling' part (gitDeveloper@bitthinker.com) +- Add bash completion for .cfg files outside /etc/mock (#20) + (github@kayari.org) +- man: example how to use --plugin-option +- require most recent distribution-gpg-keys to get F25 keys +- man: state that shell does not produce logs +- Delay mounting of user-defined mountpoints (rhbz#1386544) + (msimacek@redhat.com) +- man: clarify chroot cleanups + +* Mon Oct 17 2016 Miroslav Suchý 1.3.2-1 +- flake8 fixes +- correctly escape --nocheck [GH#2] (msuchy@redhat.com) +- change hostname in container [RHBZ#1302040] (msuchy@redhat.com) +- example how to change hostname in container [RHBZ#1302040] + (msuchy@redhat.com) +- skip unshare() if running inside of Docker [RHBZ#1336750] (msuchy@redhat.com) +- Bring back logging.raiseExceptions = 0 (ville.skytta@iki.fi) +- Purge no longer needed Python < 2.5 workarounds (ville.skytta@iki.fi) +- Purge no longer needed six < 1.4.0 workaround (ville.skytta@iki.fi) +- run pylint during %%check phase (msuchy@redhat.com) + +* Tue Sep 27 2016 Miroslav Suchý 1.3.1-1 +- remove F21 GPG keys +- remove F22 configs +- update upstream URL +- move /usr/sbin/mock to /usr/libexec/mock/mock [RHBZ#1246810] +- Initialized to use tito. +- add pylint config +* Tue Sep 13 2016 Miroslav Suchý - 1.2.21-1 +- CVE-2016-6299 - fixed root rights escalation in mock-scm +- root_cache: Mention _root_ cache being created in state updates +- Rename mageia pubkey to RPM-GPG-KEY-Mageia +- require generic system-release rather than fedora-release [RHBZ#1367746] + * Wed Aug 17 2016 Miroslav Suchý - 1.2.20-1 -- use epel GPG keys for epel +- use epel GPG keys for epel * Wed Aug 10 2016 Miroslav Suchý - 1.2.19-1 - disable tmpfs plugin for init-clean test diff --git a/sources b/sources index 8cef19e..a23c7c4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c330b6defb51f463f82adca5b13cffbc mock-1.2.21.tar.xz +SHA512 (mock-1.3.3.tar.gz) = 41e1daea77d5d3ecba188ed8edc889f4b1f45a5b5bf6b796c7a0e1c46b21fc4f63f11e87cbefc789ef12ffd39dc00bcee480733278b7761970fdaf08f0ecc025