Initial commit

This commit is contained in:
Stanislav Ochotnicky 2010-10-18 09:51:00 +02:00
parent 0bec17a7c6
commit 2add2248a6
5 changed files with 255 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/sonatype-sisu-sisu-1.4.2-0-gae9a407.tar.gz

75
0001-Fix-shading.patch Normal file
View File

@ -0,0 +1,75 @@
From f468c161563690c2b3a979f40bb53df329d5be47 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
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 @@
</DynamicImport-Package>
<Export-Package>
org.sonatype.inject;-noimport:=true;-split-package:=merge-first;version=${project.version},
- javax.*|org.aopalliance.*;version=1
</Export-Package>
<Private-Package>
- org.sonatype.guice.*,org.objectweb.asm
+ org.sonatype.guice.*
</Private-Package>
</instructions>
</configuration>
@@ -81,18 +80,12 @@
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
- <relocations>
- <relocation>
- <pattern>org.objectweb</pattern>
- <shadedPattern>org.sonatype.guice</shadedPattern>
- </relocation>
- </relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
- <exclude>org/objectweb/asm/*Adapter*</exclude>
- <exclude>org/objectweb/asm/*Writer*</exclude>
+ <exclude>org.objectweb.asm:asm</exclude>
+ <exclude>javax.inject:javax.inject</exclude>
</excludes>
</filter>
</filters>
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 @@
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
- <relocations>
- <relocation>
- <pattern>org.objectweb</pattern>
- <shadedPattern>org.sonatype.guice</shadedPattern>
- </relocation>
- </relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<includes>
<include>META-INF/**</include>
- <include>org/codehaus/plexus/**</include>
<include>org/sonatype/guice/plexus/**</include>
- <include>org/objectweb/asm/*Writer*</include>
</includes>
</filter>
</filters>
--
1.7.2.3

29
sisu-depmap.xml Normal file
View File

@ -0,0 +1,29 @@
<dependencies>
<dependency>
<maven>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</maven>
</dependency>
<dependency>
<maven>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</maven>
<jpp>
<groupId>JPP/felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
</jpp>
</dependency>
<dependency>
<maven>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</maven>
<jpp>
<groupId>JPP/felix</groupId>
<artifactId>org.osgi.core</artifactId>
</jpp>
</dependency>
</dependencies>

149
sisu.spec Normal file
View File

@ -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 <sochotnicky@redhat.com> - 1.4.2-1
- Initial version of the package

View File

@ -0,0 +1 @@
431e20073e5444e9f4d9a34cc40a97ad sonatype-sisu-sisu-1.4.2-0-gae9a407.tar.gz