packages java-classpathx-mail.spec
      Pages: < 1 >  DOWNLOAD      
%define        inetlibver     1.1.1
%define        jmailver       1.3.1
Name:          java-classpathx-mail
Version:       1.1.1
Release:       3mamba
Summary:       GNU JavaMailâ„¢
Group:         System/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://www.gnu.org/software/classpathx/javamail/javamail.html
Source0:       http://ftp.gnu.org/gnu/classpathx/mail-%{version}.tar.gz
Source1:       http://ftp.gnu.org/gnu/classpath/inetlib-1.1.1.tar.gz
Patch0:        java-classpathx-1.1.1-mail-docbuild.patch
Patch1:        java-classpathx-1.1.1-mail-add-inetlib.patch
Patch2:        java-classpathx-1.1.1-mail-remove-inetlib.patch
Patch3:        java-classpathx-1.1.1-mail-inetlib-docbuild.patch
License:       GPL
BuildRequires: apache-ant
BuildRequires: java-classpathx-jaf
BuildRequires: java-classpathx-jaf-javadoc
BuildRequires: sun-java
BuildRequires: jpackage-utils
Requires:      java-classpathx-jaf
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root


%description
GNU JavaMailâ„¢ is a free implementation of the JavaMail API.

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

%description javadoc
GNU JavaMailâ„¢ is a free implementation of the JavaMail API.

This package contains Javadoc for %{name}.

%prep

%setup -q -n mail-%{version}
%patch0 -p0
%patch1 -p0
%patch2 -p0
rm -f libmail.so
gzip -dc %{S:1} | tar -xf -
pushd inetlib-%{inetlibver}
%patch3 -p0
	mkdir -p source/org/jpackage/mail
	mv source/gnu/inet source/org/jpackage/mail
popd

perl -p -i -e 's/gnu(.)inet/org${1}jpackage${1}mail${1}inet/' `grep gnu.inet -lr *`


%build

pushd inetlib-%{inetlibver}
	ant -Dj2se.apidoc=%{_javadocdir}/java inetlib.jar doc
popd
mkdir classes
cp -r inetlib-%{inetlibver}/classes/org classes

export CLASSPATH=$(%{_bindir}/build-classpath classpathx-jaf)
sed -i "s:/usr/share/java/activation.jar:$CLASSPATH:" build.xml
ant \
	-Dj2se.apidoc=%{_javadocdir}/java \
	-Djaf.apidoc=%{_javadocdir}/jaf \
	dist javadoc

mkdir monolithic
pushd monolithic
	for jar in gnumail gnumail-providers ; do 
		jar xf ../$jar.jar
	done
	rm -f META-INF/MANIFEST.MF
	jar cf ../monolithic.jar *
popd
rm -Rf monolithic

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

mkdir -p %{buildroot}%{_javadir}/classpathx-mail
install -pm 644 gnumail.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/mail-%{jmailver}-api-%{version}.jar
ln -s mail-%{jmailver}-api-%{version}.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/mail-%{jmailver}-api.jar
ln -s mail-%{jmailver}-api.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/mailapi.jar


install -pm 644 gnumail-providers.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/mail-%{jmailver}-providers-%{version}.jar
ln -s mail-%{jmailver}-providers-%{version}.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/mail-%{jmailver}-providers.jar
ln -s mail-%{jmailver}-providers.jar \
  	%{buildroot}%{_javadir}/classpathx-mail/providers.jar
for prov in imap nntp pop3 smtp ; do
  	ln -s mail-%{jmailver}-providers.jar \
    		%{buildroot}%{_javadir}/classpathx-mail/$prov-%{jmailver}.jar
  	ln -s providers.jar %{buildroot}%{_javadir}/classpathx-mail/$prov.jar
done

install -pm 644 monolithic.jar \
  	%{buildroot}%{_javadir}/classpathx-mail-%{jmailver}-monolithic-%{version}.jar
ln -s classpathx-mail-%{jmailver}-monolithic-%{version}.jar \
	%{buildroot}%{_javadir}/classpathx-mail-%{jmailver}-monolithic.jar
touch %{buildroot}%{_javadir}/javamail.jar

mkdir -p %{buildroot}%{_javadocdir}/classpathx-mail-%{jmailver}
cp -pR docs/* %{buildroot}%{_javadocdir}/classpathx-mail-%{jmailver}
ln -s classpathx-mail-%{jmailver} %{buildroot}%{_javadocdir}/classpathx-mail


#%{_bindir}/aot-compile-rpm


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

%files
%defattr(-,root,root)
%{_javadir}/classpathx-mail-%{jmailver}-monolithic-%{version}.jar
%{_javadir}/classpathx-mail-%{jmailver}-monolithic.jar
%ghost %{_javadir}/javamail.jar
%dir %{_javadir}/classpathx-mail/
%{_javadir}/classpathx-mail/imap-%{jmailver}.jar
%{_javadir}/classpathx-mail/imap.jar
%{_javadir}/classpathx-mail/mail-%{jmailver}-api-%{version}.jar
%{_javadir}/classpathx-mail/mail-%{jmailver}-api.jar
%{_javadir}/classpathx-mail/mail-%{jmailver}-providers-%{version}.jar
%{_javadir}/classpathx-mail/mail-%{jmailver}-providers.jar
%{_javadir}/classpathx-mail/mailapi.jar
%{_javadir}/classpathx-mail/nntp-%{jmailver}.jar
%{_javadir}/classpathx-mail/nntp.jar
%{_javadir}/classpathx-mail/pop3-%{jmailver}.jar
%{_javadir}/classpathx-mail/pop3.jar
%{_javadir}/classpathx-mail/providers.jar
%{_javadir}/classpathx-mail/smtp-%{jmailver}.jar
%{_javadir}/classpathx-mail/smtp.jar
%doc AUTHORS COPYING ChangeLog NEWS README*

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/classpathx-mail
%{_javadocdir}/classpathx-mail-%{jmailver}

%changelog
* Tue Nov 09 2010 gil <puntogil@...> 1.1.1-3mamba
- rebuilt devel

* Wed Feb 25 2009 gil <puntogil@...> 1.1.1-2mamba
- fixed some errors

* Sat Feb 21 2009 gil <puntogil@...> 1.1.1-1mamba
- package created by autospec