Merge jenkins spec file

Conflicts:
	xmvn.spec
This commit is contained in:
Mikolaj Izdebski 2014-05-02 08:30:02 +02:00
commit 12e9af3199
2 changed files with 74 additions and 18 deletions

58
build.bash Normal file
View File

@ -0,0 +1,58 @@
#!/bin/bash -ex
resultdir="/var/lib/mock/fedora-rawhide-x86_64/result"
# download spec file
curl https://raw.githubusercontent.com/msrb/jenkins-configs/xmvn/xmvn.spec > xmvn.spec
# 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
# make tarball
git archive -v --prefix=xmvn-${version}/ HEAD | xz > xmvn-${version}.tar.xz
# print root.log and build.log in case of failure
trap "cat ${resultdir}/root.log | tail -30; cat ${resultdir}/build.log || :" 0
# 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}/*
mock -r 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

View File

@ -1,22 +1,18 @@
Name: xmvn Name: xmvn
Version: 1.5.0 Version: 2.0.0
Release: 0.25.gitcb3a0a6%{?dist} Release: 0%{?dist}
Summary: Local Extensions for Apache Maven Summary: Local Extensions for Apache Maven
License: ASL 2.0 License: ASL 2.0
URL: http://mizdebsk.fedorapeople.org/xmvn URL: http://mizdebsk.fedorapeople.org/xmvn
BuildArch: noarch BuildArch: noarch
#Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz #Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz
# git clone git://git.fedorahosted.org/git/%{name}.git # git clone git://git.fedorahosted.org/git/%{name}.git
# (cd ./%{name} && git archive --format tar --prefix %{name}-%{version}/ cb3a0a6 | xz) >%{name}-%{version}-SNAPSHOT.tar.xz # (cd ./%{name} && git archive --format tar --prefix %{name}-%{version}/ cb3a0a6 | xz) >%{name}-%{version}-SNAPSHOT.tar.xz
Source0: %{name}-%{version}-SNAPSHOT.tar.xz Source0: %{name}-%{version}-SNAPSHOT.tar.xz
Patch0: 0001-Don-t-install-artifacts-which-are-not-regular-files.patch BuildRequires: maven >= 3.2.1-3
Patch1: 0002-Protect-against-NPE-in-Install-MOJO.patch
Patch2: 0003-Override-extensions-of-skipped-artifacts.patch
Patch3: 0004-Use-ASM-5.0.1-directly-instead-of-Sisu-shaded-ASM.patch
BuildRequires: maven >= 3.1.1-13
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: beust-jcommander BuildRequires: beust-jcommander
BuildRequires: cglib BuildRequires: cglib
@ -25,10 +21,13 @@ BuildRequires: maven-plugin-build-helper
BuildRequires: maven-assembly-plugin BuildRequires: maven-assembly-plugin
BuildRequires: maven-invoker-plugin BuildRequires: maven-invoker-plugin
BuildRequires: objectweb-asm BuildRequires: objectweb-asm
BuildRequires: modello
BuildRequires: xmlunit BuildRequires: xmlunit
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin) BuildRequires: apache-ivy
BuildRequires: sisu-mojos
BuildRequires: junit
Requires: maven >= 3.1.1-13 Requires: maven >= 3.2.1-3
%description %description
This package provides extensions for Apache Maven that can be used to This package provides extensions for Apache Maven that can be used to
@ -44,10 +43,9 @@ This package provides %{summary}.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1 # In XMvn 2.x xmvn-connector was renamed to xmvn-connector-aether
%patch2 -p1 %mvn_alias :xmvn-connector-aether :xmvn-connector
%patch3 -p1
# remove dependency plugin maven-binaries execution # remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink # we provide apache-maven by symlink
@ -62,9 +60,12 @@ ln -s %{_datadir}/maven target/dependency/apache-maven-$mver
# skip ITs for now (mix of old & new XMvn config causes issues # skip ITs for now (mix of old & new XMvn config causes issues
rm -rf src/it rm -rf src/it
# probably bug in configuration/modello?
sed -i 's|generated-site/resources/xsd/config|generated-site/xsd/config|' xmvn-core/pom.xml
%build %build
# XXX some tests fail on ARM for unknown reason, see why # XXX some tests fail on ARM for unknown reason, see why
%mvn_build -f %mvn_build -f -X
tar --delay-directory-restore -xvf target/*tar.bz2 tar --delay-directory-restore -xvf target/*tar.bz2
chmod -R +rwX %{name}-%{version}* chmod -R +rwX %{name}-%{version}*
@ -103,9 +104,6 @@ cp -r %{_datadir}/maven/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# possibly recreate symlinks that can be automated with xmvn-subst # possibly recreate symlinks that can be automated with xmvn-subst
%{name}-subst %{buildroot}%{_datadir}/%{name}/ %{name}-subst %{buildroot}%{_datadir}/%{name}/
for jar in core connector;do
ln -sf %{_javadir}/%{name}/%{name}-$jar.jar %{buildroot}%{_datadir}/%{name}/lib
done
for tool in subst resolver bisect installer;do for tool in subst resolver bisect installer;do
# sisu doesn't contain pom.properties. Manually replace with symlinks # sisu doesn't contain pom.properties. Manually replace with symlinks