packages apache-felix-javax-servlet.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven                    0
Name:          apache-felix-javax-servlet
Version:       1.0.1
Release:       4mamba
Summary:       Felix Servlet 2.1 API
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://felix.apache.org/site/index.html
# jsvn export http://svn.apache.org/repos/asf/felix/trunk/javax.servlet
Source0:       felix-javax.servlet-1.0.1-SNAPSHOT-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       apache-felix-javax-servlet-1.0.1-build.xml
Source3:       apache-felix-javax-servlet-1.0.1-maven-build.properties
Source4:       apache-felix-javax-servlet-1.0.1-maven-build.xml
License:       Apache License 2.0
BuildRequires: apache-ant
BuildRequires: apache-felix-osgi-service-obr
%if %maven
BuildRequires: apache-maven
BuildRequires: apache-maven-plugin-ant
BuildRequires: apache-maven-plugin-compiler
BuildRequires: apache-maven-plugin-jar
BuildRequires: apache-maven-plugin-javadoc
%endif
BuildRequires: java-easymock-java5
BuildRequires: java-junit3
BuildRequires: jpackage-utils
Requires:      jpackage-utils
#Requires:      java-openjdk
Obsoletes:     javax.servlet
Provides:      javax.servlet
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
Apache Felix Servlet 2.1 API.

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

%description javadoc
Apache Felix Servlet 2.1 API.
This package contains javadoc for %{name}.

%prep
%setup -q -n javax.servlet

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
	
	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
%endif

%build
export JAVA_HOME=%{_jvmdir}/jdk
export MAVEN_REPO_LOCAL=$PWD/.m2/repository
export MAVEN_SETTINGS=$PWD/settings.xml

%if %maven
	mkdir -p $MAVEN_REPO_LOCAL/junit/junit/3.8.1
	ln -sf $(build-classpath junit-3.8.2) $MAVEN_REPO_LOCAL/junit/junit/3.8.1/junit-3.8.1.jar
	mkdir -p $MAVEN_REPO_LOCAL/easymock/easymock/1.2_Java1.3
	ln -sf %{_javadir}/easymock-java5.jar $MAVEN_REPO_LOCAL/easymock/easymock/1.2_Java1.3/easymock-1.2_Java1.3.jar
	mkdir -p $MAVEN_REPO_LOCAL/org/apache/felix/org.osgi.service.obr/1.0.1
	ln -sf %{_javadir}/felix/org.osgi.service.obr.jar \
		$MAVEN_REPO_LOCAL/org/apache/felix/org.osgi.service.obr/1.0.1/org.osgi.service.obr-1.0.1.jar

	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 \
		ant:ant install javadoc:javadoc

%else

	export CLASSPATH=$(build-classpath junit-3.8.2 easymock-java5 felix/org.osgi.service.obr):target/classes: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

%endif

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

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

install -pm 644 target/javax.servlet-%{version}-SNAPSHOT.jar \
	%{buildroot}%{_javadir}/felix/javax.servlet-%{version}.jar

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

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

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

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/felix/javax.servlet-%{version}.jar
%{_javadir}/felix/javax.servlet.jar
%{_mavendepmapfragdir}
%{_datadir}/maven2/poms
%doc LICENSE NOTICE

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

%changelog
* Sun Apr 27 2014 Silvan Calarco <silvan.calarco@...> 1.0.1-4mamba
- require java-openjdk instead of sun-java

* Fri Nov 26 2010 gil <puntogil@...> 1.0.1-3mamba
- rebuilt devel

* Mon Mar 15 2010 gil <puntogil@...> 1.0.1-2mamba
- edit spec file

* Fri Oct 02 2009 gil <puntogil@...> 1.0.1-1mamba
- update to 1.0.1

* Wed Jun 03 2009 gil <puntogil@...> 1.0.0-1mamba
- package created by autospec