packages java-plexus-jetty-httpd.spec
      Pages: < 1 >  DOWNLOAD      
%define        api_version         1.0
%define        maven               0
Name:          java-plexus-jetty-httpd
Version:       1.0b2
Release:       1mamba
Summary:       Plexus Jetty HTTPD Component
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://plexus.codehaus.org/
# svn export http://svn.codehaus.org/plexus/archive/plexus-components/plexus-jetty-httpd plexus-jetty-httpd-1.0-beta-2-SNAPSHOT
Source0:       plexus-jetty-httpd-1.0-beta-2-SNAPSHOT-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       java-plexus-jetty-httpd-1.0b2-autogeneratedfiles.tar.gz
Patch0:        java-plexus-jetty-httpd-1.0b2-pom_xml.patch
Patch1:        java-plexus-jetty-httpd-1.0b2-DefaultHttpd.patch
License:       Apache Software License 2.0
BuildRequires: apache-ant
%if %maven
BuildRequires: apache-maven2
BuildRequires: apache-maven2-plugin-compiler
BuildRequires: apache-maven2-plugin-install
BuildRequires: apache-maven2-plugin-jar
BuildRequires: apache-maven2-plugin-javadoc
BuildRequires: apache-maven2-plugin-resources
BuildRequires: apache-maven2-plugin-surefire
%endif
BuildRequires: jakarta-commons-logging
BuildRequires: java-classworlds
BuildRequires: java-plexus-container-default
BuildRequires: java-plexus-utils
BuildRequires: libjetty5
BuildRequires: jpackage-utils
Requires:      jakarta-commons-logging
Requires:      java-classworlds
Requires:      java-plexus-container-default
Requires:      java-plexus-utils
Requires:      libjetty5
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Plexus project seeks to create end-to-end developer tools for 
writing applications. At the core is the container, which can be 
embedded or for a full scale application server. There are many 
reusable components for hibernate, form processing, jndi, i18n, 
velocity, etc. Plexus also includes an application server which 
is like a J2EE application server, without all the baggage.

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

%description javadoc
Plexus Jetty HTTPD Component.

This package contains javadoc for %{name}

%prep

%setup -q -n plexus-jetty-httpd-1.0-beta-2-SNAPSHOT

%patch0 -p1
%patch1 -p1

%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
	tar -xzf %{SOURCE2}
%endif

%build
export JAVA_HOME=/usr/lib/jvm/jdk-sun
export MAVEN_REPO_LOCAL=$PWD/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

%if %maven
	mkdir external_repo
	ln -s %{_javadir} external_repo/JPP
	mvn-jpp \
		-e \
		-s $PWD/settings.xml \
		-Dmaven.test.failure.ignore=true \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		ant:ant install javadoc:javadoc
%else

	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath jetty5/jetty jetty5/jetty-servlet commons-logging)
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/containers-default plexus/classworlds plexus/utils classworlds)
	CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2):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}/plexus
install -pm 644 target/plexus-jetty-httpd-%{api_version}-beta-2.jar \
 	%{buildroot}%{_javadir}/plexus/jetty-httpd-%{api_version}.jar
%add_to_maven_depmap org.codehaus.plexus plexus-jetty-httpd %{api_version} JPP/plexus jetty-httpd

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


mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.plexus-jetty-httpd.pom

mkdir -p %{buildroot}%{_javadocdir}/plexus-jetty-httpd-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/plexus-jetty-httpd-%{version}
ln -s plexus-jetty-httpd-%{version} %{buildroot}%{_javadocdir}/plexus-jetty-httpd

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

%files
%defattr(-,root,root)
%{_javadir}/plexus/jetty-httpd-%{api_version}.jar
%{_javadir}/plexus/jetty-httpd.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/plexus-jetty-httpd-%{version}
%{_javadocdir}/plexus-jetty-httpd

%changelog
* Thu Jul 09 2009 gil <puntogil@...> 1.0b2-1mamba
- package created by autospec