commit
686d895bfe
BIN
mock-2.2.tar.gz
Normal file
BIN
mock-2.2.tar.gz
Normal file
Binary file not shown.
152
mock.spec
Normal file
152
mock.spec
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
%global use_python3 1
|
||||||
|
%global use_python2 0
|
||||||
|
%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
|
||||||
|
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
|
||||||
|
Requires: python3-requests
|
||||||
|
Requires: python3-rpm
|
||||||
|
Requires: python3-pyroute2
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
Requires: tar
|
||||||
|
Requires: pigz
|
||||||
|
Requires: usermode
|
||||||
|
Requires: createrepo_c
|
||||||
|
Requires: systemd
|
||||||
|
Requires: systemd-container
|
||||||
|
Requires: coreutils
|
||||||
|
Requires: util-linux
|
||||||
|
Requires: coreutils
|
||||||
|
Requires: procps-ng
|
||||||
|
Requires: dnf
|
||||||
|
Requires: dnf-plugins-core
|
||||||
|
|
||||||
|
|
||||||
|
%description
|
||||||
|
Mock takes an SRPM and builds it in a chroot.
|
||||||
|
|
||||||
|
%package plugins
|
||||||
|
Summary: Mock plugins integration module
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
Requires: lvm2
|
||||||
|
Recommends: cvs git subversion tar
|
||||||
|
|
||||||
|
%description plugins
|
||||||
|
Mock plugins integration module.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
for file in py/mock.py py/mock-parse-buildlog.py; do
|
||||||
|
sed -i 1"s|#!/usr/bin/python3 |#!%{__python} |" $file
|
||||||
|
done
|
||||||
|
|
||||||
|
%build
|
||||||
|
for i in py/mock.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
|
||||||
|
done
|
||||||
|
for i in docs/mock.1 docs/mock-parse-buildlog.1; do
|
||||||
|
perl -p -i -e 's|\@VERSION\@|%{version}"|' $i
|
||||||
|
done
|
||||||
|
|
||||||
|
%install
|
||||||
|
install -d %{buildroot}%{_bindir}
|
||||||
|
install -d %{buildroot}%{_libexecdir}/mock
|
||||||
|
install mockchain %{buildroot}%{_bindir}/mockchain
|
||||||
|
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/
|
||||||
|
|
||||||
|
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/mock-parse-buildlog
|
||||||
|
|
||||||
|
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}/
|
||||||
|
|
||||||
|
install -d %{buildroot}%{_mandir}/man1
|
||||||
|
cp -a docs/mock.1 docs/mock-parse-buildlog.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 %{SOURCE1} %{buildroot}%{_pkgdocdir}/site-defaults.cfg
|
||||||
|
install -p -m 0644 %{SOURCE1} %{buildroot}/etc/mock/site-defaults.cfg
|
||||||
|
|
||||||
|
%check
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-, root, root)
|
||||||
|
%{_bindir}/mockchain
|
||||||
|
%{_bindir}/mock
|
||||||
|
%{_bindir}/mock-parse-buildlog
|
||||||
|
|
||||||
|
%{python_sitelib}/*
|
||||||
|
%exclude %{python_sitelib}/mockbuild/scm.*
|
||||||
|
%exclude %{python_sitelib}/mockbuild/plugins/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/*
|
||||||
|
%{_datadir}/cheat/mock
|
||||||
|
%{_datadir}/bash-completion/completions/mock
|
||||||
|
%{_pkgdocdir}/site-defaults.cfg
|
||||||
|
%{_datadir}/bash-completion/completions/mock-parse-buildlog
|
||||||
|
%{_libexecdir}/mock
|
||||||
|
|
||||||
|
%dir %{_localstatedir}/cache/mock
|
||||||
|
%dir %{_localstatedir}/lib/mock
|
||||||
|
|
||||||
|
%files plugins
|
||||||
|
%{python_sitelib}/mockbuild/scm.py*
|
||||||
|
%{python_sitelib}/mockbuild/plugins/lvm_root.*
|
||||||
|
%if %{use_python3}
|
||||||
|
%{python3_sitelib}/mockbuild/__pycache__/scm.*.py*
|
||||||
|
%{python3_sitelib}/mockbuild/plugins/__pycache__/lvm_root.*.py*
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri May 15 2020 hexiaowen <hexiaowen@huawei.com> 2.2-1
|
||||||
|
- first build
|
||||||
41
mock_config.default
Normal file
41
mock_config.default
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
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
|
||||||
|
"""
|
||||||
Loading…
x
Reference in New Issue
Block a user