代码拉取完成,页面将自动刷新
# open this flag when bug is fixed
%bcond_with lint
%bcond_without tests
%global mockgid 135
%global _pyversion %{python3_pkgversion}
Summary: Builds packages inside chroots
Name: mock
Version: 4.1
Release: 4%{?dist}
License: GPL-2.0-or-later
URL: https://github.com/rpm-software-management/mock/
Source0: https://github.com/rpm-software-management/mock/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.gz
BuildRequires: bash-completion perl-interpreter
BuildRequires: python%{_pyversion}-devel
%if %{with lint}
BuildRequires: python%{_pyversion}-pylint
%endif
%if %{with tests}
BuildRequires: python%{_pyversion}-distro python%{_pyversion}-jinja2
BuildRequires: python%{_pyversion}-pyroute2 python%{_pyversion}-pytest
BuildRequires: python%{_pyversion}-requests python%{_pyversion}-templated-dictionary
%endif
Requires: %{name}-filesystem %{name}-core-configs
Requires: systemd systemd-container coreutils dnf dnf-plugins-core
Requires: tar pigz usermode createrepo_c util-linux coreutils procps-ng
Requires: python%{_pyversion}-distro python%{_pyversion}-jinja2
Requires: python%{_pyversion}-requests python%{_pyversion}-rpm
Requires: python%{_pyversion}-pyroute2 python%{_pyversion}-templated-dictionary
Suggests: iproute yum
Recommends: dnf-utils
BuildArch: noarch
%description
This package provides an SRPM and builds it in a chroot.
%package scm
Summary: Mock SCM integration module
Requires: %{name} = %{version}-%{release}
Requires: git tar
%description scm
Mock SCM integration module.
%package lvm
Summary: LVM plugin for mock
Requires: %{name} = %{version}-%{release}
Requires: lvm2
%description lvm
This package provides LVM as a backend and support creating snapshots of the buildroot.
%package filesystem
Summary: Mock filesystem layout
Requires(pre): shadow-utils
%description filesystem
This package provides filesystem layout and group for Mock.
%prep
%autosetup -n %{name}-%{version} -p1
%build
sed -i 's?^VERSION\s*=.*?VERSION="%{version}"?g' py/mockbuild/constants.py
sed -i 's?^SYSCONFDIR\s*=.*?SYSCONFDIR="%{_sysconfdir}"?g' py/mockbuild/constants.py
sed -i 's?^PYTHONDIR\s*=.*?PYTHONDIR="%{python3_sitelib}"?g' py/mockbuild/constants.py
sed -i 's?^PKGPYTHONDIR\s*=.*?PKGPYTHONDIR="%{python3_sitelib}/mockbuild"?g' py/mockbuild/constants.py
for i in docs/mock.1 docs/mock-parse-buildlog.1; do
sed -i 's?\@VERSION\@?%{version}?g' $i
done
%install
install -d %{buildroot}%{_sysconfdir}/mock/eol/templates
install -d %{buildroot}%{_sysconfdir}/mock/templates
install -d %{buildroot}/var/lib/mock
install -d %{buildroot}/var/cache/mock
install -D mockchain %{buildroot}%{_bindir}/mockchain
install -D py/mock.py %{buildroot}%{_libexecdir}/mock/mock
install -D py/mock-parse-buildlog.py %{buildroot}%{_bindir}/mock-parse-buildlog
ln -s consolehelper %{buildroot}%{_bindir}/mock
install create_default_route_in_container.sh %{buildroot}%{_libexecdir}/mock/
install -Dt %{buildroot}%{_sysconfdir}/pam.d etc/pam/*
install -Dt %{buildroot}%{_sysconfdir}/mock etc/mock/*
install -Dt %{buildroot}%{_sysconfdir}/security/console.apps/ etc/consolehelper/mock
install -Dt %{buildroot}%{_datadir}/bash-completion/completions/ etc/bash_completion.d/*
ln -s mock %{buildroot}%{_datadir}/bash-completion/completions/mock-parse-buildlog
install -Dt %{buildroot}%{_sysconfdir}/pki/mock etc/pki/*
install -d %{buildroot}%{python3_sitelib}/
cp -a py/mockbuild %{buildroot}%{python3_sitelib}/
install -Dt %{buildroot}%{_mandir}/man1 docs/*.1
install -D docs/mock.cheat %{buildroot}%{_datadir}/cheat/mock
install -m 0644 -Dt %{buildroot}%{_pkgdocdir} docs/site-defaults.cfg
sed -i 's/^_MOCK_NVR = None$/_MOCK_NVR = "%name-%version-%release"/' \
%{buildroot}%{_libexecdir}/mock/mock
%check
%if %{with lint}
pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
%endif
%if %{with tests}
./run-tests.sh --no-cov
%endif
%pre filesystem
getent group mock > /dev/null || groupadd -f -g %mockgid -r mock
exit 0
%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}/mock
%{_bindir}/mockchain
%{_bindir}/mock-parse-buildlog
%{_libexecdir}/mock
%{python3_sitelib}/*
%config(noreplace) %{_sysconfdir}/%{name}/*.ini
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
%dir %{_sysconfdir}/pki/mock
%config(noreplace) %{_sysconfdir}/pki/mock/*
%defattr(0775, root, mock, 0775)
%dir %{_localstatedir}/cache/mock
%dir %{_localstatedir}/lib/mock
%{_mandir}/man1/mock.1*
%{_mandir}/man1/mock-parse-buildlog.1*
%{_datadir}/cheat/mock
%exclude %{python3_sitelib}/mockbuild/scm.*
%exclude %{python3_sitelib}/mockbuild/__pycache__/scm.*
%exclude %{python3_sitelib}/mockbuild/plugins/lvm_root.*
%exclude %{python3_sitelib}/mockbuild/plugins/__pycache__/lvm_root.*
%files scm
%{python3_sitelib}/mockbuild/scm.py*
%{python3_sitelib}/mockbuild/__pycache__/scm.*.py*
%files lvm
%{python3_sitelib}/mockbuild/plugins/lvm_root.*
%{python3_sitelib}/mockbuild/plugins/__pycache__/lvm_root.*.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
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.1-4
- Rebuilt for loongarch release
* Tue Sep 19 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.1-3
- Rebuilt for python 3.11
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.1-2
- Rebuilt for OpenCloudOS Stream 23.09
* Mon Jul 31 2023 Miaojun Dong <zoedong@tencent.com> - 4.1-1
- Bump version to 4.1
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.3-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.3-2
- Rebuilt for OpenCloudOS Stream 23
* Wed Oct 26 2022 Shuo Wang <abushwang@tencent.com> - 3.3-1
- initial build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。