packages apache-felix-bundlerepository.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven                       0
Name:          apache-felix-bundlerepository
Version:       1.6.0
Release:       3mamba
Summary:       Apache Felix Bundle Repository
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://felix.apache.org/
Source0:       http://www.apache.org/dist/felix/org.apache.felix.bundlerepository-%{version}-project.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       apache-felix-bundlerepository-1.6.0-ant-build.xml
Source3:       apache-felix-bundlerepository-1.6.0-maven-build.properties
Source4:       apache-felix-bundlerepository-1.6.0-maven-build.xml
Source5:       apache-felix-bundlerepository-1.6.0-maven-build.bnd
Source6:       apache-felix-bundlerepository-1.6.0-bnd-build.xml
License:       Apache Software License 2.0
BuildRequires: apache-ant
BuildRequires: apache-felix-javax-servlet
BuildRequires: apache-felix-osgi-compendium
BuildRequires: apache-felix-osgi-core
BuildRequires: apache-felix-osgi-foundation
BuildRequires: apache-felix-osgi-service-obr
BuildRequires: apache-felix-shell
BuildRequires: apache-felix-utils
%if %maven
BuildRequires: apache-maven2
BuildRequires: apache-maven2-ant-plugin
BuildRequires: apache-maven2-compiler-plugin
BuildRequires: apache-maven2-jar-plugin
BuildRequires: apache-maven2-javadoc-plugin
BuildRequires: felix-maven-bundle-plugin
BuildRequires: mojo-rat-maven-plugin
%endif
%if "%{stage1}" != "1"
BuildRequires: aqute-bnd == 0.0.370
%endif
#BuildRequires: aqute-bndlib
BuildRequires: java-easymock2
BuildRequires: java-junit48
BuildRequires: java-kxml2
BuildRequires: java-mockito17
BuildRequires: java-openjdk
BuildRequires: java-wstx4
BuildRequires: java-xmlpull
BuildRequires: jpackage-utils
Requires:      apache-felix-shell
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
Apache Felix Bundle repository service.

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
Apache Felix Bundle Repository.

This package contains javadoc for %{name}.

%prep

%setup -q -n org.apache.felix.bundlerepository-%{version}

chmod -R go=u-w *

for j in $(find . -name "*.jar"); do
	mv $j ${j}.no
done

%if %maven
	cp %{SOURCE1} settings.xml
	
	mkdir -p .m2/repository/JPP/maven2/default_poms
	
	sed -i -e "s|<localRepository>__INTERNAL_REPO_PLACEHOLDER__</localRepository>|<localRepository>file://`pwd`/external_repo</localRepository>|g" settings.xml
	sed -i -e "s|<url>__EXTERNAL_REPO_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml

%else
	cp %{SOURCE2} build.xml
	cp %{SOURCE3} maven-build.properties
	cp %{SOURCE4} maven-build.xml
	cp %{SOURCE5} maven-build.bnd
%endif

%build
export JAVA_HOME=/usr/lib/jvm/java
export MAVEN_REPO_LOCAL=$PWD/.m2/repository
export MAVEN_SETTINGS=$PWD/settings.xml

mkdir -p $MAVEN_REPO_LOCAL

%if %maven

	mkdir external_repo
	ln -s %{_javadir} external_repo/JPP
	
	mvn-jpp \
		-e \
		-s $MAVEN_SETTINGS \
		-Dmaven.test.failure.ignore=true \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dpackaging=bundle \
		ant:ant org.apache.felix:maven-bundle-plugin:ant install javadoc:javadoc

%else

	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath felix/org.apache.felix.utils felix/org.osgi.core xmlpull)
	CLASSPATH=$CLASSPATH:$(build-classpath felix/javax.servlet felix/org.osgi.compendium kxml2)
	CLASSPATH=$CLASSPATH:$(build-classpath felix/org.osgi.service.obr felix/org.apache.felix.shell)
	CLASSPATH=$CLASSPATH:$(build-classpath bea-stax-api wstx4/stax2-api wstx4/core-asl easymock2):target/classes
	CLASSPATH=$CLASSPATH:$(build-classpath junit48 mockito17-all):target/test-classes
	ant \
		-Duser.home=$PWD \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dmaven.settings.offline=true \
		-Dmaven.settings.interactiveMode=false \
		-Dbuild.sysclasspath=first \
		jar javadoc

# Private-Package
	mkdir -p temp/classes/{utils,kxml2}
	pushd temp/classes
		pushd utils
			jar xf $(build-classpath felix/org.apache.felix.utils)
		popd
		pushd kxml2
			jar xf $(build-classpath kxml2)
		popd
	popd
%if "%{stage1}" != "1"
	mkdir -p target/bnd
	BUNDLE_CLASSPATH="target/classes,temp/classes/utils,temp/classes/kxml2"
	bnd build -classpath $BUNDLE_CLASSPATH -output target/bnd/org.apache.felix.bundlerepository-%{version}.jar maven-build.bnd
	rm -rf temp
	pushd target/classes
	touch META-INF/maven/org.apache.felix/org.apache.felix.bundlerepository/pom.properties
	touch META-INF/maven/org.apache.felix/org.apache.felix.bundlerepository/pom.xml
	zip -u ../../target/bnd/org.apache.felix.bundlerepository-%{version}.jar \
		META-INF/maven/org.apache.felix/org.apache.felix.bundlerepository/*
%endif
%endif

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}/felix
mkdir -p %{buildroot}%{_datadir}/maven2/poms

%if %maven
	install -pm 644 target/org.apache.felix.bundlerepository-%{version}.jar \
		%{buildroot}%{_javadir}/felix/org.apache.felix.bundlerepository-%{version}.jar
%else
%if "%{stage1}" != "1"
	install -pm 644 target/bnd/org.apache.felix.bundlerepository-%{version}.jar \
		%{buildroot}%{_javadir}/felix/org.apache.felix.bundlerepository-%{version}.jar
%else
	install -pm 644 target/org.apache.felix.bundlerepository-%{version}.jar \
		%{buildroot}%{_javadir}/felix/org.apache.felix.bundlerepository-%{version}.jar
%endif
%endif

install -m 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.felix-felix-bundlerepository.pom
%add_to_maven_depmap org.apache.felix org.apache.felix.bundlerepository %{version} JPP/felix org.apache.felix.bundlerepository

(
	cd %{buildroot}%{_javadir}/felix
	for jar in *-%{version}*; do
		ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`
	done
)

mkdir -p %{buildroot}%{_javadocdir}/felix-bundlerepository-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/felix-bundlerepository-%{version}
ln -s felix-bundlerepository-%{version} %{buildroot}%{_javadocdir}/felix-bundlerepository
rm -rf target/site/apidocs

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/felix/org.apache.felix.bundlerepository-%{version}.jar
%{_javadir}/felix/org.apache.felix.bundlerepository.jar
%{_mavendepmapfragdir}
%{_datadir}/maven2/poms
%doc LICENSE* NOTICE doc/*

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/felix-bundlerepository-%{version}
%{_javadocdir}/felix-bundlerepository

%changelog
* Mon Mar 28 2011 gil <puntogil@...> 1.6.0-3mamba
- rebuilt with java-openjdk support

* Sat Nov 27 2010 gil <puntogil@...> 1.6.0-2mamba
- rebuilt devel

* Tue Apr 13 2010 gil <puntogil@...> 1.6.0-1mamba
- update to 1.6.0

* Thu Mar 11 2010 gil <puntogil@...> 1.4.1-1mamba
- package created by autospec