From 586135d445198222c297f457b6e7e431edcb16b9 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Thu, 29 Jun 2023 11:22:47 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 57 +++++++++++++++++++++++++++++++++++++ build.bash | 59 +++++++++++++++++++++++++++++++++++++++ fedora-rawhide-x86_64.cfg | 37 ++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 build.bash create mode 100644 fedora-rawhide-x86_64.cfg diff --git a/.gitignore b/.gitignore index d5a6339..58672f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,58 @@ +/results_* +/*.src.rpm + +/xmvn-0.tar.xz +/xmvn-0.0.1.tar.xz +/xmvn-0.0.2.tar.xz +/xmvn-0.1.0.tar.xz +/xmvn-0.1.1.tar.xz +/xmvn-0.1.2.tar.xz +/xmvn-0.1.3.tar.xz +/xmvn-0.1.4.tar.xz +/xmvn-0.1.5.tar.xz +/xmvn-0.2.0.tar.xz +/xmvn-0.2.1.tar.xz +/xmvn-0.2.2.tar.xz +/xmvn-0.2.3.tar.xz +/xmvn-0.2.4.tar.xz +/xmvn-0.2.5.tar.xz +/xmvn-0.2.6.tar.xz +/xmvn-0.3.0.tar.xz +/xmvn-0.3.1.tar.xz +/xmvn-snapshot.tar.xz +/xmvn-0.4.0.tar.xz +/xmvn-0.4.1.tar.xz +/xmvn-0.4.2.tar.xz +/xmvn-0.5.0.tar.xz +/xmvn-0.5.1.tar.xz +/xmvn-1.0.0.tar.xz +/xmvn-1.0.1.tar.xz +/xmvn-1.0.2.tar.xz +/xmvn-1.1.0.tar.xz +/xmvn-1.2.0.tar.xz +/xmvn-1.3.0.tar.xz +/xmvn-1.4.0.tar.xz +/xmvn-1.5.0-SNAPSHOT.tar.xz +/xmvn-2.0.0.tar.xz +/xmvn-2.0.1.tar.xz +/xmvn-2.1.0.tar.xz +/xmvn-2.1.1.tar.xz +/xmvn-2.2.0.tar.xz +/xmvn-2.2.1.tar.xz +/xmvn-2.3.0.tar.xz +/xmvn-2.3.1.tar.xz +/xmvn-2.3.2.tar.xz +/xmvn-2.4.0.tar.xz +/xmvn-2.5.0.tar.xz +/xmvn-3.0.0.tar.xz +/xmvn-3.1.0.tar.xz +/5d1e284.tar.gz +/da67577.tar.gz +/fac231b.tar.gz +/5547c28.tar.gz +/523e11f.tar.gz +/7e2d3db.tar.gz +/54026c1.tar.gz +/43c7e67.tar.gz +/3b84c99.tar.gz /xmvn-4.0.0.tar.xz diff --git a/build.bash b/build.bash new file mode 100644 index 0000000..ddff670 --- /dev/null +++ b/build.bash @@ -0,0 +1,59 @@ +#!/bin/bash -ex + +resultdir="/var/lib/mock/xmvn-rawhide/result" + +# create directories +repo=RPM/latest/ +[[ ! -d ${repo} ]] && mkdir -p ${repo} + +# update version and release tag in spec file +version=$(sed -n '//{s/.*>\(.*\)<.*/\1/;s/-SNAPSHOT$//;p;q}' pom.xml) +release=$(git describe --match="[^(jenkins)].*" --tags | sed 's/[^-]*-/0./;s/-/./;s/g/git/') +sed -i "s/^Version:\s\+[0-9.]*$/Version: ${version}/" xmvn.spec +sed -i "s/^Release:\s\+[0-9.]*%{?dist}$/Release: ${release}/" xmvn.spec + +# Skip patch application on Jenkins - it is supposed to always use the +# latest vanilla upstream snapshot. +sed -i "/^Patch[0-9]*:/d" xmvn.spec +sed -i "/^%patch[0-9]* -p/d" xmvn.spec + +# make tarball +git archive -v --prefix=xmvn-${version}/ HEAD | xz > xmvn-${version}.tar.xz + +# crate srpm +rm -f SRPMS/* +rpmbuild -bs --clean --define "_topdir `pwd`" --define "_sourcedir `pwd`" xmvn.spec + +# build RPM with custom mock config +rm -Rf ${resultdir}/* +# print root.log and build.log in case of failure +trap "cat ${resultdir}/{root,build}.log || :" 0 +mock -r ../..$PWD/fedora-rawhide-x86_64 SRPMS/*.src.rpm + +# remove unneeded stuff +rm -f xmvn-*.tar.xz + +last_bn=`grep "Build number" ${repo}/info.log | awk '{ print $3 }'` +if [ -n "${last_bn}" ]; then + mkdir -p RPM/${last_bn} + mv ${repo}/* RPM/${last_bn} + + # we only want keep RPMs from last 10 builds + blist=`find ./RPM/ -maxdepth 1 -name "[0-9]*"` + for bn in $blist; do + if [ `basename $bn` -lt `expr $last_bn - 10` ]; then + rm -Rf $bn + fi + done +fi + +# copy resulting RPMs to RPM/latest +cp ${resultdir}/* ${repo} + +tail -n 50 ${resultdir}/build.log + +createrepo ${repo} + +# store current build number into the file +echo "Build number: $BUILD_NUMBER" >> ${repo}/info.log + diff --git a/fedora-rawhide-x86_64.cfg b/fedora-rawhide-x86_64.cfg new file mode 100644 index 0000000..f8d9e71 --- /dev/null +++ b/fedora-rawhide-x86_64.cfg @@ -0,0 +1,37 @@ +config_opts['root'] = 'xmvn-rawhide' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) +config_opts['chroot_setup_cmd'] = 'install @buildsys-build' +config_opts['dist'] = 'rawhide' # only useful for --resultdir variable subst +config_opts['extra_chroot_dirs'] = [ '/run/lock', ] +config_opts['releasever'] = '21' + +config_opts['yum.conf'] = """ +[main] +logfile=/var/log/yum.log +retries=20 +gpgcheck=0 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=1 +mirrorlist_expire=1 +debuglevel=2 + +[mock-rawhide] +name=mock-rawhide +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=x86_64 +failovermethod=priority +cost=1000 + +[mock-koji] +name=mock-koji +baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/ +cost=2000 + +[mock-override] +name=mock-override +baseurl=http://people.redhat.com/~mizdebsk/jenkins-extra-repo/ +gpgcheck=0 +cost=500 +"""