Skip to content

Instantly share code, notes, and snippets.

@saschagrunert
Last active October 30, 2023 13:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saschagrunert/1ac9d19318268d6154e205235f813981 to your computer and use it in GitHub Desktop.
Save saschagrunert/1ac9d19318268d6154e205235f813981 to your computer and use it in GitHub Desktop.
Environment for building Red Hat packages
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant box for testing
Vagrant.configure("2") do |config|
config.vm.box = "fedora/35-cloud-base"
memory = 6144
cpus = 4
config.vm.provider :virtualbox do |v|
v.memory = memory
v.cpus = cpus
end
config.vm.provider :libvirt do |v|
v.memory = memory
v.cpus = cpus
end
config.vm.provision "install-dependencies", type: "shell", run: "once" do |sh|
sh.inline = <<~SHELL
set -euxo pipefail
dnf install -y \
chkconfig \
java-headless \
krb5-workstation \
rpmdevtools \
vim
rpm -i http://hdn.corp.redhat.com/rhel7-csb-stage/RPMS/noarch/redhat-internal-cert-install-0.1-23.el7.csb.noarch.rpm
curl -L -o /etc/yum.repos.d/rcm-tools-fedora.repo http://download.devel.redhat.com/rel-eng/internal/rcm-tools-fedora.repo
yum install -y rhpkg
# Docs: https://docs.google.com/document/d/1eLl8jtngClPBijxlvfTSVu4afy28TRWhS8wTejtINh4/edit
echo '%_topdir %(echo $(pwd))' > /home/vagrant/.rpmmacros
echo '%_sourcedir %{_topdir}' >> /home/vagrant/.rpmmacros
echo '%_specdir %{_sourcedir}' >> /home/vagrant/.rpmmacros
echo '%_rpmdir %{_topdir}/RPMS' >> /home/vagrant/.rpmmacros
echo '%_srcrpmdir %{_topdir}/SRPMS' >> /home/vagrant/.rpmmacros
echo '%_builddir %{_topdir}/BUILD' >> /home/vagrant/.rpmmacros
echo '%_tmppath %(echo ${TMPDIR:-/var/tmp})' >> /home/vagrant/.rpmmacros
echo '%_buildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)' >> /home/vagrant/.rpmmacros
su vagrant -c 'git config --global user.name "Sascha Grunert"'
su vagrant -c 'git config --global user.email "sgrunert@redhat.com"'
# kinit sgrunert@IPA.REDHAT.COM
# rhpkg clone cri-tools
# cd cri-tools
# git checkout rhaos-4.12-rhel-8
# Update the commit0, version, release of cri-tools.spec
# spectool -g cri-tools.spec
# rhpkg new-sources cri-tools-d82b602.tar.gz
# rhpkg upload cri-tools-d82b602.tar.gz
# rpmdev-bumpspec -c "Bump to v1.24.0" cri-tools.spec
# git commit -asm "Bump to v1.24.0"
# git push
# rhpkg build
#
# scratch build for private branches:
# rhpkg srpm
# brew build --scratch rhaos-4.12-rhel-8-candidate *.src.rpm
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment