Debootstrap build

This commit is contained in:
Mat Booth 2017-04-26 21:27:52 +01:00
parent a4fb735587
commit 609c843ac2
1 changed files with 18 additions and 13 deletions

View File

@ -6,11 +6,11 @@
# This basically uses javac + xmvn to build only the Tycho components
# required to perform a full Tycho build
# Most common usage : A library (in Fedora) used by Tycho's runtime broke API
%global tycho_bootstrap 1
%global tycho_bootstrap 0
# Set 'eclipse_bootstrap' if Eclipse from buildroot cannot help build Tycho
# This basically provides a location for usage of pre-bundled Eclipse
# Possible uses : Need to build Tycho before Eclipse in fresh buildroot
%global eclipse_bootstrap 1
%global eclipse_bootstrap 0
# When building version under development (non-release)
# %%global snap -SNAPSHOT
%global snap %{nil}
@ -25,7 +25,7 @@
Name: tycho
Version: 1.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
# license file is missing but all files having some licensing information are ASL 2.0
@ -247,31 +247,28 @@ cp %{SOURCE2} %{SOURCE3} .
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
medadataFile=%{_datadir}/maven-metadata/tycho.xml
sysVer=`grep -C 1 "<artifactId>tycho</artifactId>" %{_mavenpomdir}/tycho/tycho.pom | grep "version" | sed 's/.*>\(.*\)<.*/\1/'`
mkdir boot
sed -e 's/ns[0-9]://g' %{_datadir}/maven-metadata/tycho.xml > boot/tycho-metadata.xml
# Copy Tycho POMs from system repo and set their versions to %%{version}-SNAPSHOT.
for pom in $(grep 'pom</ns[0-9]:path>' $medadataFile | sed 's|.*>\(.*\)<.*|\1|'); do
sed '
s/$sysVer/%{version}-SNAPSHOT/g
s/%{fp_p2_version}%{fp_p2_snap}/%{fp_p2_version}/
' <$pom >boot/$(basename $pom)
for pom in $(grep 'pom</path>' boot/tycho-metadata.xml | sed 's|.*>\(.*\)<.*|\1|'); do
sed -e "s/>$sysVer/>%{version}-SNAPSHOT/g" -e "s/%{fp_p2_version}%{fp_p2_snap}/%{fp_p2_version}/" <$pom >boot/$(basename $pom)
done
# Update Maven lifecycle mappings for Tycho packaging types provided by tycho-maven-plugin.
cp %{_javadir}/tycho/tycho-maven-plugin.jar boot/tycho-maven-plugin.jar
cp -p $(build-classpath tycho/tycho-maven-plugin) boot/tycho-maven-plugin.jar
jar xf boot/tycho-maven-plugin.jar META-INF/plexus/components.xml
sed -i s/$sysVer/%{version}-SNAPSHOT/ META-INF/plexus/components.xml
jar uf boot/tycho-maven-plugin.jar META-INF/plexus/components.xml
# Create XMvn metadata for the new JARs and POMs by customizing system Tycho metadata.
sed '
sed -i '
s|>/[^<]*/\([^/]*\.pom\)</path>|>'$PWD'/boot/\1</path>|
s|>'$sysVer'</version>|>%{version}-SNAPSHOT</version><compatVersions><version>%{version}-SNAPSHOT</version></compatVersions>|
s|>'%{fp_p2_version}%{fp_p2_snap}'</version>|>%{fp_p2_version}</version><compatVersions><version>%{fp_p2_version}</version></compatVersions>|
s|%{_javadir}/tycho/tycho-maven-plugin.jar|'$PWD'/boot/tycho-maven-plugin.jar|
' $medadataFile >boot/tycho-metadata.xml
' boot/tycho-metadata.xml
%mvn_config resolverSettings/metadataRepositories/repository $PWD/boot/tycho-metadata.xml
%endif
@ -320,7 +317,6 @@ cp %{SOURCE2} %{SOURCE4} .
# Debundle p2 runtime
./%{name}-debundle.sh $(pwd)/tycho-bundles/tycho-bundles-external \
$(pwd)/tycho-bundles/tycho-bundles-external/target/tycho-bundles-external-manifest.txt
%mvn_artifact org.eclipse.tycho:tycho-bundles-external:txt:manifest:%{version} tycho-bundles/tycho-bundles-external/target/tycho-bundles-external-manifest.txt
# Debundle standalone p2 director
./%{name}-debundle.sh $(pwd)/tycho-bundles/tycho-standalone-p2-director
@ -339,6 +335,12 @@ done
%endif
%mvn_install
install -pm 644 tycho-bundles/tycho-bundles-external/target/tycho-bundles-external-manifest.txt %{buildroot}%{_javadir}/tycho
%add_maven_depmap org.eclipse.tycho:tycho-bundles-external:txt:manifest:%{version}%{snap} tycho/tycho-bundles-external-manifest.txt
# For some reason fp-p2 is treated as a compat version, this prevents that
# TODO: figure out why
sed -i '/<resolvedVersion>/d' %{buildroot}%{_datadir}/maven-metadata/tycho.xml
# p2-install script
@ -363,6 +365,9 @@ ln -s %{_javadir}/tycho/org.fedoraproject.p2.jar %{buildroot}%{_datadir}/xmvn/li
%files javadoc -f .mfiles-javadoc
%changelog
* Wed Apr 26 2017 Mat Booth <mat.booth@redhat.com> - 1.0.0-2
- Debootstrap build
* Thu Apr 20 2017 Mat Booth <mat.booth@redhat.com> - 1.0.0-1
- Update to 1.0.0
- Simplify artifact installation