packages jakarta-commons-discovery.spec
      Pages: < 1 >  DOWNLOAD      
%define        repo           %{_javadir}/repository.jboss.com
%define        repodir        %{repo}/apache-discovery/%{version}-brew
%define        repodirlib     %{repodir}/lib
%define        repodirsrc     %{repodir}/src

Name:          jakarta-commons-discovery
Version:       0.4
Release:       4mamba
Summary:       Jakarta Commons Service Discovery Package
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://commons.apache.org/discovery/
Source0:       http://www.apache.org/dist/jakarta/commons/discovery/source/commons-discovery-%{version}-src.tar.gz
Source1:       http://mirrors.ibiblio.org/pub/mirrors/maven2/commons-discovery/commons-discovery/%{version}/commons-discovery-%{version}.pom
Patch0:        jakarta-commons-discovery-0.4-OSGI-MANIFEST.patch
Source2:       java-component-info3.xml
License:       Apache Software License 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-nodeps
BuildRequires: jakarta-commons-logging
BuildRequires: java-junit3
BuildRequires: jpackage-utils
Requires:      jakarta-commons-logging
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Discovery component is about discovering, or finding, implementations for pluggable interfaces.  Pluggable interfaces are specified with the intent that multiple implementations are, or will be, available to provide the service described by the interface.  Discovery provides facilities for finding and instantiating classes, and for lifecycle management of singleton (factory) classes.

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

%description javadoc
Jakarta Commons Service Discovery Package

This package contains javadoc for %{name}

%package repolib
Group:         Development/Libraries/Java
Summary:       Artifacts to be uploaded to a repository library

%description repolib
Jakarta Commons Service Discovery Package.

This package contains artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents can be extracted through rpm2cpio

%prep
%setup -q -n commons-discovery-%{version}-src

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

%patch0

chmod u+w .

%build
export JAVA_HOME=%{_jvmdir}/jdk
ant \
  -Djunit.jar=%(find-jar junit-3.8.2) \
  -Dlogger.jar=%(find-jar jakarta-commons-logging) \
  test.discovery dist

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

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

install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-commons-discovery.pom
%add_to_maven_depmap commons-discovery commons-discovery %{version} JPP commons-discovery

install -m 644 dist/commons-discovery.jar \
  %{buildroot}%{_javadir}/%{name}-%{version}.jar

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

mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}

mkdir -p %{buildroot}%{repodir}
mkdir -p %{buildroot}%{repodirlib}
install -m 644 %{SOURCE2} %{buildroot}%{repodir}/component-info.xml
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/@NAME@/apache-commons-discovery-component-info/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ID@/apache-discovery/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@TAG@/$tag/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@VERSION@/%{version}-brew/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@LICENSE@/%{license}/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s|@PROJECTHOME@|%{url}|g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@DESCRIPTION@/Jakarta Commons Discovery/g" \
	%{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID@/commons-discovery.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT@/commons-discovery.jar/g" %{buildroot}%{repodir}/component-info.xml
mkdir -p %{buildroot}%{repodirsrc}
install -pm 644 %{SOURCE0} %{buildroot}%{repodirsrc}
cp -p %{buildroot}%{_javadir}/jakarta-commons-discovery-%{version}.jar %{buildroot}%{repodirlib}/commons-discovery.jar

#%{_bindir}/aot-compile-rpm

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/commons-discovery-%{version}.jar
%{_javadir}/commons-discovery.jar
%{_javadir}/jakarta-commons-discovery-%{version}.jar
%{_javadir}/jakarta-commons-discovery.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt

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

%files repolib
%defattr(-,root,root)
%{repodir}

%changelog
* Sun Mar 27 2011 gil <puntogil@...> 0.4-4mamba
- rebuilt with java-openjdk support

* Mon Nov 29 2010 gil <puntogil@...> 0.4-3mamba
- rebuilt devel

* Mon Nov 16 2009 gil <puntogil@...> 0.4-2mamba
- added new sub package(s): jakarta-commons-discovery-repolib
- added osgi manifest

* Wed Mar 11 2009 gil <puntogil@...> 0.4-1mamba
- package created by autospec