packages jakarta-commons-modeler.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven                 0
%define        only_ant              0
Name:          jakarta-commons-modeler
Version:       2.0.1
Release:       2mamba
Summary:       Model MBeans utilty classes
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://commons.apache.org/modeler
Source0:       http://archive.apache.org/dist/commons/modeler/source/commons-modeler-%{version}-src.tar.gz
Source1:       maven2-2.2.0-settings.xml
# svn export -r 678495 http://svn.apache.org/repos/asf/commons/proper/modeler/trunk/pom.xml
# edit commons-modeler pom version
Source2:       jakarta-commons-modeler-2.0.1-edit-pom.xml
Source3:       jakarta-commons-modeler-2.0.1-edit-OSGI-MANIFEST.MF
Source4:       jakarta-commons-modeler-2.0.1-edit-build.xml
Source5:       jakarta-commons-modeler-2.0.1-edit-maven-build.properties
Source6:       jakarta-commons-modeler-2.0.1-edit-maven-build.xml
# from fedora
Source7:       jakarta-commons-modeler-2.0.1-pom.xml
Source8:       jakarta-commons-modeler-2.0.1-OSGI-MANIFEST.MF
Source9:       jakarta-commons-modeler-2.0.1-build.xml
Source10:      jakarta-commons-modeler-2.0.1-maven-build.properties
Source11:      jakarta-commons-modeler-2.0.1-maven-build.xml

Patch0:        jakarta-commons-modeler-2.0-build_properties_default.patch
Patch1:        jakarta-commons-modeler-2.0-build_xml.patch
License:       Apache License Version 2.0
BuildRequires: apache-ant
%if %maven
BuildRequires: apache-maven
BuildRequires: apache-maven-ant-plugin
BuildRequires: apache-maven-antrun-plugin
BuildRequires: apache-maven-assembly-plugin
BuildRequires: apache-maven-compiler-plugin
BuildRequires: apache-maven-idea-plugin
BuildRequires: apache-maven-install-plugin
BuildRequires: apache-maven-jar-plugin
BuildRequires: apache-maven-javadoc-plugin
BuildRequires: apache-maven-resources-plugin
BuildRequires: felix maven-bundle-plugin 
BuildRequires: maven-doxia
BuildRequires: maven-surefire-junit
BuildRequires: maven-surefire-plugin
%endif
BuildRequires: apache-xml-crimson
BuildRequires: findutils
BuildRequires: jakarta-commons-beanutils
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-digester
BuildRequires: jakarta-commons-logging
BuildRequires: java-junit3
BuildRequires: java-mx4j
BuildRequires: sun-java
BuildRequires: sun-java-javadoc
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
Requires:      jakarta-commons-beanutils
Requires:      jakarta-commons-collections
Requires:      jakarta-commons-digester
Requires:      jakarta-commons-logging
Requires:      java-mx4j
Requires:      jpackage-utils
Requires:      xerces-j2
Requires:      xalan-j2
Requires:      xml-commons-apis
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Modeler project shall create and maintain a set of Java
classes to provide support for configuring and instantiating Model
MBeans, plus unit tests and small examples of using these facilities
to instrument Java classes with Model MBean support.

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

%description javadoc
Model MBeans utilty classes.

This package contains javadoc for %{name}

%prep

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

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

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

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

sed -i 's/\r//' xdocs/downloads.xml
sed -i 's/\r//' xdocs/cvs-usage.xml
sed -i 's/\r//' xdocs/issue-tracking.xml
sed -i 's/\r//' LICENSE.txt
sed -i 's/\r//' xdocs/navigation.xml
sed -i 's/\r//' xdocs/style/project.css
sed -i 's/\r//' xdocs/index.xml
sed -i 's/\r//' xdocs/building.xml
sed -i 's/\r//' NOTICE.txt
sed -i 's/\r//' RELEASE-NOTES.txt

cp %{SOURCE2} pom.xml

%if %maven
	cp %{SOURCE1} settings.xml
	mkdir -p .m2/repository/JPP/maven2
	mv build.xml build.xml-old
	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
	%if %only_ant
		%patch0 -p1
		%patch1 -p1
	%else
		mkdir -p target/osgi
		cp %{SOURCE3} target/osgi/MANIFEST.MF
		cp %{SOURCE4} build.xml
		cp %{SOURCE5} maven-build.properties
		cp %{SOURCE6} maven-build.xml
	%endif
%endif

%build

export JAVA_HOME=/usr/lib/jvm/jdk-sun
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

%if %maven
	export MAVEN_SETTINGS=$(pwd)/settings.xml

	mkdir external_repo
	ln -s %{_javadir} external_repo/JPP

	mvn-jpp \
		-e \
		-s $MAVEN_SETTINGS \
		-Dmaven.test.failure.ignore=true \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		ant:ant install javadoc:javadoc
# one:convert
%else

	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath ant crimson jakarta-commons-beanutils)
	CLASSPATH=$CLASSPATH:$(build-classpath jakarta-commons-collections jakarta-commons-digester)
	CLASSPATH=$CLASSPATH:$(build-classpath jakarta-commons-logging jakarta-commons-logging-api)
	CLASSPATH=$CLASSPATH:$(build-classpath mx4j/mx4j mx4j/mx4j-jmx xalan-j2 xercesImpl xml-commons-apis)
	CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2):target/classes:target/test-classes
	%if %only_ant
		ant dist
	%else
		ant \
			-Duser.home=$PWD \
			-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
			-Dmaven.settings.offline=true \
			-Dmaven.settings.interactiveMode=false \
			-Dbuild.sysclasspath=first \
			-Djavase6.api=%{_javadocdir}/java \
			jar javadoc
	%endif
%endif

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

mkdir -p %{buildroot}%{_javadir}

%if %only_ant
	install -pm 644 dist/commons-modeler.jar \
		%{buildroot}%{_javadir}/jakarta-commons-modeler-%{version}.jar
%else
	install -pm 644 target/commons-modeler-%{version}.jar \
		%{buildroot}%{_javadir}/jakarta-commons-modeler-%{version}.jar
%endif


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

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

mkdir -p %{buildroot}%{_javadocdir}/jakarta-commons-modeler-%{version}

%if %only_ant
	cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/jakarta-commons-modeler-%{version}
%else
	cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/jakarta-commons-modeler-%{version}
%endif
ln -s jakarta-commons-modeler-%{version} %{buildroot}%{_javadocdir}/jakarta-commons-modeler

mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-commons-modeler.pom
%add_to_maven_depmap commons-modeler commons-modeler %{version} JPP commons-modeler

#%{_bindir}/aot-compile-rpm

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

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

%changelog
* Sat Dec 11 2010 gil <puntogil@...> 2.0.1-2mamba
- rebuilt devel

* Sat Mar 06 2010 gil <puntogil@...> 2.0.1-1mamba
- update to 2.0.1
- added osgi manifest
- added maven pom
- edit spec file

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