#736 [rpmbuild] builder: merge dependencies from playbooks
Merged 4 years ago by praiskup. Opened 4 years ago by praiskup.

file modified
+66 -3
@@ -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).

rebased onto 277b43e1dd10e82ab9a78834e7e3b6b69b494e46

4 years ago

rebased onto d2cee7af6deaaf95b6fb780713ef13d970e7d4ca

4 years ago

rebased onto 4c1bf2db0f43d94ae73818a7b24d28503d596559

4 years ago

rebased onto a922e7f5ea9bd1423bd5eb6de2a2caa0238a5a3b

4 years ago

2 new commits added

  • [rpmbuild] builder: document some of the requires
  • [rpmbuild] builder: merge dependencies from playbooks
4 years ago

I've removed the uncertain part; and documented what we discussed on meeting.
The package is installable on rawhide (so there's no problem with yum anymore, it actually comes from dnf.src.rpm).

yum-utils needs to go away... it's not installable on F30 (conflicts with dnf-utils) while it is also provided by dnf-utils:

 Problem: problem with installed package dnf-utils-4.0.6-1.fc30.noarch
  - package dnf-utils-4.0.6-1.fc30.noarch conflicts with yum-utils < 1.1.31-530 provided by yum-utils-1.1.31-519.fc30.noarch
  - conflicting requests
...
$ rpm -q --provides dnf-utils
dnf-utils = 4.0.6-1.fc30
yum-utils = 4.0.6-1.fc30

And for mock, we should be OK to use dnf-yum on Fedora.

1 new commit added

  • [rpmbuild] install dnf-utils instead of yum-utils on Fedora
4 years ago

Added one more commit to comply with F30.

3 new commits added

  • [rpmbuild] install dnf-utils instead of yum-utils on Fedora
  • [rpmbuild] builder: document some of the requires
  • [rpmbuild] builder: merge dependencies from playbooks
4 years ago

1 new commit added

  • [rpmbuild] ansible_python_interpreter: /usr/bin/python3
4 years ago

rebased onto 20740a7

4 years ago

@msuchy @frostyx could you please take a look? I'd probably love to build the F30 builders on top of this.

Pull-Request has been merged by praiskup

4 years ago