# # spec file for package apache-portlet-1_0-api (Version 1.0) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}} # If you don't want to build with maven, and use straight ant instead, # give rpmbuild option '--without maven' %define with_maven %{!?_without_maven:1}%{?_without_maven:0} %define without_maven %{?_without_maven:1}%{!?_without_maven:0} %define with_maven 0 %define base_name portlet-1.0-api %define section free Name: apache-portlet-1_0-api Version: 1.0 Release: 2 Summary: Portlet API 1.0 from Jetspeed2 License: The Apache Software License Url: http://portals.apache.org/jetspeed-2/ Group: Development/Libraries/Java Source0: apache-portlet-1.0-api.tar.gz # svn export http://svn.apache.org/repos/asf/portals/jetspeed-2/tags/JETSPEED-RELEASE-2.0/portlet-api/ Source1: apache-portlet-1.0-api-pom.xml Source2: apache-portlet-1.0-api-LICENSE.TXT Source3: apache-portlet-1.0-api-build.xml BuildRequires: jpackage-utils >= 1.7.2 BuildRequires: java-devel >= 1.4 BuildRequires: ant >= 1.6 ant-nodeps %if %{with_maven} BuildRequires: maven2 >= 2.0.4-9 BuildRequires: maven2-plugin-compiler BuildRequires: maven2-plugin-install BuildRequires: maven2-plugin-jar BuildRequires: maven2-plugin-javadoc BuildRequires: maven2-plugin-release BuildRequires: maven2-plugin-resources BuildRequires: maven2-plugin-surefire %endif Requires(post): jpackage-utils >= 1.7.2 Requires(postun): jpackage-utils >= 1.7.2 Provides: portlet = %{version} Provides: portlet-1.0-api = %{version} %if ! %{gcj_support} BuildArch: noarch %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{gcj_support} BuildRequires: gnu-crypto BuildRequires: java-gcj-compat-devel Requires(post): java-gcj-compat Requires(postun): java-gcj-compat %endif %description Java Standard Portlet API accoring to JSR-168, from Jetspeed-2 . %package javadoc Summary: Portlet API 1.0 from Jetspeed2 Group: Development/Libraries/Java Requires(post): /bin/rm,/bin/ln Requires(postun): /bin/rm %description javadoc Java Standard Portlet API accoring to JSR-168, from Jetspeed-2 . %{summary}. %prep %setup -q -n apache-portlet-1.0-api # remove all binary libs find . -name "*.jar" -exec rm -f {} \; cp %{SOURCE1} pom.xml cp %{SOURCE3} build.xml %build %if %{with_maven} export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository mvn-jpp -e \ -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ install javadoc:javadoc %else ant jar javadoc %endif %install rm -rf $RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT%{_javadir} install -m 0644 target/portlet-api-1.0.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar (cd $RPM_BUILD_ROOT%{_javadir} && ln -sf %{name}-%{version}.jar %{base_name}-%{version}.jar) %add_to_maven_depmap javax.portlet portlet-api 1.0 JPP %{base_name} # create unversioned symlinks (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} $(echo $jar | sed -e 's+-%{version}\.jar+.jar+'); done) #poms install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms install -pm 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.portlet-api.pom install -d -m 755 $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} # ghost symlink install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} cp %{SOURCE2} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/LICENSE.TXT %if %{gcj_support} export CLASSPATH=$(build-classpath gnu-crypto) %{_bindir}/aot-compile-rpm %endif %clean rm -rf $RPM_BUILD_ROOT %post %update_maven_depmap %if %{gcj_support} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %postun %update_maven_depmap %if %{gcj_support} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %post javadoc rm -f %{_javadocdir}/%{name} ln -s %{name}-%{version} %{_javadocdir}/%{name} %postun javadoc if [ "$1" = "0" ]; then rm -f %{_javadocdir}/%{name} fi %files %defattr(0644,root,root,0755) %doc %{_docdir}/%{name}-%{version}/LICENSE.TXT %dir %{_docdir}/%{name}-%{version} %{_javadir}/%{name}*.jar %{_javadir}/%{base_name}*.jar %{_datadir}/maven2 %{_mavendepmapfragdir} %if %{gcj_support} %dir %attr(-,root,root) %{_libdir}/gcj/%{name} %attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.* %endif %files javadoc %defattr(0644,root,root,0755) %{_javadocdir}/%{name}-%{version} %ghost %{_javadocdir}/%{name} %changelog * Thu Mar 13 2008 mvyskocil@suse.cz - Initial package build of version 1.0 (jpackage 1.7)