Description: Makes o.e.osgi.services build from source.
Author: Niels Thykier <niels@thykier.net>
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=304710
Applied-Upstream: no

--- a/build.xml
+++ b/build.xml
@@ -258,6 +258,7 @@
 		<patch patchfile="${basedir}/patches/addEcfQualifiers.patch" dir="${buildDirectory}"  strip="0" />
 		<patch patchfile="${basedir}/patches/droppluginversions.patch" dir="${buildDirectory}"  strip="0" />
 		<patch patchfile="${basedir}/patches/osgi-util.patch" dir="${buildDirectory}" strip="1" />
+		<patch patchfile="${basedir}/patches/osgi-services-build.patch" dir="${buildDirectory}" strip="1" />
 		<replace file="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build/build.properties" token="/usr/share/eclipse" value="/usr/${libDir}/eclipse" />
 		<chmod dir="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build" includes="*.sh" perm="a+x" />
 		<!-- end eclipse-build-only patches -->
--- a/pdebuild.xml
+++ b/pdebuild.xml
@@ -30,6 +30,8 @@
 		<file name="org.eclipse.equinox.preferences" />
 		<file name="org.eclipse.core.runtime.compatibility.auth" />
 		<file name="org.eclipse.core.contenttype" />
+		<file name="org.eclipse.equinox.transforms.hook" />
+		<file name="org.eclipse.osgi.services" />
 		<file name="org.eclipse.equinox.app" />
 		<file name="org.eclipse.core.runtime" />
 		<file name="org.eclipse.core.variables" />
@@ -64,7 +66,6 @@
 		<file name="org.eclipse.equinox.p2.updatesite" />
 		<file name="org.eclipse.pde.build" />
 		<file name="org.eclipse.equinox.launcher" />
-		<file name="org.eclipse.osgi.services" />
 		<file name="org.eclipse.equinox.p2.console" />
 		<file name="org.eclipse.equinox.p2.director.app" />
 		<file name="org.eclipse.update.core" />
--- /dev/null
+++ b/patches/osgi-services-build.patch
@@ -0,0 +1,58 @@
+diff --git a/eclipse/plugins/org.eclipse.osgi.services/build.properties b/eclipse/plugins/org.eclipse.osgi.services/build.properties
+index 7962dc5..ca55afb 100644
+--- a/plugins/org.eclipse.osgi.services/build.properties
++++ b/plugins/org.eclipse.osgi.services/build.properties
+@@ -11,11 +11,11 @@
+ bin.includes = plugin.properties,\
+                about.html,\
+                META-INF/,\
+-               org/,\
++               bin/,\
++               about_files/,\
++               .
++src.includes = about.html,\
+                about_files/
+-src.includes = src.zip,\
+-               about.html,\
+-               about_files/
+-source.. = .
++source.. = src/
+ output.. = .
+ customBuildCallbacks=customBuildCallbacks.xml
+diff --git a/eclipse/plugins/org.eclipse.osgi.services/customBuildCallbacks.xml b/eclipse/plugins/org.eclipse.osgi.services/customBuildCallbacks.xml
+index 9187112..dbd6075 100644
+--- a/plugins/org.eclipse.osgi.services/customBuildCallbacks.xml
++++ b/plugins/org.eclipse.osgi.services/customBuildCallbacks.xml
+@@ -104,6 +104,7 @@
+ 	<!--   target.folder - destination folder                                  -->
+ 	<!-- ===================================================================== -->
+ 	<target name="post.gather.bin.parts">
++	  <delete dir="${target.folder}/javax" />
+ 	</target>
+ 
+ 	<!-- ===================================================================== -->
+@@ -120,8 +121,7 @@
+ 	<!--   destination.temp.folder - destination folder                        -->
+ 	<!-- ===================================================================== -->
+ 	<target name="post.gather.sources">
+-		<unzip src="${target.folder}/src.zip" dest="${target.folder}" overwrite="false"/>
+-		<delete file="${destination.temp.folder}/src.zip" />	
++	  <delete dir="${destination.temp.folder}/javax" />
+ 	</target>
+ 
+ 	<!-- ===================================================================== -->
+@@ -146,7 +146,6 @@
+ 	<!--   destination.temp.folder - destination folder                        -->
+ 	<!-- ===================================================================== -->
+ 	<target name="pre.clean">  
+-		<move  file="src.zip" tofile="services_src.zip"/>
+ 	</target>
+ 
+ 	<!-- ===================================================================== -->
+@@ -157,6 +156,5 @@
+ 	<!--   temp.folder - temporary folder                                      -->
+ 	<!-- ===================================================================== -->
+ 	<target name="post.clean">
+-		<move file="services_src.zip" tofile="src.zip"/>
+ 	</target>
+ </project>
