| |
@@ -10,6 +10,10 @@
|
| |
%global rpm_python rpm-python
|
| |
%endif
|
| |
|
| |
+ %define latest_requires() \
|
| |
+ Requires: %1 \
|
| |
+ %{expand: %%global latest_requires_packages %1 %%{?latest_requires_packages}}
|
| |
+
|
| |
Name: {{{ git_dir_name }}}
|
| |
Version: {{{ git_dir_version }}}
|
| |
Summary: Run COPR build tasks
|
| |
@@ -55,6 +59,7 @@
|
| |
Requires: mock
|
| |
Requires: git
|
| |
Requires: git-svn
|
| |
+ # for the /bin/unbuffer binary
|
| |
Requires: expect
|
| |
|
| |
%if 0%{?fedora} || 0%{?rhel} > 7
|
| |
@@ -70,14 +75,53 @@
|
| |
Example: copr-rpmbuild 12345-epel-7-x86_64 will locally
|
| |
build build-id 12345 for chroot epel-7-x86_64.
|
| |
|
| |
+
|
| |
%package -n copr-builder
|
| |
Summary: copr-rpmbuild with all weak dependencies
|
| |
Requires: %{name} = %{version}-%{release}
|
| |
+
|
| |
+ %if 0%{?fedora}
|
| |
+ # replacement for yum/yum-utils, to be able to work with el* chroots
|
| |
+ # bootstrap_container.
|
| |
+ Requires: dnf-yum
|
| |
+ Requires: dnf-utils
|
| |
+ %endif
|
| |
+ # selinux toolset to allow running ansible against the builder
|
| |
+ %if 0%{?fedora}
|
| |
+ Requires: python3-libselinux
|
| |
+ Requires: python3-libsemanage
|
| |
+ %else
|
| |
+ Requires: libselinux-python
|
| |
+ Requires: libsemanage-python
|
| |
+ %endif
|
| |
+ # for mock to allow 'nosync = True'
|
| |
+ Requires: nosync
|
| |
+ Requires: openssh-clients
|
| |
+ Requires: pyp2rpm
|
| |
+ # We need %%pypi_source defined, which is in 3-29+
|
| |
+ Requires: python-srpm-macros >= 3-29
|
| |
Requires: rpkg
|
| |
- Requires: tito
|
| |
+ Requires: rsync
|
| |
Requires: rubygem-gem2rpm
|
| |
- Requires: pyp2rpm
|
| |
- Requires: python-srpm-macros
|
| |
+ Requires: scl-utils-build
|
| |
+ Requires: tito
|
| |
+ # yum* to allow mock to build against el* chroots without bootstrap_container
|
| |
+ %if 0%{?rhel}
|
| |
+ Requires: yum
|
| |
+ Requires: yum-utils
|
| |
+ %endif
|
| |
+
|
| |
+ # We want those to be always up-2-date
|
| |
+ %latest_requires ca-certificates
|
| |
+ %latest_requires distribution-gpg-keys
|
| |
+ %if 0%{?fedora}
|
| |
+ %latest_requires dnf
|
| |
+ %latest_requires dnf-plugins-core
|
| |
+ %endif
|
| |
+ %latest_requires mock
|
| |
+ %latest_requires mock-core-configs
|
| |
+ %latest_requires rpm
|
| |
+
|
| |
|
| |
%description -n copr-builder
|
| |
Provides command capable of running COPR build-tasks.
|
| |
@@ -86,16 +130,30 @@
|
| |
|
| |
This package contains all optional modules for building SRPM.
|
| |
|
| |
+
|
| |
%prep
|
| |
%setup -q
|
| |
|
| |
+
|
| |
%check
|
| |
PYTHON=%{python} ./run_tests.sh
|
| |
|
| |
+
|
| |
%build
|
| |
name="%{name}" version="%{version}" summary="%{summary}" %py_build
|
| |
a2x -d manpage -f manpage man/copr-rpmbuild.1.asciidoc
|
| |
|
| |
+ cat > copr-update-builder <<EOF
|
| |
+ #! /bin/sh
|
| |
+
|
| |
+ # Update the Copr builder machine, can be called anytime Copr build system
|
| |
+ # decides to do so (please keep the output idempotent).
|
| |
+
|
| |
+ # install the latest versions of those packages
|
| |
+ dnf update -y %latest_requires_packages
|
| |
+ EOF
|
| |
+
|
| |
+
|
| |
%install
|
| |
install -d %{buildroot}%{_sysconfdir}/copr-rpmbuild
|
| |
install -d %{buildroot}%{_sharedstatedir}/copr-rpmbuild
|
| |
@@ -115,6 +173,9 @@
|
| |
|
| |
name="%{name}" version="%{version}" summary="%{summary}" %py_install
|
| |
|
| |
+ install -p -m 755 copr-update-builder %buildroot%_bindir
|
| |
+
|
| |
+
|
| |
%files
|
| |
%{!?_licensedir:%global license %doc}
|
| |
%license LICENSE
|
| |
@@ -136,6 +197,8 @@
|
| |
|
| |
%files -n copr-builder
|
| |
%license LICENSE
|
| |
+ %_bindir/copr-update-builder
|
| |
+
|
| |
|
| |
%changelog
|
| |
{{{ git_dir_changelog since_tag=copr-rpmbuild-0.18-1 }}}
|
| |
The 'copr-builder' package is designed to prepare working copr
builder machine, so it's better to define all dependencies in the
RPM directly (rather than in ansible playbooks).
Certain subset of packages is required to be kept on it's latest
version, so when appropriate please use %latest_requires from now.
That macro is used to generate /usr/bin/copr-update-builder
script, which is to be executed anytime Copr build system decides
(especially when a fresh new VM was spawned from image).