Introduce a macro for symlinking.

Bug 851190 - eclipse CBI build does not Requires: icu4j-eclipse
This commit is contained in:
Krzysztof Daniel 2012-08-24 09:26:01 +02:00
parent 3efd1a22f4
commit 03ba9e74ea
2 changed files with 74 additions and 191 deletions

View File

@ -16,6 +16,20 @@ Epoch: 1
# Prevent brp-java-repack-jars from being run.
%define __jar_repack 0
# A small utility macro for replacing dependency bundles with symlinks
# The pattern should match the plugin name from the beginning and filter only one plugin
# Usage:
# %%_symlink pattern path-to-jar-inside /usr/share/java
# Example:
# %%_symlink com.jcraft.jsch_ jsch.jar
# The macro will locate a jar matching to ^com.jcraft.jsch_ and replace it with
# a symlink to /usr/share/java/jsch.jar but preserving the original file name.
%define _symlink() \
_f=`ls | grep -e "^%{1}"`; \
rm -rf ${_f} ; \
ln -s %{_javadir}/%{2} ${_f}
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_version}
@ -196,6 +210,7 @@ Requires: eclipse-ecf-core
Requires: eclipse-emf-core
Requires: tomcat-servlet-3.0-api
Requires: glassfish-jsp >= 2.2.5
Requires: icu4j-eclipse >= 1:4.4.2.2-11
Provides: eclipse-cvs-client = 1:%{eclipse_version}-%{release}
Obsoletes: eclipse-cvs-client < 1:3.3.2-20
Obsoletes: eclipse-rcp < 1:%{eclipse_version}-%{release}
@ -424,197 +439,54 @@ done
#symlink what should be symlinked
pushd plugins
#So, remove duplicated jars and symlink them
f=`ls | grep -e "^com.ibm.icu_"`
rm $f
ln -s %{_javadir}/icu4j-eclipse/plugins/com.ibm.icu_*.jar $f
f=`ls | grep -e "^com.jcraft.jsch_"`
rm $f
ln -s %{_javadir}/jsch.jar $f
f=`ls | grep -e "^javax.el_"`
rm $f
ln -s %{_javadir}/tomcat-el-api.jar $f
f=`ls | grep -e "^javax.inject_"`
rm $f
ln -s %{_javadir}/atinject.jar $f
f=`ls | grep -e "^javax.servlet_"`
rm $f
ln -s %{_javadir}/tomcat-servlet-api.jar $f
f=`ls | grep -e "^javax.servlet.jsp_"`
rm $f
ln -s %{_javadir}/tomcat-jsp-api.jar $f
f=`ls | grep -e "^javax.xml_"`
rm $f
ln -s %{_javadir}/xml-commons-apis.jar $f
f=`ls | grep -e "^org.apache.batik.css_"`
rm $f
ln -s %{_javadir}/batik/batik-css.jar $f
f=`ls | grep -e "^org.apache.batik.util_"`
rm $f
ln -s %{_javadir}/batik/batik-util.jar $f
f=`ls | grep -e "^org.apache.batik.util.gui_"`
rm $f
ln -s %{_javadir}/batik/batik-gui-util.jar $f
f=`ls | grep -e "^org.apache.commons.codec_"`
rm $f
ln -s %{_javadir}/commons-codec.jar $f
f=`ls | grep -e "^org.apache.commons.el_"`
rm $f
ln -s %{_javadir}/commons-el.jar $f
f=`ls | grep -e "^org.apache.commons.httpclient_"`
rm $f
ln -s %{_javadir}/commons-httpclient.jar $f
f=`ls | grep -e "^org.apache.commons.logging_"`
rm $f
ln -s %{_javadir}/commons-logging.jar $f
f=`ls | grep -e "^org.apache.el_"`
rm $f
ln -s %{_javadir}/tomcat/jasper-el.jar $f
f=`ls | grep -e "^org.apache.felix.gogo.command_"`
rm $f
ln -s %{_javadir}/felix/org.apache.felix.gogo.command.jar $f
f=`ls | grep -e "^org.apache.felix.gogo.runtime_"`
rm $f
ln -s %{_javadir}/felix/org.apache.felix.gogo.runtime.jar $f
f=`ls | grep -e "^org.apache.felix.gogo.shell_"`
rm $f
ln -s %{_javadir}/felix/org.apache.felix.gogo.shell.jar $f
f=`ls | grep -e "^org.apache.geronimo.specs.geronimo-annotation_1.1_spec_"`
rm $f
ln -s %{_javadir}/geronimo-annotation.jar $f
f=`ls | grep -e "^org.apache.jasper_"`
rm $f
ln -s %{_javadir}/tomcat/jasper.jar $f
f=`ls | grep -e "^org.apache.juli_"`
rm $f
ln -s %{_javadir}/tomcat/tomcat-juli.jar $f
f=`ls | grep -e "^org.apache.lucene.core_"`
rm $f
ln -s %{_javadir}/lucene.jar $f
f=`ls | grep -e "^org.apache.lucene.analysis_"`
rm $f
ln -s %{_javadir}/lucene-contrib/lucene-analyzers.jar $f
f=`ls | grep -e "^org.apache.tomcat_"`
rm $f
ln -s %{_javadir}/tomcat/tomcat-api.jar $f
f=`ls | grep -e "^org.eclipse.ecf_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.identity_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.identity_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.filetransfer_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.filetransfer_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.provider.filetransfer.httpclient_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.httpclient_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.provider.filetransfer.httpclient.ssl_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.httpclient.ssl_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.provider.filetransfer.ssl_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.ssl_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.provider.filetransfer_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer_*.jar $f
f=`ls | grep -e "^org.eclipse.ecf.ssl_"`
rm $f
ln -s %{_javadir}/ecf/eclipse/plugins/org.eclipse.ecf.ssl_*.jar $f
f=`ls | grep -e "^org.eclipse.emf.common_"`
rm $f
ln -s %{_javadir}/emf/eclipse/plugins/org.eclipse.emf.common_*.jar $f
f=`ls | grep -e "^org.eclipse.emf.ecore.change_"`
rm $f
ln -s %{_javadir}/emf/eclipse/plugins/org.eclipse.emf.ecore.change_*.jar $f
f=`ls | grep -e "^org.eclipse.emf.ecore_"`
rm $f
ln -s %{_javadir}/emf/eclipse/plugins/org.eclipse.emf.ecore_*.jar $f
f=`ls | grep -e "^org.eclipse.emf.ecore.xmi_"`
rm $f
ln -s %{_javadir}/emf/eclipse/plugins/org.eclipse.emf.ecore.xmi_*.jar $f
f=`ls | grep -e "^org.eclipse.jetty.util_"`
rm $f
ln -s %{_javadir}/jetty/jetty-util.jar $f
f=`ls | grep -e "^org.eclipse.jetty.server_"`
rm $f
ln -s %{_javadir}/jetty/jetty-server.jar $f
f=`ls | grep -e "^org.eclipse.jetty.http_"`
rm $f
ln -s %{_javadir}/jetty/jetty-http.jar $f
f=`ls | grep -e "^org.eclipse.jetty.continuation_"`
rm $f
ln -s %{_javadir}/jetty/jetty-continuation.jar $f
f=`ls | grep -e "^org.eclipse.jetty.io_"`
rm $f
ln -s %{_javadir}/jetty/jetty-io.jar $f
f=`ls | grep -e "^org.eclipse.jetty.security_"`
rm $f
ln -s %{_javadir}/jetty/jetty-security.jar $f
f=`ls | grep -e "^org.eclipse.jetty.servlet_"`
rm $f
ln -s %{_javadir}/jetty/jetty-servlet.jar $f
f=`ls | grep -e "^org.glassfish.web.javax.servlet.jsp_"`
rm $f
ln -s %{_javadir}/glassfish-jsp.jar $f
f=`ls | grep -e "^org.sat4j.core_"`
rm $f
ln -s %{_javadir}/org.sat4j.core.jar $f
f=`ls | grep -e "^org.sat4j.pb_"`
rm $f
ln -s %{_javadir}/org.sat4j.pb.jar $f
f=`ls | grep -e "^org.w3c.css.sac_"`
rm $f
ln -s %{_javadir}/sac.jar $f
f=`ls | grep -e "^org.w3c.dom.svg_"`
rm $f
ln -s %{_javadir}/xml-commons-apis-ext.jar $f
%_symlink com.ibm.icu_ icu4j-eclipse/plugins/com.ibm.icu_*.jar
%_symlink com.jcraft.jsch_ jsch.jar
%_symlink javax.el_ tomcat-el-api.jar
%_symlink javax.inject_ atinject.jar
%_symlink javax.servlet_ tomcat-servlet-api.jar
%_symlink javax.servlet.jsp_ tomcat-jsp-api.jar
%_symlink javax.xml_ xml-commons-apis.jar
%_symlink org.apache.batik.css_ batik/batik-css.jar
%_symlink org.apache.batik.util_ batik/batik-util.jar
%_symlink org.apache.batik.util.gui_ batik/batik-gui-util.jar
%_symlink org.apache.commons.codec_ commons-codec.jar
%_symlink org.apache.commons.el_ commons-el.jar
%_symlink org.apache.commons.httpclient_ commons-httpclient.jar
%_symlink org.apache.commons.logging_ commons-logging.jar
%_symlink org.apache.el_ tomcat/jasper-el.jar
%_symlink org.apache.felix.gogo.command_ felix/org.apache.felix.gogo.command.jar
%_symlink org.apache.felix.gogo.runtime_ felix/org.apache.felix.gogo.runtime.jar
%_symlink org.apache.felix.gogo.shell_ felix/org.apache.felix.gogo.shell.jar
%_symlink org.apache.geronimo.specs.geronimo-annotation_1.1_spec_ geronimo-annotation.jar
%_symlink org.apache.jasper_ tomcat/jasper.jar
%_symlink org.apache.juli_ tomcat/tomcat-juli.jar
%_symlink org.apache.lucene.core_ lucene.jar
%_symlink org.apache.lucene.analysis_ lucene-contrib/lucene-analyzers.jar
%_symlink org.apache.tomcat_ tomcat/tomcat-api.jar
%_symlink org.eclipse.ecf_ ecf/eclipse/plugins/org.eclipse.ecf_*.jar
%_symlink org.eclipse.ecf.identity_ ecf/eclipse/plugins/org.eclipse.ecf.identity_*.jar
%_symlink org.eclipse.ecf.filetransfer_ ecf/eclipse/plugins/org.eclipse.ecf.filetransfer_*.jar
%_symlink org.eclipse.ecf.provider.filetransfer.httpclient_ ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.httpclient_*.jar
%_symlink org.eclipse.ecf.provider.filetransfer.httpclient.ssl_ ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.httpclient.ssl_*.jar
%_symlink org.eclipse.ecf.provider.filetransfer.ssl_ ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer.ssl_*.jar
%_symlink org.eclipse.ecf.provider.filetransfer_ ecf/eclipse/plugins/org.eclipse.ecf.provider.filetransfer_*.jar
%_symlink org.eclipse.ecf.ssl_ ecf/eclipse/plugins/org.eclipse.ecf.ssl_*.jar
%_symlink org.eclipse.emf.common_ emf/eclipse/plugins/org.eclipse.emf.common_*.jar
%_symlink org.eclipse.emf.ecore.change_ emf/eclipse/plugins/org.eclipse.emf.ecore.change_*.jar
%_symlink org.eclipse.emf.ecore_ emf/eclipse/plugins/org.eclipse.emf.ecore_*.jar
%_symlink org.eclipse.emf.ecore.xmi_ emf/eclipse/plugins/org.eclipse.emf.ecore.xmi_*.jar
%_symlink org.eclipse.jetty.util_ jetty/jetty-util.jar
%_symlink org.eclipse.jetty.server_ jetty/jetty-server.jar
%_symlink org.eclipse.jetty.http_ jetty/jetty-http.jar
%_symlink org.eclipse.jetty.continuation_ jetty/jetty-continuation.jar
%_symlink org.eclipse.jetty.io_ jetty/jetty-io.jar
%_symlink org.eclipse.jetty.security_ jetty/jetty-security.jar
%_symlink org.eclipse.jetty.servlet_ jetty/jetty-servlet.jar
%_symlink org.glassfish.web.javax.servlet.jsp_ glassfish-jsp.jar
%_symlink org.sat4j.core_ org.sat4j.core.jar
%_symlink org.sat4j.pb_ org.sat4j.pb.jar
%_symlink org.w3c.css.sac_ sac.jar
%_symlink org.w3c.dom.svg_ xml-commons-apis-ext.jar
#also within ant
cd org.apache.ant_*
@ -1216,6 +1088,8 @@ rm -rf %{_bindir}/efj/
- Move additional, non-Eclipse sources back to eclipse-build.
- Make the patch for setting BREE smaller.
- Patch for the compatibility.registry updated.
- Introduce a macro for symlinking.
- Bug 851190 - eclipse CBI build does not Requires: icu4j-eclipse
* Wed Aug 22 2012 Krzysztof Daniel <kdaniel@redhat.com> 1:4.2.0-10
- Fix Eclipse not picking anything from dropins folder.

View File

@ -5,3 +5,12 @@
# noarch so we use this macro.
%_eclipse_bits %(rpm --eval %{__isa_bits} | sed 's/32//')
%_eclipse_base %{_prefix}/lib%{_eclipse_bits}/eclipse
#symlinking platform repos
%_symlink \
_pattern="%1" \
_target="%2" \
_f=`ls | grep -e "^${_pattern}"`; \
rm -rf {_f} ; \
ln -s %{_javadir}/${_target} ${_f}