RHBZ#832053: Ship SWT and other native plugins as folders.

This commit is contained in:
Krzysztof Daniel 2013-01-25 19:33:06 +01:00
parent 8ffa944ea3
commit 07ac0436c7

View File

@ -65,7 +65,7 @@ fi;
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_version}
Release: 0.4.git20121217%{?dist}
Release: 0.5.git20121217%{?dist}
License: EPL
Group: Development/Tools
URL: http://www.eclipse.org/
@ -551,6 +551,17 @@ mkdir -p rt.equinox.binaries/org.eclipse.equinox.executable/bin/gtk/linux/%{ecli
sed -i -e "s/org.apache.jasper.glassfish/org.glassfish.web.javax.servlet.jsp/" eclipse.platform.common/bundles/org.eclipse.platform.doc.isv/pom.xml
sed -i -e "s/javax.annotation/org.apache.geronimo.specs.geronimo-annotation_1.1_spec/" eclipse.platform.common/bundles/org.eclipse.platform.doc.isv/pom.xml
#ensure that bundles with *.so libs are dirs, so no *.so is extracted into user.home
for f in `find eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.* -name MANIFEST.MF` ; do
echo -e "Eclipse-BundleShape: dir\n\n" >> $f;
done
for f in `find eclipse.platform.resources/bundles/org.eclipse.core.filesystem.linux.* -name MANIFEST.MF` ; do
echo -e "Eclipse-BundleShape: dir\n\n" >> $f;
done
for f in `find eclipse.platform.team/bundles/org.eclipse.core.net/fragments -name MANIFEST.MF` ; do
echo -e "Eclipse-BundleShape: dir\n\n" >> $f;
done
%build
#This is the lowest value where the build succeeds. 512m is not enough.
export MAVEN_OPTS="-Xmx700m -XX:CompileCommand=exclude,org/eclipse/tycho/core/osgitools/EquinoxResolver,newState"
@ -641,22 +652,7 @@ pushd eclipse.platform.releng.tychoeclipsebuilder/platform/target/products/org.f
######################
# Extract jdt and pde to dropins
######################
# do the initializer magic - initialize dropins just in case
mkdir -p eclipse/dropins
cp ../../../../../../../../rt.equinox.incubator/framework/bundles/org.eclipse.equinox.initializer/target/org.eclipse.equinox.initializer-1.0.0-SNAPSHOT.jar eclipse/dropins
pushd eclipse
./eclipse -application org.eclipse.equinox.initializer.configInitializer -justThisArchOSWS -fileInitializer ../../../../../../../../../extract_patterns.txt
rm dropins/org.eclipse.equinox.initializer-1.0.0-SNAPSHOT.jar
./eclipse -application org.eclipse.equinox.p2.reconciler.application
# Create file listings for the extracted shared libraries
echo -n "" > %{_builddir}/%{buildsubdir}/%{name}-platform.install;
for id in `ls configuration/org.eclipse.osgi/bundles`; do
if [ "Xconfiguration" = $(echo X`find configuration/org.eclipse.osgi/bundles/$id -name libswt\*.so` | sed "s:/.*::") ]; then
echo "%verify(not mtime) %{_libdir}/%{name}/configuration/org.eclipse.osgi/bundles/$id" > %{_builddir}/%{buildsubdir}/%{name}-swt.install;
else
echo "%verify(not mtime) %{_libdir}/%{name}/configuration/org.eclipse.osgi/bundles/$id" >> %{_builddir}/%{buildsubdir}/%{name}-platform.install;
fi
done
#symlink what should be symlinked
pushd plugins
@ -802,13 +798,7 @@ cd eclipse
rm -rf configuration/org.eclipse.core.runtime
rm -rf configuration/org.eclipse.equinox.app
rm -rf configuration/org.eclipse.update/*
find configuration -type d -name "data" -exec rm -rf `pwd`{} \;
find configuration -type f -name "*.log" -exec rm `pwd`{} \;
pushd configuration/org.eclipse.osgi
rm -rf .bundledata* .lazy* .manager .state*
popd
rm -rf configuration/org.eclipse.osgi
#symlink jdt & sdk
pushd dropins/jdt/plugins
@ -909,10 +899,14 @@ pushd $RPM_BUILD_ROOT/usr/bin/
ln -s %{_libdir}/%{name}/eclipse
popd
#SWT is now a folder, but we need to provide jars for others that depend on it.
pushd $RPM_BUILD_ROOT/%{_libdir}/%{name}
SWT_JAR=`ls $RPM_BUILD_ROOT/%{_libdir}/%{name}/plugins | grep swt.gtk`
ln -s %{_libdir}/%{name}/plugins/${SWT_JAR} swt.jar
ln -s %{_libdir}/%{name}/plugins/${SWT_JAR} swt-gtk.jar
pushd plugins
SWT_JAR=`ls | grep swt.gtk`
zip "${SWT_JAR}.jar" ${SWT_JAR}/*
popd
ln -s %{_libdir}/%{name}/plugins/"${SWT_JAR}.jar" swt.jar
ln -s %{_libdir}/%{name}/plugins/"${SWT_JAR}.jar" swt-gtk.jar
popd
#eclipse ini
@ -926,21 +920,7 @@ popd
pushd $RPM_BUILD_ROOT%{_libdir}/%{name}
rm -rf icon.xpm
popd
# Remove state files
pushd $RPM_BUILD_ROOT%{_libdir}/%{name}/configuration/org.eclipse.osgi/
rm -rf .bundledata* .lazy* .manager .state*
popd
# Symlinks to the SWT JNI shared libraries in %%{_libdir}/eclipse
pushd $RPM_BUILD_ROOT%{_libdir}/%{name}
for lib in $(find configuration -name libswt\*.so); do
ln -s $lib `basename $lib`
done
popd
# Temporary fix until https://bugs.eclipse.org/294877 is resolved
@ -1076,19 +1056,10 @@ fi
# workaround for rpm bug, can be removed in F-20 Fixes the problem with efj being directory instead of launcher
rm -rf %{_bindir}/efj/
%if %{initialize}
%files swt -f %{name}-swt.install
%else
%files swt
%endif
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins
%if %{initialize}
%{_libdir}/%{name}/libswt-*.so
%dir %{_libdir}/%{name}/configuration
%dir %{_libdir}/%{name}/configuration/org.eclipse.osgi
%dir %{_libdir}/%{name}/configuration/org.eclipse.osgi/bundles
%endif
%{_libdir}/%{name}/notice.html
%{_libdir}/%{name}/eclipse.ini
%{_libdir}/%{name}/.options
@ -1099,11 +1070,8 @@ rm -rf %{_bindir}/efj/
%{_libdir}/%{name}/swt.jar
%{_libdir}/java/swt.jar
%if %{initialize}
%files platform -f %{name}-platform.install
%else
%files platform
%endif
%attr(0755,root,root) %{_bindir}/%{name}
%{_libdir}/%{name}/.eclipseproduct
%config %{_libdir}/%{name}/eclipse.ini
@ -1348,6 +1316,9 @@ rm -rf %{_bindir}/efj/
%{_mavendepmapfragdir}/%{name}-equinox-osgi
%changelog
* Fri Jan 25 2013 Krzysztof Daniel <kdaniel@redhat.com> 1:4.2.2-0.5.git20121217
- RHBZ#832053: Ship SWT and other native plugins as folders.
* Thu Jan 17 2013 Krzysztof Daniel <kdaniel@redhat.com> 1:4.2.2-0.4.git20121217
- RHBZ#893774: file shipped twice in eclipse-platform and eclipse-equinox-osgi