Compare commits

...

3 Commits

Author SHA1 Message Date
Mat Booth ae6377933f Copy zip artifacts in copy-platform-all 2014-07-22 13:52:42 +01:00
Mat Booth 4aa3c84251 Don't check /usr/lib*/eclipse/dropins twice in copy-platform-all
- Non-bootstrap build
2014-07-14 13:10:40 +01:00
Mat Booth 29316bba43 SCL-ize and bootstrap build. 2014-07-09 18:12:39 +01:00
3 changed files with 99 additions and 70 deletions

View File

@ -6,15 +6,29 @@ repo=$1
echo Building system local p2 repository... >&2
eclipse=$(rpm --eval '%{_libdir}')/eclipse
if [ -n "$X_SCLS" ] ; then
for scl in $X_SCLS ; do
_scl_root="/opt/rh/$scl/root"
if [ -z "$scl_root" ] ; then
scl_root=$_scl_root
mkdir -p .m2/org/eclipse/tycho/tycho-bundles-external/0.20.0
mkdir -p .m2/org/eclipse/tycho/tycho-standalone-p2-director/0.20.0
cp $scl_root/usr/share/java/tycho/tycho-bundles-external.zip .m2/org/eclipse/tycho/tycho-bundles-external/0.20.0/tycho-bundles-external-0.20.0.zip
cp $scl_root/usr/share/java/tycho/tycho-standalone-p2-director.zip .m2/org/eclipse/tycho/tycho-standalone-p2-director/0.20.0/tycho-standalone-p2-director-0.20.0.zip
fi
javadir="$javadir $_scl_root/usr/share/java"
jnidir="$jnidir $_scl_root/usr/lib/java"
done
fi
datadir=/usr/share/eclipse
javadir=/usr/share/java
jnidir=/usr/lib/java
eclipse="$scl_root$(rpm --eval '%{_libdir}')/eclipse"
datadir="$scl_root/usr/share/eclipse"
javadir="$javadir /usr/share/java"
jnidir="$jnidir /usr/lib/java"
launcher="/usr/lib*/eclipse/plugins/org.eclipse.equinox.launcher_*.jar"
launcher="$scl_root/usr/lib*/eclipse/plugins/org.eclipse.equinox.launcher_*.jar"
if [ ! -e ${launcher} ]; then
launcher="$javadir/tycho/tycho-bundles-external.zip"
launcher="$scl_root/usr/share/java/tycho/tycho-bundles-external.zip"
if [ -e ${launcher} ]; then
mkdir -p .tycho-runtime
unzip ${launcher} -d .tycho-runtime
@ -70,25 +84,9 @@ pushd $sdk >/dev/null
fi
done
for p in $(ls -d $eclipse/dropins/jdt/plugins/* 2>/dev/null); do
plugin=$(basename $p)
[ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/jdt/plugins/$plugin plugins/$plugin
done
for f in $(ls -d $eclipse/dropins/jdt/features/* 2>/dev/null); do
for f in $(ls -d $scl_root/usr/share/java/eclipse-license/eclipse/features/* 2>/dev/null); do
feature=$(basename $f)
[ ! -e features/$feature ] && ln -s $eclipse/dropins/jdt/features/$feature features/$feature
done
for p in $(ls -d $eclipse/dropins/sdk/plugins/* 2>/dev/null); do
plugin=$(basename $p)
[ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/sdk/plugins/$plugin plugins/$plugin
done
for f in $(ls -d $eclipse/dropins/sdk/features/* 2>/dev/null); do
feature=$(basename $f)
[ ! -e features/$feature ] && ln -s $eclipse/dropins/sdk/features/$feature features/$feature
done
for f in $(ls -d $javadir/eclipse-license/eclipse/features/* 2>/dev/null); do
feature=$(basename $f)
[ ! -e features/$feature ] && ln -s $javadir/eclipse-license/eclipse/features/$feature features/$feature
[ ! -e features/$feature ] && ln -s $scl_root/usr/share/java/eclipse-license/eclipse/features/$feature features/$feature
done
# jars in %%{_javadir} may not be uniquely named

View File

@ -1,2 +1,2 @@
cdbd828c774f7508e65dcef3324b9d2d tycho-0.20.0.tar.bz2
b2de7dbdbc54879ec4e39aee1409540e eclipse-bootstrap.tar.xz
085eca8ea3c00e420d45e19755b5a2f3 eclipse-bootstrap.tar.xz

View File

@ -1,3 +1,6 @@
%{?scl:%scl_package tycho}
%{!?scl:%global pkg_name %{name}}
# Bootstrap build
# Tycho depends on itself, and Eclipse to build but in certain cases
# these requirements may not be satisfiable.
@ -17,9 +20,9 @@
%define __requires_exclude osgi*
Name: tycho
Name: %{?scl_prefix}tycho
Version: 0.20.0
Release: 9%{?dist}
Release: 9.3%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
@ -32,25 +35,25 @@ Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/ty
# version 2.4.3 (impossible to have empty mojo created as aggregate). This
# should be fixed upstream properly
Source1: EmptyMojo.java
Source2: %{name}-bootstrap.sh
Source2: tycho-bootstrap.sh
Source3: copy-platform-all
# Fedora Eclipse bundles (needed when Eclipse not present) to build Tycho
%if %{eclipse_bootstrap}
Source4: eclipse-bootstrap.tar.xz
%endif
Patch0: %{name}-fix-build.patch
Patch1: %{name}-eclipse-luna.patch
Patch0: %{pkg_name}-fix-build.patch
Patch1: %{pkg_name}-eclipse-luna.patch
# Upstream builds against maven-surefire 2.12.3
Patch2: %{name}-maven-surefire.patch
Patch3: %{name}-fix-surefire.patch
Patch4: %{name}-use-custom-resolver.patch
Patch2: %{pkg_name}-maven-surefire.patch
Patch3: %{pkg_name}-fix-surefire.patch
Patch4: %{pkg_name}-use-custom-resolver.patch
# Set some temporary build version so that the bootstrapped build has
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
Patch5: %{name}-bootstrap.patch
Patch5: %{pkg_name}-bootstrap.patch
# Additional changes needed just for bootstrap build
Patch6: %{name}-fix-bootstrap-build.patch
Patch6: %{pkg_name}-fix-bootstrap-build.patch
BuildArch: noarch
@ -65,26 +68,24 @@ BuildRequires: maven-javadoc-plugin
BuildRequires: maven-release-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-verifier
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: objectweb-asm
BuildRequires: objectweb-asm4
BuildRequires: plexus-containers-component-metadata
BuildRequires: apache-commons-exec
BuildRequires: decentxml
BuildRequires: easymock
BuildRequires: ecj
BuildRequires: %{?scl_prefix}ecj
BuildRequires: maven-plugin-testing-harness
%if ! %{tycho_bootstrap}
BuildRequires: %{name}
%endif
%if %{eclipse_bootstrap}
# Dependencies for Eclipse bundles we use
BuildRequires: icu4j-eclipse
BuildRequires: %{?scl_prefix}icu4j-eclipse
BuildRequires: %{?scl_prefix}batik
BuildRequires: geronimo-annotation
BuildRequires: sac
BuildRequires: sat4j
%else
BuildRequires: eclipse-platform
BuildRequires: %{?scl_prefix}eclipse-platform
%endif
BuildRequires: jetty-http
BuildRequires: jetty-util
@ -100,12 +101,12 @@ Requires: maven-local
Requires: maven-clean-plugin
Requires: maven-dependency-plugin
Requires: maven-verifier
Requires: maven-surefire-provider-junit
Requires: objectweb-asm
Requires: ecj
Requires: objectweb-asm4
Requires: %{?scl_prefix}ecj
%if ! %{eclipse_bootstrap}
Requires: eclipse-platform
Requires: %{?scl_prefix}eclipse-platform
%endif
%{?scl:Requires: %scl_runtime}
# Tycho always tries to resolve all build plugins, even if they are
# not needed during Maven lifecycle. This means that Tycho will try
@ -161,7 +162,7 @@ Requires: jpackage-utils
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-0.20.0
%setup -q -n tycho-0.20.0
%patch0 -p1
%patch1 -p1
@ -171,6 +172,8 @@ This package contains the API documentation for %{name}.
find tycho-core -iname '*html' -delete
sed -i -e 's|"/usr/share/java/tycho/copy-platform-all"|"%{?_scl_root}/usr/share/java/tycho/copy-platform-all"|' tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
sed -i -e 's/org.apache.maven.it.util.DirectoryScanner/org.apache.maven.shared.utils.io.DirectoryScanner/g' tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java
# Move from org.sonatype.aether to org.eclipse.aether
@ -178,6 +181,11 @@ find . -name "*.java" | xargs sed -i 's/org.sonatype.aether/org.eclipse.aether/g
find . -name "*.java" | xargs sed -i 's/org.eclipse.aether.util.DefaultRepositorySystemSession/org.eclipse.aether.DefaultRepositorySystemSession/g'
sed -i 's/public int getPriority/public float getPriority/g' tycho-core/src/main/java/org/eclipse/tycho/core/p2/P2RepositoryConnectorFactory.java
# Do not depend on easymock
%pom_remove_dep "org.easymock:easymock" tycho-core
# Don't resolve target platform
%pom_xpath_remove "pom:plugin[pom:artifactId[text()='target-platform-configuration']]/pom:configuration" tycho-bundles
# place empty mojo in place
mkdir -p tycho-maven-plugin/src/main/java/org/fedoraproject
pushd tycho-maven-plugin/src/main/java/org/fedoraproject
@ -197,7 +205,9 @@ tar -xf %{SOURCE4}
%patch6 -p1
# Perform the 'minimal' (bootstrap) build of Tycho
%{?scl:scl enable %{scl} - << "EOF"}
%{SOURCE2} %{eclipse_bootstrap}
%{?scl:EOF}
%patch6 -p1 -R
@ -226,6 +236,12 @@ done
%pom_xpath_remove "pom:dependency[pom:classifier='tests']" tycho-compiler-plugin
%pom_xpath_remove "pom:dependency[pom:classifier='tests']" tycho-packaging-plugin
# Not sure why this is needed yet...
mkdir -p .m2/org/eclipse/tycho/tycho-bundles-external/0.20.0
mkdir -p .m2/org/eclipse/tycho/tycho-standalone-p2-director/0.20.0
cp %{_javadir}/tycho/tycho-bundles-external.zip .m2/org/eclipse/tycho/tycho-bundles-external/0.20.0/tycho-bundles-external-0.20.0.zip
cp %{_javadir}/tycho/tycho-standalone-p2-director.zip .m2/org/eclipse/tycho/tycho-standalone-p2-director/0.20.0/tycho-standalone-p2-director-0.20.0.zip
# installed version of Tycho
sysVer=`grep -C 1 "<artifactId>tycho</artifactId>" %{_mavenpomdir}/JPP.tycho-main.pom | grep "version" | sed 's/.*>\(.*\)<.*/\1/'`
@ -240,7 +256,9 @@ if [ "${sysVer}" == "${buildVer}" ]; then
echo "Performing intermediary build"
%patch5 -p1
%{?scl:scl enable %{scl} - << "EOF"}
xmvn -o -Dmaven.test.skip=true -Dmaven.repo.local=$(pwd)/.m2 install
%{?scl:EOF}
%patch5 -p1 -R
@ -251,11 +269,13 @@ fi
%endif
%build
%{?scl:scl enable %{scl} - << "EOF"}
xmvn -o -Dmaven.test.skip=true -Dmaven.repo.local=$(pwd)/.m2 clean install org.apache.maven.plugins:maven-javadoc-plugin:aggregate
%{?scl:EOF}
%install
mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
# pom and jar installation
@ -268,9 +288,9 @@ for mod in target-platform-configuration tycho-compiler-{jdt,plugin} \
tycho-surefire/{tycho-surefire-plugin,org.eclipse.tycho.surefire.{osgibooter,junit,junit4{,7}}}; do
echo $mod
aid=`basename $mod`
install -pm 644 $mod/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$aid.pom
install -m 644 $mod/target/$aid-%{version}%{snap}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$aid.jar
%add_maven_depmap JPP.%{name}-$aid.pom %{name}/$aid.jar -a "org.eclipse.tycho:$aid"
install -pm 644 $mod/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-$aid.pom
install -m 644 $mod/target/$aid-%{version}%{snap}.jar $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/$aid.jar
%add_maven_depmap JPP.%{pkg_name}-$aid.pom %{pkg_name}/$aid.jar -a "org.eclipse.tycho:$aid"
done
# pom installation
@ -278,32 +298,32 @@ for pommod in tycho-p2 tycho-bundles tycho-surefire \
tycho-release sisu-equinox; do
aid=`basename $pommod`
install -pm 644 $pommod/pom.xml \
$RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$aid.pom
%add_maven_depmap JPP.%{name}-$aid.pom -a "org.eclipse.tycho:$aid"
$RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-$aid.pom
%add_maven_depmap JPP.%{pkg_name}-$aid.pom -a "org.eclipse.tycho:$aid"
done
# p2 runtime
dir=.m2/org/eclipse/tycho/tycho-bundles-external/%{version}%{snap}
install -pm 644 $dir/tycho-bundles-external-%{version}*.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-tycho-bundles-external.pom
install -m 644 $dir/tycho-bundles-external-%{version}*.zip $RPM_BUILD_ROOT%{_javadir}/%{name}/tycho-bundles-external.zip
%add_maven_depmap JPP.%{name}-tycho-bundles-external.pom %{name}/tycho-bundles-external.zip -a "org.eclipse.tycho:tycho-bundles-external"
install -pm 644 $dir/tycho-bundles-external-%{version}*.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-tycho-bundles-external.pom
install -m 644 $dir/tycho-bundles-external-%{version}*.zip $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/tycho-bundles-external.zip
%add_maven_depmap JPP.%{pkg_name}-tycho-bundles-external.pom %{pkg_name}/tycho-bundles-external.zip -a "org.eclipse.tycho:tycho-bundles-external"
# main
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-main.pom
%add_maven_depmap JPP.%{name}-main.pom
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-main.pom
%add_maven_depmap JPP.%{pkg_name}-main.pom
# standalone p2 director
pushd .m2/org/eclipse/tycho/tycho-standalone-p2-director/%{version}%{snap}/
install -m 644 tycho-standalone-p2-director-%{version}*.zip $RPM_BUILD_ROOT%{_javadir}/%{name}/tycho-standalone-p2-director.zip
install -pm 644 tycho-standalone-p2-director-%{version}*.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-tycho-standalone-p2-director.pom
install -m 644 tycho-standalone-p2-director-%{version}*.zip $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/tycho-standalone-p2-director.zip
install -pm 644 tycho-standalone-p2-director-%{version}*.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-tycho-standalone-p2-director.pom
popd
%add_maven_depmap JPP.%{name}-tycho-standalone-p2-director.pom tycho/tycho-standalone-p2-director.zip -a "org.eclipse.tycho:tycho-standalone-p2-director"
%add_maven_depmap JPP.%{pkg_name}-tycho-standalone-p2-director.pom tycho/tycho-standalone-p2-director.zip -a "org.eclipse.tycho:tycho-standalone-p2-director,org.sonatype.tycho:tycho-standalone-p2-director"
# javadoc
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr target/site/api*/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
cp -pr target/site/api*/* $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_javadir}/%{name}/copy-platform-all
install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/copy-platform-all
%if %{eclipse_bootstrap}
# org.eclipse.osgi
@ -319,8 +339,8 @@ echo '<?xml version="1.0" encoding="UTF-8"?>
</project>' > JPP.tycho-osgi.pom
install -pm 644 JPP.tycho-osgi.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom
install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
%add_maven_depmap JPP.%{name}-osgi.pom %{name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi"
install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/osgi.jar
%add_maven_depmap JPP.tycho-osgi.pom %{pkg_name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi"
# org.eclipse.osgi.compatibility.state
osgiStateJarPath=`find ".m2/org" -name "org.eclipse.osgi.compatibility.state_*.jar"`
@ -335,18 +355,29 @@ echo '<?xml version="1.0" encoding="UTF-8"?>
</project>' > JPP.tycho-osgi.compatibility.state.pom
install -pm 644 JPP.tycho-osgi.compatibility.state.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.compatibility.state.pom
install -m 644 $osgiStateJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.compatibility.state.jar
%add_maven_depmap JPP.%{name}-osgi.compatibility.state.pom %{name}/osgi.compatibility.state.jar -a "org.eclipse.tycho:org.eclipse.osgi.compatibility.state"
install -m 644 $osgiStateJarPath $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/osgi.compatibility.state.jar
%add_maven_depmap JPP.tycho-osgi.compatibility.state.pom %{pkg_name}/osgi.compatibility.state.jar -a "org.eclipse.tycho:org.eclipse.osgi.compatibility.state"
%endif
%files -f .mfiles
%{_javadir}/%{name}/
%dir %{_javadir}/%{pkg_name}
%{_javadir}/%{pkg_name}/copy-platform-all
%doc README.md
%files javadoc
%{_javadocdir}/%{name}
%{_javadocdir}/%{pkg_name}
%changelog
* Tue Jul 22 2014 Mat Booth <mat.booth@redhat.com> - 0.20.0-9.3
- Copy zip artifacts in copy-platform-all
* Fri Jul 11 2014 Mat Booth <mat.booth@redhat.com> - 0.20.0-9.2
- Don't check /usr/lib*/eclipse/dropins twice in copy-platform-all
- Non-bootstrap build
* Wed Jul 09 2014 Mat Booth <mat.booth@redhat.com> - 0.20.0-9.1
- SCL-ize and bootstrap build.
* Thu May 29 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0.20.0-9
- Don'n install duplicate Maven metadata for sisu-equinox