packages jakarta-commons-net2.spec
      Pages: < 1 >  DOWNLOAD      
%define        with_maven         0
%define        javahome          /usr/lib/jvm/java
Name:          jakarta-commons-net2
Version:       2.0
Release:       3mamba
Summary:       Internet protocol suite Java library
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://commons.apache.org/net/
#Source0:       http://apache.fis.uniroma2.it/commons/net/source/commons-net-%{version}-src.tar.gz
Source0:       http://apache.mirror.rbftpnetworks.com/commons/net/source/commons-net-2.0-src.tar.bz2
Source1:       maven2-2.2.0-settings.xml
# files generated by maven
Source2:       jakarta-commons-net2-2.0-autogeneratedfiles.tar.gz
License:       Apache Software License 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
%if %with_maven
BuildRequires: apache-maven2
BuildRequires: apache-maven2-ant-plugin
BuildRequires: apache-maven2-antrun-plugin
BuildRequires: apache-maven2-assembly-plugin
BuildRequires: apache-maven2-compiler-plugin
#BuildRequires: apache-maven2-changes-plugin
BuildRequires: apache-maven2-jar-plugin
BuildRequires: apache-maven2-javadoc-plugin
#BuildRequires: maven-surefire-plugin
#BuildRequires: mojo-clirr-maven-plugin
%endif
BuildRequires: jakarta-oro
BuildRequires: java-junit3
BuildRequires: java-openjdk-javadoc
BuildRequires: jpackage-utils
Requires:      jakarta-oro
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
Jakarta Commons Net implements the client side of many basic Internet protocols. The purpose of the library is to provide
fundamental protocol access, not higher-level abstractions. Therefore, some of the design violates object-oriented design
principles. Our philosophy is to make the global functionality of a protocol accessible (e.g., TFTP send file and receive file)
when possible, but also provide access to the fundamental protocols where applicable so that the programmer may
construct his own custom implementations (e.g, the TFTP packet classes and the TFTP packet send and receive methods are exposed).

Features

Supported protocols are:

* FTP/FTPS
* NNTP
* SMTP
* POP3
* Telnet
* TFTP
* Finger
* Whois
* rexec/rcmd/rlogin
* Time (rdate) and Daytime
* Echo
* Discard
* NTP/SNTP

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

%description javadoc
A collection of network utilities and protocol implementations.

This package contains javadoc for %{name}.

%package devel
Group:      Development/Languages
Summary:    Devel package for %{name}
Requires:   %{name} = %{?epoch:%epoch:}%{version}-%{release}

%description devel
A collection of network utilities and protocol implementations.

This package contains Jakarta Commons Net sources and javadoc in jar format.

%prep

%setup -q -n commons-net-%{version}-src

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

sed -i 's/\r//' NOTICE.txt LICENSE.txt

%if %with_maven
  cp %{SOURCE1} settings.xml

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

%build

export JAVA_HOME=%{javahome}
export MAVEN_REPO_LOCAL=$PWD/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL/JPP/maven2/default_poms
cp pom.xml .m2/repository/JPP/maven2/default_poms/org.apache.commons-commons-parent.pom

%if %with_maven
  export MAVEN_SETTINGS=$PWD/settings.xml
  mkdir external_repo
  ln -s %{_javadir} external_repo/JPP

  mkdir -p $MAVEN_REPO_LOCAL/junit/junit/3.8.2
  ln -s $(build-classpath junit-3.8.2) $MAVEN_REPO_LOCAL/junit/junit/3.8.2/junit-3.8.2.jar

  mvn-jpp \
    -e \
    -s $MAVEN_SETTINGS \
    -Dmaven.test.failure.ignore=true \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    ant:ant org.apache.felix:maven-bundle-plugin:ant install javadoc:javadoc

%else

  export CLASSPATH=$(build-classpath junit-3.8.2 oro ant/ant-junit)
  CLASSPATH=$CLASSPATH:target/classes:target/test-classes
  ant \
    -Duser.home=$PWD \
    -Dmaven.mode.offline=true \
    -Dmaven.test.skip=true \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    -Djavase.api=%{_javadocdir}/java \
    jar javadoc
%endif

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

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

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

# mozilla deps
install -m 644 target/commons-net-ftp-%{version}.jar \
    %{buildroot}%{_javadir}/%{name}-ftp-%{version}.jar

install -m 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-commons-net2.pom
%add_to_maven_depmap commons-net commons-net %{version} JPP commons-net2

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

install -m 644 target/commons-net-%{version}-javadoc.jar \
    %{buildroot}%{_javadir}/commons-net2-javadoc-%{version}.jar

install -m 644 target/commons-net-%{version}-sources.jar \
    %{buildroot}%{_javadir}/commons-net2-sources-%{version}.jar

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

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

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

%files  javadoc
%defattr(-,root,root)
%{_javadocdir}/jakarta-commons-net2-%{version}
%{_javadocdir}/jakarta-commons-net2

%files devel
%defattr(-,root,root)
%{_javadir}/commons-net2-javadoc-%{version}.jar
%{_javadir}/commons-net2-javadoc.jar
%{_javadir}/commons-net2-sources-%{version}.jar
%{_javadir}/commons-net2-sources.jar

%changelog
* Fri Mar 25 2011 gil <puntogil@...> 2.0-3mamba
- rebuilt with java-openjdk support

* Thu Oct 22 2009 gil <puntogil@...> 2.0-2mamba
- rebuilt with jdk 6u21
- new sub packages: devel

* Sat Oct 17 2009 gil <puntogil@...> 2.0-1mamba
- update to 2.0
- renamed for legacy jakarta-commons-net2

* Sun Feb 22 2009 gil <puntogil@...> 1.4.1-1mamba
- package created by autospec