Skip to content
Open
2 changes: 1 addition & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"annobin",
"ansible-freeipa",
"archivemount",
"argparse-manpage",
"arptables",
"arpwatch",
"asio",
Expand Down
5 changes: 5 additions & 0 deletions SPECS/argparse-manpage/argparse-manpage.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Signatures": {
"argparse_manpage-4.7.tar.gz": "1deab76b212ac8753cbb67b9d2d2bc0949bbc338bb1cc3547f0890cb34108b32"
}
}
760 changes: 760 additions & 0 deletions SPECS/argparse-manpage/argparse-manpage.spec

Large diffs are not rendered by default.

88 changes: 0 additions & 88 deletions SPECS/mock/disable-copying-ca-trust-dirs.patch

This file was deleted.

4 changes: 2 additions & 2 deletions SPECS/mock/mock.signatures.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Signatures": {
"mock-5.6.tar.gz": "0a902c1b89667e9653664487bfa7f9acfcb8f55ba9d64a021058cec40144697d"
"mock-6.7.tar.gz": "1186262d5015a4ecd609ee5cf9082e94d974fff0c1e6ec57eadc68a545e11749"
}
}
}
102 changes: 70 additions & 32 deletions SPECS/mock/mock.spec
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
%bcond_with lint
%bcond_without tests

# mock group id allocate for Fedora
%global mockgid 135
# Modern distributions (using RPM v4.20+;
# for example, Fedora 42+) do not
# require the %%pre scriptlet for creating users/groups because the sysusers
# feature is now built directly into RPM. Simply including the sysusers
# `mock.conf` file in a package payload is sufficient to leverage this feature.
# However, for older distributions that lack this capability, we still define
# the %%pre scriptlet.
%if 0%{?fedora} < 42 || (0%{?rhel} && 0%{?rhel} <= 10) || (0%{?mageia} && 0%{?mageia} < 10) || (0%{?suse_version} && 0%{?suse_version} < 1660)
%bcond_without sysusers_compat
%else
%bcond_with sysusers_compat
%endif

%global __python %{__python3}
%global python_sitelib %{python3_sitelib}

Summary: Builds packages inside chroots
Name: mock
Version: 5.6
Release: 2%{?dist}
Version: 6.7
Release: 1%{?dist}
Vendor: Microsoft Corporation
Distribution: Azure Linux
License: GPL-2.0-or-later
Source: https://github.com/rpm-software-management/mock/archive/refs/tags/%{name}-%{version}-1.tar.gz#/%{name}-%{version}.tar.gz
Patch0: disable-copying-ca-trust-dirs.patch
URL: https://github.com/rpm-software-management/mock/
BuildArch: noarch
Requires: tar
Expand All @@ -40,7 +49,7 @@ Suggests: mock-core-configs
%endif

Requires: systemd
%if 0%{?azl} || 0%{?fedora} || 0%{?rhel} >= 8
%if 0%{?fedora} || 0%{?rhel}
Requires: systemd-container
%endif
Requires: coreutils
Expand All @@ -56,7 +65,7 @@ Requires: python%{python3_pkgversion}-jinja2
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-rpm
Requires: python%{python3_pkgversion}-pyroute2
Requires: python%{python3_pkgversion}-templated-dictionary
Requires: python%{python3_pkgversion}-templated-dictionary >= 1.5
Requires: python%{python3_pkgversion}-backoff
BuildRequires: python%{python3_pkgversion}-backoff
BuildRequires: python%{python3_pkgversion}-devel
Expand All @@ -66,7 +75,9 @@ BuildRequires: python%{python3_pkgversion}-pylint
BuildRequires: python%{python3_pkgversion}-rpm
BuildRequires: python%{python3_pkgversion}-rpmautospec-core

%if 0%{?fedora} >= 38
BuildRequires: argparse-manpage

%if 0%{?fedora} >= 38 || 0%{?rhel} >= 11 || 0%{?mageia} >= 10 || 0%{?suse_version} >= 1600
# DNF5 stack
Recommends: dnf5
Recommends: dnf5-plugins
Expand All @@ -83,18 +94,22 @@ Recommends: dnf-utils
Recommends: btrfs-progs
Suggests: qemu-user-static
Suggests: procenv
Recommends: buildah
Recommends: podman
Recommends: skopeo
Recommends: fuse-overlayfs

%if %{with tests}
BuildRequires: python%{python3_pkgversion}-distro
BuildRequires: python%{python3_pkgversion}-jinja2
BuildRequires: python%{python3_pkgversion}-jsonschema
BuildRequires: python%{python3_pkgversion}-pyroute2
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-templated-dictionary
%endif

%if 0%{?azl} || 0%{?fedora} || 0%{?rhel} >= 8
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: perl-interpreter
%else
BuildRequires: perl
Expand All @@ -111,18 +126,14 @@ Mock takes an SRPM and builds it in a chroot.

%package scm
Summary: Mock SCM integration module
Requires: %{name} = %{version}-%{release}
%if ! 0%{?azl}
Recommends: cvs
%endif
Recommends: git
Recommends: subversion
Recommends: tar
Requires: %{name} = %{version}-%{release}
Recommends: cvs
Recommends: git
Recommends: subversion
Recommends: tar

%if ! 0%{?azl}
# We could migrate to 'copr-distgit-client'
Recommends: rpkg
%endif
Recommends: rpkg

%description scm
Mock SCM integration module.
Expand All @@ -146,14 +157,19 @@ Requires: python%{python3_pkgversion}-rpmautospec-core
Mock plugin that preprocesses spec files using rpmautospec.

%package filesystem
Summary: Mock filesystem layout
Summary: Mock filesystem layout
Requires(pre): shadow-utils
BuildRequires: systemd-rpm-macros

%if %{with sysusers_compat}
Requires(pre): shadow-utils
%endif

%description filesystem
Filesystem layout and group for Mock.

%prep
%autosetup -p2 -n mock-%{name}-%{version}-1/%{name}
%autosetup -n %{name}-%{name}-%{version}-1/%{name}
for file in py/mock.py py/mock-parse-buildlog.py; do
sed -i 1"s|#!/usr/bin/python3 |#!%{__python} |" $file
done
Expand All @@ -166,13 +182,19 @@ for i in py/mockbuild/constants.py py/mock-parse-buildlog.py; do
perl -p -i -e 's|^PKGPYTHONDIR\s*=.*|PKGPYTHONDIR="%{python_sitelib}/mockbuild"|' $i
done
for i in docs/mock.1 docs/mock-parse-buildlog.1; do
perl -p -i -e 's|\@VERSION\@|%{version}"|' $i
perl -p -i -e 's|\@VERSION\@|%{version}|' $i
done

%if ! 0%{?azl}
./precompile-bash-completion "mock.complete"
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
for i in docs/site-defaults.cfg py/mockbuild/config.py; do
perl -p -i -e 's|config_opts\["shadow_utils_isolation_option"\] = .*|config_opts["shadow_utils_isolation_option"] = "--root"|' "$i"
done
%endif

./precompile-bash-completion "mock.complete" || cp -a ./etc/bash_completion.d/mock ./mock.complete

argparse-manpage --pyfile ./py/mock-hermetic-repo.py --function _argparser > mock-hermetic-repo.1

%install
#base filesystem
mkdir -p %{buildroot}%{_sysconfdir}/mock/eol/templates
Expand All @@ -181,10 +203,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/mock/templates
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libexecdir}/mock
install mockchain %{buildroot}%{_bindir}/mockchain
install py/mock-hermetic-repo.py %{buildroot}%{_bindir}/mock-hermetic-repo
install py/mock-parse-buildlog.py %{buildroot}%{_bindir}/mock-parse-buildlog
install py/mock.py %{buildroot}%{_libexecdir}/mock/mock
ln -s consolehelper %{buildroot}%{_bindir}/mock
install create_default_route_in_container.sh %{buildroot}%{_libexecdir}/mock/

install -d %{buildroot}%{_sysconfdir}/pam.d
cp -a etc/pam/* %{buildroot}%{_sysconfdir}/pam.d/
Expand All @@ -197,9 +219,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/
%if ! 0%{?azl}
cp -a mock.complete %{buildroot}%{_datadir}/bash-completion/completions/mock
%endif
ln -s mock %{buildroot}%{_datadir}/bash-completion/completions/mock-parse-buildlog

install -d %{buildroot}%{_sysconfdir}/pki/mock
Expand All @@ -209,23 +229,30 @@ install -d %{buildroot}%{python_sitelib}/
cp -a py/mockbuild %{buildroot}%{python_sitelib}/

install -d %{buildroot}%{_mandir}/man1
cp -a docs/mock.1 docs/mock-parse-buildlog.1 %{buildroot}%{_mandir}/man1/
cp -a docs/mock.1 docs/mock-parse-buildlog.1 mock-hermetic-repo.1 %{buildroot}%{_mandir}/man1/
install -d %{buildroot}%{_datadir}/cheat
cp -a docs/mock.cheat %{buildroot}%{_datadir}/cheat/mock

install -d %{buildroot}/var/lib/mock
install -d %{buildroot}/var/cache/mock

mkdir -p %{buildroot}%{_pkgdocdir}
install -p -m 0644 docs/buildroot-lock-schema-*.json %{buildroot}%{_pkgdocdir}
install -p -m 0644 docs/site-defaults.cfg %{buildroot}%{_pkgdocdir}

mkdir -p %{buildroot}%{_sysusersdir}
install -p -D -m 0644 mock.conf %{buildroot}%{_sysusersdir}

sed -i 's/^_MOCK_NVR = None$/_MOCK_NVR = "%name-%version-%release"/' \
%{buildroot}%{_libexecdir}/mock/mock

%if %{with sysusers_compat}
%pre filesystem
# check for existence of mock group, create it if not found
getent group mock > /dev/null || groupadd -f -g %mockgid -r mock
exit 0
# Some of these older distributions do not ship with the %%sysusers_*_compat.
# Instead of another ifdef/else here, we prefer to hardcode the scriptlet
# content here.
getent group 'mock' >/dev/null || groupadd -f -g '135' -r 'mock' || :
%endif

%check
%if %{with lint}
Expand All @@ -239,8 +266,9 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :


%files
%defattr(0644, root, mock)
%dir %{_pkgdocdir}/
%doc %{_pkgdocdir}/site-defaults.cfg
%doc %{_pkgdocdir}/buildroot-lock-schema-*.json
%{_datadir}/bash-completion/completions/mock
%{_datadir}/bash-completion/completions/mock-parse-buildlog

Expand All @@ -249,6 +277,7 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
# executables
%{_bindir}/mock
%{_bindir}/mockchain
%{_bindir}/mock-hermetic-repo
%{_bindir}/mock-parse-buildlog
%{_libexecdir}/mock

Expand All @@ -258,9 +287,12 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
%exclude %{python_sitelib}/mockbuild/__pycache__/scm.*
%exclude %{python_sitelib}/mockbuild/plugins/lvm_root.*
%exclude %{python_sitelib}/mockbuild/plugins/__pycache__/lvm_root.*
%exclude %{python_sitelib}/mockbuild/plugins/rpmautospec.*
%exclude %{python3_sitelib}/mockbuild/plugins/__pycache__/rpmautospec.*.py*

# config files
%config(noreplace) %{_sysconfdir}/%{name}/*.ini
%config(noreplace) %{_sysconfdir}/%{name}/hermetic-build.cfg
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}

Expand All @@ -271,6 +303,7 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
# docs
%{_mandir}/man1/mock.1*
%{_mandir}/man1/mock-parse-buildlog.1*
%{_mandir}/man1/mock-hermetic-repo.1*
%{_datadir}/cheat/mock

# cache & build dirs
Expand All @@ -297,8 +330,12 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
%dir %{_sysconfdir}/mock/eol/templates
%dir %{_sysconfdir}/mock/templates
%dir %{_datadir}/cheat
%config(noreplace) %{_sysusersdir}/mock.conf

%changelog
* Thu May 07 2026 Sandeep Karambelkar <skarambelkar@microsoft.com> - 6.7-1
- Upgrade to 6.7 upstream release

* Wed May 07 2025 Reuben Olinsky <reubeno@microsoft.com> - 5.6-2
- Backport change allowing disabling ca-trust file copying.

Expand Down Expand Up @@ -752,3 +789,4 @@ pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :
- Fix keeping the LVM volume mounted
- suggest dnf-utils
- Always create /dev/loop nodes

Loading
Loading