commit 6367ae5445cdebef154dc8355d97e3497097d44c9171e8d9dc18b9ad4a2972e7 Author: Adrian Schröter Date: Sat May 4 00:39:47 2024 +0200 Sync from SUSE:SLFO:Main sisu revision a7800150819e67b34dfab51425ce7a58 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/sisu-OSGi-import-guava.patch b/sisu-OSGi-import-guava.patch new file mode 100644 index 0000000..68cd3a2 --- /dev/null +++ b/sisu-OSGi-import-guava.patch @@ -0,0 +1,20 @@ +--- sisu-inject/org.eclipse.sisu.inject/META-INF/MANIFEST.MF~ 2014-04-21 16:32:25.000000000 +0200 ++++ sisu-inject/org.eclipse.sisu.inject/META-INF/MANIFEST.MF 2014-04-23 10:53:22.538142253 +0200 +@@ -16,6 +16,7 @@ + com.google.inject.matcher;version="1.3", + com.google.inject.name;version="1.3", + com.google.inject.spi;version="1.3", ++ com.google.common.base, + org.osgi.framework;version="1.5", + org.osgi.util.tracker;version="1.4", + org.slf4j;resolution:=optional, +--- sisu-inject/org.eclipse.sisu.inject/build.properties~ 2015-02-25 14:46:42.392037463 +0100 ++++ sisu-inject/org.eclipse.sisu.inject/build.properties 2015-02-25 14:44:56.626803789 +0100 +@@ -17,5 +17,5 @@ + . + + # build with JSR250 v1.2 and workaround indirect Guava dependency via Guice 4 +-extra.. = platform:/plugin/javax.annotation,platform:/plugin/com.google.guava +-additional.bundles = javax.annotation,com.google.guava ++extra.. = platform:/plugin/javax.annotation-api,platform:/plugin/com.google.guava ++additional.bundles = javax.annotation-api,com.google.guava diff --git a/sisu-build.tar.xz b/sisu-build.tar.xz new file mode 100644 index 0000000..3b4b3f4 --- /dev/null +++ b/sisu-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d895814653bcb26afdc47aa0c1dc0ca3e9c19a649b2811e800707d7a19a1fb87 +size 1992 diff --git a/sisu-ignored-tests.patch b/sisu-ignored-tests.patch new file mode 100644 index 0000000..5af8dc8 --- /dev/null +++ b/sisu-ignored-tests.patch @@ -0,0 +1,205 @@ +--- sisu-inject/org.eclipse.sisu.inject.tests/src/org/eclipse/sisu/inject/LocatedBeansTest.java~ 2014-09-12 08:32:32.899725268 +0200 ++++ sisu-inject/org.eclipse.sisu.inject.tests/src/org/eclipse/sisu/inject/LocatedBeansTest.java 2014-09-12 08:37:45.656099710 +0200 +@@ -128,30 +128,6 @@ + assertSame( a, itr2.next().getValue() ); + } + +- public void testUnrestrictedSearch() +- { +- final LocatedBeans beans = locate( Key.get( Bean.class ) ); +- final Iterator> itr = beans.iterator(); +- +- assertTrue( itr.hasNext() ); +- assertEquals( QualifyingStrategy.DEFAULT_QUALIFIER, itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( QualifyingStrategy.BLANK_QUALIFIER, itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( Names.named( "Named1" ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( Names.named( "Named2" ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( QualifyingStrategy.BLANK_QUALIFIER, itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( MarkedBeanImpl1.class.getAnnotation( Marked.class ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( Names.named( "Marked2" ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( Names.named( "Marked3" ), itr.next().getKey() ); +- assertFalse( itr.hasNext() ); +- } +- + public void testNamedSearch() + { + final LocatedBeans beans = locate( Key.get( Bean.class, Named.class ) ); +@@ -181,20 +156,6 @@ + assertFalse( itr.hasNext() ); + } + +- public void testMarkedSearch() +- { +- final LocatedBeans beans = locate( Key.get( Bean.class, Marked.class ) ); +- final Iterator> itr = beans.iterator(); +- +- assertTrue( itr.hasNext() ); +- assertEquals( MarkedBeanImpl1.class.getAnnotation( Marked.class ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( MarkedBeanImpl2.class.getAnnotation( Marked.class ), itr.next().getKey() ); +- assertTrue( itr.hasNext() ); +- assertEquals( MarkedBeanProvider.class.getAnnotation( Marked.class ), itr.next().getKey() ); +- assertFalse( itr.hasNext() ); +- } +- + public void testMarkedWithAttributesSearch() + { + final LocatedBeans beans = +--- sisu-plexus/org.eclipse.sisu.plexus.tests/src/org/eclipse/sisu/plexus/PlexusXmlScannerTest.java~ 2014-08-24 01:48:47.000000000 +0200 ++++ sisu-plexus/org.eclipse.sisu.plexus.tests/src/org/eclipse/sisu/plexus/PlexusXmlScannerTest.java 2015-02-04 07:06:49.696531924 +0100 +@@ -159,83 +159,6 @@ + new PlexusXmlScanner( null, plexusXml, null ).scan( space, true ); + } + +- @SuppressWarnings( "deprecation" ) +- public void testComponents() +- { +- final ClassSpace space = new URLClassSpace( PlexusXmlScannerTest.class.getClassLoader() ); +- +- final Map metadata = new HashMap(); +- final PlexusXmlScanner scanner = new PlexusXmlScanner( null, null, metadata ); +- +- final Map> componentMap = scanner.scan( space, true ); +- +- assertEquals( 6, componentMap.size() ); +- +- final Component component1 = +- new ComponentImpl( DefaultBean.class, Hints.DEFAULT_HINT, Strategies.PER_LOOKUP, "" ); +- assertEquals( DefaultBean.class, componentMap.get( component1 ).load() ); +- +- final Component component2 = new ComponentImpl( Bean.class, "debug", Strategies.SINGLETON, "For debugging" ); +- assertEquals( DebugBean.class, componentMap.get( component2 ).load() ); +- +- final Component component3 = new ComponentImpl( Bean.class, Hints.DEFAULT_HINT, Strategies.SINGLETON, "" ); +- assertEquals( AnotherBean.class, componentMap.get( component3 ).load() ); +- +- final Component component4 = new ComponentImpl( Bean.class, "clone", Strategies.SINGLETON, "" ); +- assertEquals( DefaultBean.class, componentMap.get( component4 ).load().getSuperclass() ); +- final Class proxy = CustomTestClassLoader.proxy( componentMap.get( component4 ).load() ); +- +- try +- { +- assertNotNull( proxy.getMethod( "TestMe" ) ); +- } +- catch ( final NoSuchMethodException e ) +- { +- fail( "Proxied class is missing 'TestMe' method" ); +- } +- +- final PlexusBeanMetadata metadata1 = metadata.get( DefaultBean.class.getName() ); +- +- assertFalse( metadata1.isEmpty() ); +- +- assertEquals( new ConfigurationImpl( "someFieldName", "PRIMARY" ), +- metadata1.getConfiguration( new NamedProperty( "someFieldName" ) ) ); +- +- assertEquals( new ConfigurationImpl( "simple", "value" ), +- metadata1.getConfiguration( new NamedProperty( "simple" ) ) ); +- +- assertEquals( new ConfigurationImpl( "value", "" ), +- metadata1.getConfiguration( new NamedProperty( "value" ) ) ); +- +- assertEquals( new ConfigurationImpl( "emptyValue1", "" ), +- metadata1.getConfiguration( new NamedProperty( "emptyValue1" ) ) ); +- +- assertEquals( new ConfigurationImpl( "emptyValue2", "" ), +- metadata1.getConfiguration( new NamedProperty( "emptyValue2" ) ) ); +- +- assertFalse( metadata1.isEmpty() ); +- +- assertEquals( new RequirementImpl( Bean.class, true, "debug" ), +- metadata1.getRequirement( new NamedProperty( "bean", TypeLiteral.get( Bean.class ) ) ) ); +- +- assertFalse( metadata1.isEmpty() ); +- +- metadata1.getConfiguration( new NamedProperty( "foo" ) ); +- +- assertEquals( new RequirementImpl( Bean.class, false, Hints.DEFAULT_HINT, "debug" ), +- metadata1.getRequirement( new NamedProperty( "beanMap" ) ) ); +- +- assertFalse( metadata1.isEmpty() ); +- +- assertEquals( new RequirementImpl( Bean.class, false ), +- metadata1.getRequirement( new NamedProperty( "beanField" ) ) ); +- +- assertTrue( metadata1.isEmpty() ); +- +- assertNotNull( metadata.get( AnotherBean.class.getName() ) ); +- assertNull( metadata.get( DebugBean.class.getName() ) ); +- } +- + static class FixedClassSpace + implements ClassSpace + { +@@ -392,64 +315,4 @@ + } + } + +- static final class CustomTestClassLoader +- extends ClassLoader +- { +- private static final String PROXY_MARKER = "$proxy"; +- +- CustomTestClassLoader( final ClassLoader parent ) +- { +- super( parent ); +- } +- +- static Class proxy( final Class clazz ) +- { +- try +- { +- return new CustomTestClassLoader( clazz.getClassLoader() ).loadClass( clazz.getName() + PROXY_MARKER ); +- } +- catch ( final ClassNotFoundException e ) +- { +- throw new TypeNotPresentException( clazz.getName(), e ); +- } +- } +- +- @Override +- protected synchronized Class loadClass( final String name, final boolean resolve ) +- throws ClassNotFoundException +- { +- return super.loadClass( name, resolve ); +- } +- +- @Override +- protected Class findClass( final String name ) +- throws ClassNotFoundException +- { +- final String proxyName = name.replace( '.', '/' ); +- final String superName = proxyName.substring( 0, proxyName.length() - PROXY_MARKER.length() ); +- +- final ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); +- cw.visit( Opcodes.V1_5, Modifier.PUBLIC | Modifier.FINAL, proxyName, null, superName, null ); +- MethodVisitor mv = cw.visitMethod( Modifier.PUBLIC, "", "()V", null, null ); +- +- mv.visitCode(); +- mv.visitVarInsn( Opcodes.ALOAD, 0 ); +- mv.visitMethodInsn( Opcodes.INVOKESPECIAL, superName, "", "()V", false ); +- mv.visitInsn( Opcodes.RETURN ); +- mv.visitMaxs( 0, 0 ); +- mv.visitEnd(); +- +- mv = cw.visitMethod( Modifier.PUBLIC, "TestMe", "()V", null, null ); +- +- mv.visitCode(); +- mv.visitInsn( Opcodes.RETURN ); +- mv.visitMaxs( 0, 0 ); +- mv.visitEnd(); +- cw.visitEnd(); +- +- final byte[] buf = cw.toByteArray(); +- +- return defineClass( name, buf, 0, buf.length ); +- } +- } + } diff --git a/sisu-inject-0.3.5.tar.gz b/sisu-inject-0.3.5.tar.gz new file mode 100644 index 0000000..d1057c8 --- /dev/null +++ b/sisu-inject-0.3.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cb5b00685ea7167d2a262fdab0ca9c10cd3be4891514e26ec265521f15d6b87 +size 296324 diff --git a/sisu-inject.pom b/sisu-inject.pom new file mode 100644 index 0000000..db3172d --- /dev/null +++ b/sisu-inject.pom @@ -0,0 +1,72 @@ + + 4.0.0 + org.eclipse.sisu + org.eclipse.sisu.inject + @VERSION@ + + + com.google.inject + guice + no_aop + 4.0 + provided + + + javax.inject + javax.inject + 1 + provided + + + javax.enterprise + cdi-api + 1.1 + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + com.google.inject.extensions + guice-servlet + 4.0 + provided + + + javax.servlet + servlet-api + 2.5 + provided + + + org.slf4j + slf4j-api + 1.7.13 + provided + + + org.osgi + osgi.core + 6.0.0 + provided + + + junit + junit + 4.12 + provided + + + org.testng + testng + 6.9.10 + provided + + + + org.eclipse.sisu.inject/src + + diff --git a/sisu-no-dependency-on-glassfish-servlet-api.patch b/sisu-no-dependency-on-glassfish-servlet-api.patch new file mode 100644 index 0000000..c462f81 --- /dev/null +++ b/sisu-no-dependency-on-glassfish-servlet-api.patch @@ -0,0 +1,84 @@ +--- sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java ++++ sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java +@@ -38,17 +38,6 @@ final class Implementations + + static + { +- boolean hasGuiceServlet; +- try +- { +- hasGuiceServlet = BindingTargetVisitor.class.isInstance( ServletFinder.THIS ); +- } +- catch ( final LinkageError e ) +- { +- hasGuiceServlet = false; +- } +- HAS_GUICE_SERVLET = hasGuiceServlet; +- + boolean hasJsr250Priority; + try + { +@@ -65,8 +54,6 @@ final class Implementations + // Constants + // ---------------------------------------------------------------------- + +- private static final boolean HAS_GUICE_SERVLET; +- + private static final boolean HAS_JSR250_PRIORITY; + + // ---------------------------------------------------------------------- +@@ -106,7 +93,7 @@ final class Implementations + + // peek behind servlet/filter extension bindings when checking priority, so we can order them by rank + final Class implementation = +- binding.acceptTargetVisitor( HAS_GUICE_SERVLET && isPriority ? ServletFinder.THIS : ClassFinder.THIS ); ++ binding.acceptTargetVisitor( ClassFinder.THIS ); + + T annotation = null; + if ( null != implementation ) +@@ -215,45 +202,4 @@ final class Implementations + return binding.getPrivateElements().getInjector().getBinding( binding.getKey() ).acceptTargetVisitor( this ); + } + } +- +- /** +- * {@link ClassFinder} that can also peek behind servlet/filter bindings. +- */ +- static final class ServletFinder +- extends ClassFinder +- implements com.google.inject.servlet.ServletModuleTargetVisitor> +- { +- // ---------------------------------------------------------------------- +- // Constants +- // ---------------------------------------------------------------------- +- +- @SuppressWarnings( "hiding" ) +- static final BindingTargetVisitor> THIS = new ServletFinder(); +- +- // ---------------------------------------------------------------------- +- // Public methods +- // ---------------------------------------------------------------------- +- +- public Class visit( final com.google.inject.servlet.InstanceFilterBinding binding ) +- { +- return binding.getFilterInstance().getClass(); +- } +- +- public Class visit( final com.google.inject.servlet.InstanceServletBinding binding ) +- { +- return binding.getServletInstance().getClass(); +- } +- +- public Class visit( final com.google.inject.servlet.LinkedFilterBinding binding ) +- { +- // this assumes only one level of indirection: api-->impl +- return binding.getLinkedKey().getTypeLiteral().getRawType(); +- } +- +- public Class visit( final com.google.inject.servlet.LinkedServletBinding binding ) +- { +- // this assumes only one level of indirection: api-->impl +- return binding.getLinkedKey().getTypeLiteral().getRawType(); +- } +- } + } diff --git a/sisu-osgi-api.patch b/sisu-osgi-api.patch new file mode 100644 index 0000000..019b700 --- /dev/null +++ b/sisu-osgi-api.patch @@ -0,0 +1,11 @@ +--- sisu-plexus/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusBundlePlan.java~ 2015-09-13 20:15:37.000000000 +0200 ++++ sisu-plexus/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusBundlePlan.java 2017-01-29 19:56:51.608151337 +0100 +@@ -80,7 +80,7 @@ + + protected static boolean hasPlexusAnnotations( final Bundle bundle ) + { +- final String imports = bundle.getHeaders().get( Constants.IMPORT_PACKAGE ); ++ final String imports = bundle.getHeaders().get( Constants.IMPORT_PACKAGE ).toString(); + return null != imports && imports.contains( "org.codehaus.plexus.component.annotations" ); + } + diff --git a/sisu-plexus-0.3.5.tar.gz b/sisu-plexus-0.3.5.tar.gz new file mode 100644 index 0000000..282e91f --- /dev/null +++ b/sisu-plexus-0.3.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0bdb6e1475f6557a3f99c03dc2b19581d4615ec3384ae879c3161d39e66fa2b +size 389763 diff --git a/sisu-plexus.pom b/sisu-plexus.pom new file mode 100644 index 0000000..b138e52 --- /dev/null +++ b/sisu-plexus.pom @@ -0,0 +1,67 @@ + + 4.0.0 + org.eclipse.sisu + org.eclipse.sisu.plexus + @VERSION@ + + + ${project.groupId} + org.eclipse.sisu.inject + ${project.version} + + + org.codehaus.plexus + plexus-classworlds + 2.5.2 + + + org.codehaus.plexus + plexus-component-annotations + 1.6 + + + org.codehaus.plexus + plexus-utils + 3.0.22 + + + com.google.inject + guice + no_aop + 4.0 + provided + + + org.slf4j + slf4j-api + 1.7.13 + provided + + + org.osgi + osgi.core + 6.0.0 + provided + + + junit + junit + 4.12 + provided + + + + org.eclipse.sisu.plexus/src + + + META-INF/plexus + false + ${basedir}/org.eclipse.sisu.plexus/META-INF/plexus + + components.xml + + + + + diff --git a/sisu-reproducible-index.patch b/sisu-reproducible-index.patch new file mode 100644 index 0000000..4d391a4 --- /dev/null +++ b/sisu-reproducible-index.patch @@ -0,0 +1,11 @@ +--- sisu-0.3.5/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/AbstractSisuIndex.java 2023-09-05 15:00:59.314655718 +0200 ++++ sisu-0.3.5/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/AbstractSisuIndex.java 2023-09-05 15:04:15.889547023 +0200 +@@ -158,7 +158,7 @@ + final BufferedWriter writer = new BufferedWriter( getWriter( INDEX_FOLDER + name ) ); + try + { +- for ( final String line : table ) ++ for ( final String line : new java.util.TreeSet( table ) ) + { + writer.write( line ); + writer.newLine(); diff --git a/sisu.changes b/sisu.changes new file mode 100644 index 0000000..e97adc3 --- /dev/null +++ b/sisu.changes @@ -0,0 +1,46 @@ +------------------------------------------------------------------- +Tue Sep 5 13:09:17 UTC 2023 - Fridrich Strba + +- Added patch: + * sisu-reproducible-index.patch + + Sort the classes by name in META-INF/sisu/javax.inject.Named + to make the output reproducible + +------------------------------------------------------------------- +Wed Apr 27 13:46:14 UTC 2022 - Fridrich Strba + +- Change to generate maven meta-data using the %%add_maven_depmap + * so that it can be built before the xmvn-tools + +------------------------------------------------------------------- +Sun Mar 20 19:45:31 UTC 2022 - Fridrich Strba + +- Build with java source and target levels 8 + +------------------------------------------------------------------- +Tue Jan 18 07:16:24 UTC 2022 - Fridrich Strba + +- Update to upstream version 0.3.5 +- Changes of 0.3.5 + * beo#539791 - Update cdi-api dependency to 1.2 + * beo#575952 - Support turning off URLConnection caching for + container related resources +- Changes of 0.3.4 + * beo#552642 - Support reproducible builds by sorting generated + javax.inject.Named index + * beo#546874 - Relax bytecode check in scanner so it can scan up + to and including Java14 +- Added patch: + * sisu-no-dependency-on-glassfish-servlet-api.patch + + remove dependency on glassfish-servlet-api + +------------------------------------------------------------------- +Mon Apr 1 23:11:49 UTC 2019 - Jan Engelhardt + +- Use modern tar options. + +------------------------------------------------------------------- +Tue Mar 19 08:49:32 UTC 2019 - Fridrich Strba + +- Initial packaging of sisu-inject and sisu-plexus 0.3.3 +- Generate and customize ant build files diff --git a/sisu.spec b/sisu.spec new file mode 100644 index 0000000..b655d3c --- /dev/null +++ b/sisu.spec @@ -0,0 +1,158 @@ +# +# spec file for package sisu +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global reltype release +Name: sisu +Version: 0.3.5 +Release: 0 +Summary: Eclipse dependency injection framework +# sisu is EPL-1.0, bundled asm is BSD +License: BSD-3-Clause AND EPL-1.0 +Group: Development/Libraries/Java +URL: https://www.eclipse.org/sisu/ +Source0: https://github.com/eclipse/sisu.inject/archive/refs/tags/releases/%{version}.tar.gz#/sisu-inject-%{version}.tar.gz +Source1: https://github.com/eclipse/sisu.plexus/archive/refs/tags/releases/%{version}.tar.gz#/sisu-plexus-%{version}.tar.gz +Source2: %{name}-build.tar.xz +Source100: %{name}-inject.pom +Source101: %{name}-plexus.pom +Patch0: %{name}-OSGi-import-guava.patch +Patch1: %{name}-no-dependency-on-glassfish-servlet-api.patch +Patch2: %{name}-ignored-tests.patch +Patch3: %{name}-osgi-api.patch +Patch4: %{name}-reproducible-index.patch +BuildRequires: ant +BuildRequires: atinject +BuildRequires: cdi-api +BuildRequires: fdupes +BuildRequires: glassfish-annotation-api +BuildRequires: google-guice +BuildRequires: guice-servlet +BuildRequires: javapackages-local +BuildRequires: junit +BuildRequires: osgi-core +BuildRequires: plexus-classworlds +BuildRequires: plexus-containers-component-annotations +BuildRequires: plexus-utils +BuildRequires: slf4j +BuildRequires: testng +BuildRequires: unzip +BuildRequires: xz +Provides: bundled(objectweb-asm) +BuildArch: noarch + +%description +Java dependency injection framework with backward support for plexus and bean +style dependency injection. + +%package inject +Summary: Sisu inject +Group: Development/Libraries/Java +Requires: mvn(javax.enterprise:cdi-api) + +%description inject +This package contains %{summary}. + +%package plexus +Summary: Sisu Plexus +Group: Development/Libraries/Java +Requires: mvn(org.codehaus.plexus:plexus-classworlds) +Requires: mvn(org.codehaus.plexus:plexus-component-annotations) +Requires: mvn(org.codehaus.plexus:plexus-utils) +Requires: mvn(org.eclipse.sisu:org.eclipse.sisu.inject) = %{version} + +%description plexus +This package contains %{summary}. + +%package javadoc +Summary: API documentation for Sisu +Group: Documentation/HTML + +%description javadoc +This package contains %{summary}. + +%prep +%setup -q -c -T +tar xf %{SOURCE0} && mv sisu.inject-releases-%{version} sisu-inject +tar xf %{SOURCE1} && mv sisu.plexus-releases-%{version} sisu-plexus +tar xf %{SOURCE2} + +cp %{SOURCE100} sisu-inject/pom.xml +cp %{SOURCE101} sisu-plexus/pom.xml + +%patch0 +%patch1 +%patch2 +%patch3 +%patch4 -p1 + +%pom_remove_dep :servlet-api sisu-inject + +for i in inject plexus; do + %pom_xpath_set -r /pom:project/pom:version %{version} %{name}-${i} + %pom_remove_dep :::provided: %{name}-${i} + %pom_xpath_remove pom:project/pom:build %{name}-${i} +done +%pom_change_dep :org.eclipse.sisu.inject org.eclipse.sisu:org.eclipse.sisu.inject:%{version} %{name}-plexus + +%build +mkdir -p lib +build-jar-repository -s lib \ + glassfish-annotation-api \ + google-guice-no_aop \ + guice/guice-servlet \ + javax.enterprise.inject/cdi-api \ + javax.inject/atinject \ + junit \ + osgi-core/osgi.core \ + plexus/utils \ + plexus/classworlds \ + plexus-containers/plexus-component-annotations \ + slf4j/api \ + testng +%{ant} package javadoc + +%install +# jar +install -dm 0755 %{buildroot}%{_javadir} +install -pm 0644 %{name}-inject/target/org.eclipse.sisu.inject-%{version}.jar %{buildroot}%{_javadir}/org.eclipse.sisu.inject.jar +install -pm 0644 %{name}-plexus/target/org.eclipse.sisu.plexus-%{version}.jar %{buildroot}%{_javadir}/org.eclipse.sisu.plexus.jar + +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir} +install -pm 0644 %{name}-inject/pom.xml %{buildroot}%{_mavenpomdir}/org.eclipse.sisu.inject.pom +%add_maven_depmap org.eclipse.sisu.inject.pom org.eclipse.sisu.inject.jar -f inject +install -pm 0644 %{name}-plexus/pom.xml %{buildroot}%{_mavenpomdir}/org.eclipse.sisu.plexus.pom +%add_maven_depmap org.eclipse.sisu.plexus.pom org.eclipse.sisu.plexus.jar -f plexus -a org.sonatype.sisu:sisu-inject-plexus + +# javadoc +for i in inject plexus; do + install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/%{name}-${i} + cp -pr %{name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/%{name}-${i}/ +done +%fdupes -s %{buildroot}%{_javadocdir} + +%files inject -f .mfiles-inject +%license sisu-inject/LICENSE.txt + +%files plexus -f .mfiles-plexus + +%files javadoc +%license sisu-inject/LICENSE.txt +%{_javadocdir}/%{name} + +%changelog