diff --git a/mock-2.2.tar.gz b/mock-2.2.tar.gz deleted file mode 100644 index addaf0d04c72fa72e2063e929ae3e680894b23ed..0000000000000000000000000000000000000000 Binary files a/mock-2.2.tar.gz and /dev/null differ diff --git a/mock-5.6.tar.gz b/mock-5.6.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f053bbf11cb5d21a1da0436ad34ace7dd29bac68 Binary files /dev/null and b/mock-5.6.tar.gz differ diff --git a/mock.spec b/mock.spec index d4df753d3fd6cfe85f56810cb4c9f589f5ea4590..c5fdcd24c76259bd355de99efeb4c2abc72d5a80 100644 --- a/mock.spec +++ b/mock.spec @@ -1,20 +1,19 @@ -%global use_python3 1 -%global use_python2 0 + +%bcond_with lint +%bcond_without tests + %global __python %{__python3} %global python_sitelib %{python3_sitelib} Summary: Builds packages inside chroots Name: mock -Version: 2.2 -Release: 1 -License: GPLv2+ -Source: %{name}-%{version}.tar.gz +Version: 5.6 +Release: 2 +License: GPL-2.0-or-later +Source: https://github.com/rpm-software-management/mock/releases/download/mock-2.2-1/%{name}-%{version}.tar.gz URL: https://github.com/rpm-software-management/mock/ -Source1: mock_config.default BuildArch: noarch BuildRequires: bash-completion -BuildRequires: perl-interpreter -%if %{use_python3} Requires: python3-distro Requires: python3-jinja2 Requires: python3-six >= 1.4.0 @@ -22,13 +21,23 @@ Requires: python3-requests Requires: python3-rpm Requires: python3-pyroute2 BuildRequires: python3-devel +BuildRequires: python3-backoff +%if %{with lint} +BuildRequires: python3-pylint %endif - +BuildRequires: python3-rpm +BuildRequires: python3-rpmautospec-core Requires: tar Requires: pigz Requires: usermode Requires: createrepo_c + +# We know that the current version of mock isn't compatible with older variants, +# and we want to enforce automatic upgrades. + +Requires: mock-core-configs + Requires: systemd Requires: systemd-container Requires: coreutils @@ -38,18 +47,68 @@ Requires: procps-ng Requires: dnf Requires: dnf-plugins-core +Recommends: python3-dnf +Recommends: python3-dnf-plugins-core + +# YUM stack, dnf-utils replace yum-utils +Recommends: yum +Recommends: dnf-utils + +Recommends: btrfs-progs +Suggests: qemu-user-static +Suggests: procenv +Recommends: podman + +%if %{with tests} +BuildRequires: python3-distro +BuildRequires: python3-jinja2 +BuildRequires: python3-pyroute2 +BuildRequires: python3-pytest +BuildRequires: python3-requests +BuildRequires: python3-templated-dictionary +%endif %description Mock takes an SRPM and builds it in a chroot. -%package plugins -Summary: Mock plugins integration module +%package scm +Summary: Mock SCM integration module +Requires: %{name} = %{version}-%{release} +Recommends: cvs +Recommends: git +Recommends: subversion +Recommends: tar + +# We could migrate to 'copr-distgit-client' +Recommends: rpkg + +%description scm +Mock SCM integration module. + +%package lvm +Summary: LVM plugin for mock Requires: %{name} = %{version}-%{release} Requires: lvm2 -Recommends: cvs git subversion tar + +%description lvm +Mock plugin that enables using LVM as a backend and support creating snapshots +of the buildroot. + +%package rpmautospec +Summary: Rpmautospec plugin for mock +Requires: %{name} = %{version}-%{release} +# This lets mock determine if a spec file needs to be processed with rpmautospec. +Requires: python%{python3_pkgversion}-rpmautospec-core + +%description rpmautospec +Mock plugin that preprocesses spec files using rpmautospec. -%description plugins -Mock plugins integration module. +%package filesystem +Summary: Mock filesystem layout +Requires(pre): shadow-utils + +%description filesystem +Filesystem layout and group for Mock. %prep %setup -q @@ -58,8 +117,8 @@ for file in py/mock.py py/mock-parse-buildlog.py; do done %build -for i in py/mock.py py/mock-parse-buildlog.py; do - perl -p -i -e 's|^__VERSION__\s*=.*|__VERSION__="%{version}"|' $i +for i in py/mockbuild/constants.py py/mock-parse-buildlog.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 @@ -69,6 +128,9 @@ for i in docs/mock.1 docs/mock-parse-buildlog.1; do done %install +mkdir -p %{buildroot}%{_sysconfdir}/mock/eol/templates +mkdir -p %{buildroot}%{_sysconfdir}/mock/templates + install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_libexecdir}/mock install mockchain %{buildroot}%{_bindir}/mockchain @@ -88,6 +150,7 @@ cp -a etc/consolehelper/mock %{buildroot}%{_sysconfdir}/security/console.apps/%{ install -d %{buildroot}%{_datadir}/bash-completion/completions/ cp -a etc/bash_completion.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/mock-parse-buildlog install -d %{buildroot}%{_sysconfdir}/pki/mock @@ -106,47 +169,85 @@ install -d %{buildroot}/var/cache/mock mkdir -p %{buildroot}%{_pkgdocdir} -install -p -m 0644 %{SOURCE1} %{buildroot}%{_pkgdocdir}/site-defaults.cfg -install -p -m 0644 %{SOURCE1} %{buildroot}/etc/mock/site-defaults.cfg +install -p -m 0644 docs/site-defaults.cfg %{buildroot}%{_pkgdocdir} + +sed -i 's/^_MOCK_NVR = None$/_MOCK_NVR = "%name-%version-%release"/' \ + %{buildroot}%{_libexecdir}/mock/mock %check +%if %{with lint} +# ignore the errors for now, just print them and hopefully somebody will fix it one day +pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || : +%endif + +%if %{with tests} +./run-tests.sh --no-cov +%endif %files +%defattr(0644, root, mock) +%doc %{_pkgdocdir}/site-defaults.cfg +%{_datadir}/bash-completion/completions/mock +%{_datadir}/bash-completion/completions/mock-parse-buildlog + %defattr(-, root, root) %{_bindir}/mockchain %{_bindir}/mock %{_bindir}/mock-parse-buildlog +%{_libexecdir}/mock %{python_sitelib}/* %exclude %{python_sitelib}/mockbuild/scm.* +%exclude %{python_sitelib}/mockbuild/__pycache__/scm.* %exclude %{python_sitelib}/mockbuild/plugins/lvm_root.* +%exclude %{python_sitelib}/mockbuild/plugins/__pycache__/lvm_root.* # config files %config(noreplace) %{_sysconfdir}/%{name}/*.ini -%config(noreplace) %{_sysconfdir}/%{name}/site-defaults.cfg %config(noreplace) %{_sysconfdir}/pam.d/%{name} %config(noreplace) %{_sysconfdir}/security/console.apps/%{name} + %dir %{_sysconfdir}/pki/mock %config(noreplace) %{_sysconfdir}/pki/mock/* -%{_mandir}/man1/* +%{_mandir}/man1/mock.1* +%{_mandir}/man1/mock-parse-buildlog.1* %{_datadir}/cheat/mock -%{_datadir}/bash-completion/completions/mock -%{_pkgdocdir}/site-defaults.cfg -%{_datadir}/bash-completion/completions/mock-parse-buildlog -%{_libexecdir}/mock +%defattr(0775, root, mock, 0775) %dir %{_localstatedir}/cache/mock %dir %{_localstatedir}/lib/mock -%files plugins + +%files scm %{python_sitelib}/mockbuild/scm.py* -%{python_sitelib}/mockbuild/plugins/lvm_root.* -%if %{use_python3} %{python3_sitelib}/mockbuild/__pycache__/scm.*.py* + +%files lvm +%{python_sitelib}/mockbuild/plugins/lvm_root.* %{python3_sitelib}/mockbuild/plugins/__pycache__/lvm_root.*.py* -%endif + +%files rpmautospec +%{python_sitelib}/mockbuild/plugins/rpmautospec.* +%{python3_sitelib}/mockbuild/plugins/__pycache__/rpmautospec.*.py* + +%files filesystem +%license COPYING +%dir %{_sysconfdir}/mock +%dir %{_sysconfdir}/mock/eol +%dir %{_sysconfdir}/mock/eol/templates +%dir %{_sysconfdir}/mock/templates +%dir %{_datadir}/cheat %changelog +* Sun Oct 20 2024 shafeipaozi - 5.6-2 +- update check + +* Thu Apr 25 2024 shafeipaozi - 5.6-1 +- update to 5.6 + +* Thu Nov 10 2022 xu_ping 2.2-2 +- fix source url + * Fri May 15 2020 hexiaowen 2.2-1 - first build diff --git a/mock_config.default b/mock_config.default deleted file mode 100644 index dc73cf26582b0cb0b617a20ceae5edbd1d7f4c7c..0000000000000000000000000000000000000000 --- a/mock_config.default +++ /dev/null @@ -1,41 +0,0 @@ -config_opts['chroot_setup_cmd'] = 'install openEuler-rpm-config openEuler-release shadow rpm-build dnf-plugins-core gcc make' -config_opts['package_manager'] = 'dnf' -config_opts['more_buildreqs'] = 'gdb-headless' -config_opts['plugin_conf']['root_cache_enable'] = False -config_opts['plugin_conf']['selinux_enable'] = False -config_opts['plugin_conf']['procenv_enable'] = True -config_opts['nosync'] = True - -config_opts['root'] = 'openEuler-LTS-{{ target_arch }}-1' - -config_opts['target_arch'] = '{{ target_arch }}' -config_opts['use_bootstrap_container'] = False -config_opts['dnf_disable_plugins'] = ['local', 'spacewalk'] -config_opts['use_nspawn'] = False -config_opts['useradd'] = '/usr/sbin/useradd -o -m -u %(uid)s -g %(gid)s -d %(home)s -N %(user)s' - -config_opts['yum.conf'] = """ -[main] -keepcache=1 -debuglevel=2 -reposdir=/dev/null -logfile=/var/log/yum.log -retries=20 -obsoletes=1 -gpgcheck=0 -assumeyes=1 -syslog_ident=mock -syslog_device= -install_weak_deps=0 -metadata_expire=0 -best=1 -protected_packages= - -# repos -[openEuler] -name=Euler -baseurl=http://9.82.1.253/productrepo/openEuler1.0/EULEROS_BASIC/ARM64/openEuler1.0/2020-03-20-06-30-06 -enabled=1 -gpgcheck=0 -gpgkey=http://9.82.1.253/productrepo/openEuler1.0/EULEROS_BASIC/ARM64/openEuler1.0/2020-03-20-06-30-06/RPM-GPG-KEY-openEuler -""" \ No newline at end of file