Add bindings for XMvn toolchains
Bootstrap build. Related: RHEL-71059 Related: RHEL-71062
This commit is contained in:
parent
36f26757bb
commit
3f9204f87f
59
build.bash
59
build.bash
@ -1,59 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
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
|
|
||||||
"""
|
|
@ -2,5 +2,8 @@ summary: XMvn smoke test
|
|||||||
description: |
|
description: |
|
||||||
Test basic functionality of XMvn.
|
Test basic functionality of XMvn.
|
||||||
require:
|
require:
|
||||||
|
- xmvn
|
||||||
|
- xmvn-minimal
|
||||||
|
- xmvn-tools
|
||||||
- maven-dependency-plugin
|
- maven-dependency-plugin
|
||||||
- junit
|
- junit
|
||||||
|
11
toolchains-openjdk21.xml
Normal file
11
toolchains-openjdk21.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<toolchains>
|
||||||
|
<toolchain>
|
||||||
|
<type>jdk</type>
|
||||||
|
<provides>
|
||||||
|
<xmvn>xmvn</xmvn>
|
||||||
|
</provides>
|
||||||
|
<configuration>
|
||||||
|
<jdkHome>/usr/lib/jvm/java-21-openjdk</jdkHome>
|
||||||
|
</configuration>
|
||||||
|
</toolchain>
|
||||||
|
</toolchains>
|
21
xmvn.spec
21
xmvn.spec
@ -1,4 +1,4 @@
|
|||||||
%bcond_with bootstrap
|
%bcond_without bootstrap
|
||||||
|
|
||||||
%if %{with bootstrap}
|
%if %{with bootstrap}
|
||||||
%global mbi 1
|
%global mbi 1
|
||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Name: xmvn
|
Name: xmvn
|
||||||
Version: 4.2.0
|
Version: 4.2.0
|
||||||
Release: 13%{?dist}
|
Release: 14%{?dist}
|
||||||
Summary: Local Extensions for Apache Maven
|
Summary: Local Extensions for Apache Maven
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://fedora-java.github.io/xmvn/
|
URL: https://fedora-java.github.io/xmvn/
|
||||||
@ -15,6 +15,8 @@ ExclusiveArch: %{java_arches} noarch
|
|||||||
|
|
||||||
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
|
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
|
||||||
|
|
||||||
|
Source21: toolchains-openjdk21.xml
|
||||||
|
|
||||||
%if %{with bootstrap}
|
%if %{with bootstrap}
|
||||||
BuildRequires: javapackages-bootstrap
|
BuildRequires: javapackages-bootstrap
|
||||||
%else
|
%else
|
||||||
@ -59,7 +61,6 @@ creating RPM packages containing Maven artifacts.
|
|||||||
Summary: Dependency-reduced version of XMvn
|
Summary: Dependency-reduced version of XMvn
|
||||||
Requires: %{name}-core = %{version}-%{release}
|
Requires: %{name}-core = %{version}-%{release}
|
||||||
Requires: apache-commons-cli
|
Requires: apache-commons-cli
|
||||||
Requires: apache-commons-lang3
|
|
||||||
Requires: atinject
|
Requires: atinject
|
||||||
Requires: google-guice
|
Requires: google-guice
|
||||||
Requires: guava
|
Requires: guava
|
||||||
@ -125,7 +126,7 @@ Summary: API documentation for %{name}
|
|||||||
This package provides %{summary}.
|
This package provides %{summary}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
%mvn_package ::tar.gz: __noinstall
|
%mvn_package ::tar.gz: __noinstall
|
||||||
%mvn_package ":{xmvn,xmvn-connector}" xmvn
|
%mvn_package ":{xmvn,xmvn-connector}" xmvn
|
||||||
@ -139,7 +140,7 @@ This package provides %{summary}.
|
|||||||
# Copy Maven home packaged as RPM instead of unpacking Maven binary
|
# Copy Maven home packaged as RPM instead of unpacking Maven binary
|
||||||
# tarball with maven-dependency-plugin
|
# tarball with maven-dependency-plugin
|
||||||
%pom_remove_plugin :maven-dependency-plugin
|
%pom_remove_plugin :maven-dependency-plugin
|
||||||
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
|
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} type -p mvn)))/..)
|
||||||
mver=$(sed -n '/<mavenVersion>/{s/.*>\(.*\)<.*/\1/;p}' \
|
mver=$(sed -n '/<mavenVersion>/{s/.*>\(.*\)<.*/\1/;p}' \
|
||||||
xmvn-parent/pom.xml)
|
xmvn-parent/pom.xml)
|
||||||
mkdir -p target/dependency/
|
mkdir -p target/dependency/
|
||||||
@ -170,7 +171,7 @@ rm -f %{name}-${version}/bin/*
|
|||||||
%mvn_install
|
%mvn_install
|
||||||
|
|
||||||
version=4.*
|
version=4.*
|
||||||
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
|
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} type -p mvn)))/..)
|
||||||
|
|
||||||
install -d -m 755 %{buildroot}%{_datadir}/%{name}
|
install -d -m 755 %{buildroot}%{_datadir}/%{name}
|
||||||
cp -r%{?mbi:L} %{name}-${version}/* %{buildroot}%{_datadir}/%{name}/
|
cp -r%{?mbi:L} %{name}-${version}/* %{buildroot}%{_datadir}/%{name}/
|
||||||
@ -212,6 +213,11 @@ cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
|
|||||||
# Make sure javapackages config is not bundled
|
# Make sure javapackages config is not bundled
|
||||||
rm -rf %{buildroot}%{_datadir}/%{name}/{configuration.xml,config.d/,conf/toolchains.xml,maven-metadata/}
|
rm -rf %{buildroot}%{_datadir}/%{name}/{configuration.xml,config.d/,conf/toolchains.xml,maven-metadata/}
|
||||||
|
|
||||||
|
# Toolchains
|
||||||
|
ln -sf %{_jpbindingdir}/xmvn-toolchains.xml %{buildroot}%{_datadir}/%{name}/conf/toolchains.xml
|
||||||
|
install -p -m 644 %{SOURCE21} %{buildroot}%{_datadir}/%{name}/conf/toolchains-openjdk21.xml
|
||||||
|
%jp_binding --verbose --base-pkg xmvn-minimal --binding-pkg xmvn-toolchain-openjdk21 --variant openjdk21 --ghost xmvn-toolchains.xml --target %{_datadir}/%{name}/conf/toolchains-openjdk21.xml --requires java-21-openjdk-devel
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_bindir}/mvn-local
|
%{_bindir}/mvn-local
|
||||||
|
|
||||||
@ -244,6 +250,9 @@ rm -rf %{buildroot}%{_datadir}/%{name}/{configuration.xml,config.d/,conf/toolcha
|
|||||||
%license LICENSE NOTICE
|
%license LICENSE NOTICE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 23 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-14
|
||||||
|
- Add bindings for XMvn toolchains
|
||||||
|
|
||||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.2.0-13
|
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.2.0-13
|
||||||
- Bump release for October 2024 mass rebuild:
|
- Bump release for October 2024 mass rebuild:
|
||||||
Resolves: RHEL-64018
|
Resolves: RHEL-64018
|
||||||
|
Loading…
Reference in New Issue
Block a user