re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-06-29 11:22:47 +02:00 committed by root
parent 8acba46834
commit 3de51d09a5
4 changed files with 154 additions and 0 deletions

57
.gitignore vendored
View File

@ -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

1
.xmvn.metadata Normal file
View File

@ -0,0 +1 @@
40287aecd41b3a3f60fb633cf5b257c0a7aae232 xmvn-4.0.0.tar.xz

59
build.bash Normal file
View File

@ -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 '/<version>/{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

37
fedora-rawhide-x86_64.cfg Normal file
View File

@ -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
"""