diff --git a/.gitignore b/.gitignore index e69de29..3fa64f1 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/sonatype-sisu-sisu-1.4.2-0-gae9a407.tar.gz diff --git a/0001-Fix-shading.patch b/0001-Fix-shading.patch new file mode 100644 index 0000000..218bd17 --- /dev/null +++ b/0001-Fix-shading.patch @@ -0,0 +1,75 @@ +From f468c161563690c2b3a979f40bb53df329d5be47 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Fri, 8 Oct 2010 17:09:03 +0200 +Subject: [PATCH] Fix shading + +--- + sisu-inject/guice-bean/sisu-inject-bean/pom.xml | 13 +++---------- + .../guice-plexus/sisu-inject-plexus/pom.xml | 8 -------- + 2 files changed, 3 insertions(+), 18 deletions(-) + +diff --git a/sisu-inject/guice-bean/sisu-inject-bean/pom.xml b/sisu-inject/guice-bean/sisu-inject-bean/pom.xml +index aa7fc26..2256ff1 100644 +--- a/sisu-inject/guice-bean/sisu-inject-bean/pom.xml ++++ b/sisu-inject/guice-bean/sisu-inject-bean/pom.xml +@@ -59,10 +59,9 @@ + + + org.sonatype.inject;-noimport:=true;-split-package:=merge-first;version=${project.version}, +- javax.*|org.aopalliance.*;version=1 + + +- org.sonatype.guice.*,org.objectweb.asm ++ org.sonatype.guice.* + + + +@@ -81,18 +80,12 @@ + ${project.groupId}:${project.artifactId} + + +- +- +- org.objectweb +- org.sonatype.guice +- +- + + + *:* + +- org/objectweb/asm/*Adapter* +- org/objectweb/asm/*Writer* ++ org.objectweb.asm:asm ++ javax.inject:javax.inject + + + +diff --git a/sisu-inject/guice-plexus/sisu-inject-plexus/pom.xml b/sisu-inject/guice-plexus/sisu-inject-plexus/pom.xml +index 506bd3c..2045e04 100644 +--- a/sisu-inject/guice-plexus/sisu-inject-plexus/pom.xml ++++ b/sisu-inject/guice-plexus/sisu-inject-plexus/pom.xml +@@ -82,20 +82,12 @@ + ${project.groupId}:${project.artifactId} + + +- +- +- org.objectweb +- org.sonatype.guice +- +- + + + *:* + + META-INF/** +- org/codehaus/plexus/** + org/sonatype/guice/plexus/** +- org/objectweb/asm/*Writer* + + + +-- +1.7.2.3 + diff --git a/sisu-depmap.xml b/sisu-depmap.xml new file mode 100644 index 0000000..23bb44a --- /dev/null +++ b/sisu-depmap.xml @@ -0,0 +1,29 @@ + + + + aopalliance + aopalliance + + + + + org.osgi + org.osgi.compendium + + + JPP/felix + org.osgi.compendium + + + + + org.osgi + org.osgi.core + + + JPP/felix + org.osgi.core + + + + diff --git a/sisu.spec b/sisu.spec new file mode 100644 index 0000000..255fbe6 --- /dev/null +++ b/sisu.spec @@ -0,0 +1,149 @@ +%global githash gae9a407 + +Name: sisu +Version: 1.4.2 +Release: 1%{?dist} +Summary: Sonatype dependency injection framework + + +Group: Development/Tools +License: ASL 2.0 +URL: http://github.com/sonatype/sisu + +# it seems github has redirects plus it generates tarball on the fly +# to get tarball go to http://github.com/sonatype/sisu/tree/sisu-1.4.2 +# click "downloads" in upper right corner +# click "download .tar.gz" +Source0: sonatype-sisu-sisu-%{version}-0-%{githash}.tar.gz +Source1: %{name}-depmap.xml +Patch0: 0001-Fix-shading.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildArch: noarch + +BuildRequires: google-guice +BuildRequires: maven2 +BuildRequires: maven-install-plugin +BuildRequires: maven-enforcer-plugin +BuildRequires: maven-invoker-plugin +BuildRequires: maven-site-plugin +BuildRequires: maven-plugin-bundle +BuildRequires: maven-shade-plugin +BuildRequires: maven-dependency-plugin +BuildRequires: maven-clean-plugin +BuildRequires: maven-resources-plugin +BuildRequires: maven-surefire-plugin +BuildRequires: maven-javadoc-plugin +BuildRequires: maven-jar-plugin +BuildRequires: maven-compiler-plugin +BuildRequires: atinject + +Requires: google-guice +Requires: java >= 1:1.6.0 +Requires(post): jpackage-utils +Requires(postun): jpackage-utils + +%description +Java dependency injection framework with backward support for plexus and bean +style dependency injection. + +%package javadoc +Summary: API documentation for %{name} +Group: Documentation +Requires: jpackage-utils + +%description javadoc +%{summary}. + +%prep +%setup -q -n sonatype-sisu-18a9c2c +%patch0 -p1 + +%build +export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository +mkdir -p $MAVEN_REPO_LOCAL +mvn-jpp \ + -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ + -Dmaven2.jpp.depmap.file=%{SOURCE1} \ + -Dmaven.test.skip=true \ + install javadoc:aggregate + +%install +rm -rf $RPM_BUILD_ROOT +install -d -m 0755 $RPM_BUILD_ROOT%{_javadir}/%{name} +install -d -m 0755 $RPM_BUILD_ROOT%{_mavenpomdir} + +for dir1 in sisu-inject/guice-*;do + pushd $dir1 + for module in guice-*;do + install -pm 644 $module/target/$module-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$module-%{version}.jar + install -pm 644 $module/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-$module.pom + %add_to_maven_depmap org.sonatype.sisu.inject $module %{version} JPP/%{name} $module + done + popd + # $dir is sisu-inject/XX so we strip the first part + submod=`echo $dir1 | sed -s 's:.*/::'` + install -pm 644 sisu-inject/$submod/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-$submod.pom + %add_to_maven_depmap org.sonatype.sisu.inject $submod %{version} JPP/%{name} $submod +done + +pushd sisu-inject/guice-bean +module="sisu-inject-bean" +install -pm 644 $module/target/$module-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$module-%{version}.jar +install -pm 644 $module/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-$module.pom +%add_to_maven_depmap org.sonatype.sisu $module %{version} JPP/%{name} $module +popd + +pushd sisu-inject/guice-plexus +module="sisu-inject-plexus" +install -pm 644 $module/target/$module-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$module-%{version}.jar +install -pm 644 $module/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-$module.pom +%add_to_maven_depmap org.sonatype.sisu $module %{version} JPP/%{name} $module +popd + +# symlinks +(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) + + +# main poms +install -pm 644 sisu-inject/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-inject.pom +%add_to_maven_depmap org.sonatype.sisu sisu-inject %{version} JPP/%{name} inject + +install -pm 644 pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-parent.pom +%add_to_maven_depmap org.sonatype.sisu sisu-parent %{version} JPP/%{name} parent + +# javadoc +install -d -m 0755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} +cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/ +ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} + + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%update_maven_depmap + +%postun +%update_maven_depmap + + +%files +%defattr(-,root,root,-) +%{_javadir}/%{name} +%{_mavenpomdir}/* +%{_mavendepmapfragdir}/* + + +%files javadoc +%defattr(-,root,root,-) +%doc %{_javadocdir}/%{name}* + + + +%changelog +* Thu Oct 14 2010 Stanislav Ochotnicky - 1.4.2-1 +- Initial version of the package + + diff --git a/sources b/sources index e69de29..33c0195 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +431e20073e5444e9f4d9a34cc40a97ad sonatype-sisu-sisu-1.4.2-0-gae9a407.tar.gz