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@...>
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
BuildRequires: jakarta-oro
BuildRequires: java-junit3
BuildRequires: java-openjdk-javadoc
BuildRequires: jpackage-utils
Requires:      jakarta-oro
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

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).


Supported protocols are:

* POP3
* Telnet
* Finger
* Whois
* rexec/rcmd/rlogin
* Time (rdate) and Daytime
* Echo
* Discard

%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.


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

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

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


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 \
    -Dmaven.test.failure.ignore=true \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    ant:ant org.apache.felix:maven-bundle-plugin:ant install javadoc:javadoc


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

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

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

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

# mozilla deps
install -m 644 target/commons-net-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"`

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

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

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

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

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




%files  javadoc

%files devel

* 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