packages jakarta-jmeter.spec
      Pages: < 1 >  DOWNLOAD      
%define        javahome     /usr/lib/jvm/jdk-sun
%define        javac_bin    %{javahome}/bin/javac
%define        jar_bin      %{javahome}/bin/jar
%define        javadoc_bin  %{javahome}/bin/javadoc

Name:          jakarta-jmeter
Version:       2.4
Release:       2mamba
Summary:       Apache Jakarta JMeter - Pure Java application for load and functional testing
Group:         Development/Tools
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://jakarta.apache.org/jmeter
# jsvn export https://svn.apache.org/repos/asf/jakarta/jmeter/tags/v2_4 jmeter-2.4 
Source0:       jmeter-%{version}-src-svn.tar.gz
# mkdir -p src/junit && cd src/junit
# jsvn export https://svn.apache.org/repos/asf/jakarta/jmeter/trunk/src/junit/woolfel
Source1:       jmeter-junit-woolfel-2.4-src-svn.tar.gz
Source2:       jmeter-script
Source3:       jmeter.png
Patch0:        jakarta-jmeter-2.4-cross_link.patch
License:       Apache Software License Version 2.0
BuildRequires: ant-findbugs
BuildRequires: apache-anakia
BuildRequires: apache-ant
BuildRequires: apache-commons-cli-avalon
BuildRequires: apache-commons-codec
# jms_1.1_spec-1.1.1 javamail_1.4_spec-1.8.1 activation_1.1_spec-1.1
BuildRequires: apache-geronimo-1.2-specs
BuildRequires: apache-velocity
BuildRequires: apache-ws-soap
BuildRequires: jakarta-bsf3
BuildRequires: jakarta-bsf24
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-httpclient
BuildRequires: jakarta-commons-io
BuildRequires: jakarta-commons-jexl
BuildRequires: jakarta-commons-lang24
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-net
BuildRequires: jakarta-oro
BuildRequires: java-excalibur-avalon-framework
BuildRequires: java-excalibur-avalon-logkit
BuildRequires: java-excalibur-datasource
BuildRequires: java-excalibur-instrument-api
BuildRequires: java-excalibur-logger
BuildRequires: java-excalibur-pool-api
BuildRequires: java-excalibur-pool-impl
BuildRequires: java-excalibur-pool-instrumented
BuildRequires: java-bouncycastle
BuildRequires: java-bsh2b5
BuildRequires: java-bsh2b5-bsf
BuildRequires: java-bsh2b5-classgen
BuildRequires: java-dom
BuildRequires: java-findbugs
BuildRequires: java-glassfish-jaf
BuildRequires: java-htmlparser
BuildRequires: java-jcharts
BuildRequires: java-junit48
BuildRequires: java-rhino
BuildRequires: java-sun-doccheck
BuildRequires: java-sun-mail-1.4-api
BuildRequires: java-svnant
BuildRequires: java-tidyr938
BuildRequires: java-xpp3-mini
BuildRequires: java-xstream
BuildRequires: jpackage-utils
BuildRequires: xalan-j2
BuildRequires: xalan-j2-xsltc
BuildRequires: xerces-j2
BuildRequires: xmlgraphics-commons == 1.3.1
BuildRequires: sun-java-javadoc
BuildRequires: xalan-j2-javadoc
Requires:      apache-commons-cli-avalon
Requires:      apache-commons-codec
Requires:      apache-geronimo-1.2-specs
Requires:      apache-ws-soap
Requires:      jakarta-bsf3
Requires:      jakarta-bsf24
Requires:      jakarta-commons-collections
Requires:      jakarta-commons-httpclient
Requires:      jakarta-commons-io
Requires:      jakarta-commons-jexl
Requires:      jakarta-commons-lang24
Requires:      jakarta-commons-logging
Requires:      jakarta-commons-net
Requires:      jakarta-oro
Requires:      java-bouncycastle
Requires:      java-excalibur-avalon-framework
Requires:      java-excalibur-avalon-logkit
Requires:      java-excalibur-datasource
Requires:      java-excalibur-instrument-api
Requires:      java-excalibur-logger
Requires:      java-excalibur-pool-api
Requires:      java-excalibur-pool-impl
Requires:      java-excalibur-pool-instrumented
Requires:      java-dom
Requires:      java-bsh2b5
Requires:      java-bsh2b5-bsf
Requires:      java-bsh2b5-classgen
Requires:      java-glassfish-jaf
Requires:      java-htmlparser
Requires:      java-jcharts
Requires:      java-junit48
Requires:      java-rhino
Requires:      java-sun-doccheck
Requires:      java-sun-mail-1.4-api
Requires:      java-svnant
Requires:      java-tidyr938
Requires:      java-xpp3-mini
Requires:      java-xstream
Requires:      jpackage-utils
Requires:      xalan-j2
Requires:      xalan-j2-xsltc
Requires:      xerces-j2
Requires:      xmlgraphics-commons == 1.3.1
BuildRoot:     %{_tmppath}/%{name}-%{version}-root
# http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-user/200807.mbox/%3C849A9D9AF0C06740BB63C6DA292DF21304E1BD7D@KC-BEEXCH-1-1.cybage.com%3E
%description
Apache JMeter is a 100%% pure Java desktop application
designed to load test functional behavior and measure
performance. It was originally designed for testing
Web Applications but has since expanded to other test
functions.

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

%description javadoc
Apache JMeter is a 100%% pure Java application
designed to test and measure performance.

This package contains javadoc for %{name}.

%package manual
Group:         Documentation
Summary:       Manual for %{name}

%description manual
Apache JMeter is a 100%% pure Java application
designed to test and measure performance.

This package contains documentation for %{name}.

%prep

%setup -q -n jmeter-%{version}
%setup -q -n jmeter-%{version} -D -T -a 1

%patch0

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

rm -rf build.properties
cat > build.properties << __GIL
apache-bsf.jar=$(build-classpath bsf24)
avalon-framework.jar=$(build-classpath excalibur/avalon-framework)
beanshell.jar=$(build-classpath bsh2b5/bsh)
commons-codec.jar=$(build-classpath apache-commons-codec)
commons-collections.jar=$(build-classpath commons-collections)
commons-httpclient.jar=$(build-classpath commons-httpclient)
commons-io.jar=$(build-classpath commons-io)
commons-jexl.jar=$(build-classpath commons-jexl)
commons-lang.jar=$(build-classpath commons-lang24)
commons-logging.jar=$(build-classpath commons-logging)
commons-net.jar=$(build-classpath commons-net)
excalibur-datasource.jar=$(build-classpath excalibur/excalibur-datasource)
excalibur-instrument.jar=$(build-classpath excalibur/excalibur-instrument-api)
excalibur-logger.jar=$(build-classpath excalibur/excalibur-logger-2.2.2)
excalibur-pool.jar=$(build-classpath excalibur/excalibur-pool-api)
logkit.jar=$(build-classpath excalibur/avalon-logkit)
htmlparser.jar=$(build-classpath htmlparser)
htmllexer.jar=$(build-classpath htmllexer)
jakarta-oro.jar=$(build-classpath oro)
jcharts.jar=$(build-classpath jcharts)
jdom.jar=$(build-classpath jdom)
js_rhino.jar=$(build-classpath rhino)
junit.jar=$(build-classpath junit48)
soap.jar=$(build-classpath ws-soap)
tidy.jar=$(build-classpath jtidyr938)
xstream.jar=$(build-classpath xstream)
xpp3.jar=$(build-classpath xpp3-minimal)
serializer.jar=$(build-classpath xerces-j2)
xalan.jar=$(build-classpath xalan-j2)
xerces.jar=$(build-classpath xercesImpl)
xml-apis.jar=$(build-classpath xerces-j2)
xmlgraphics-commons.jar=$(build-classpath xmlgraphics-commons)
activation.jar=$(build-classpath geronimo/activation-1.1-api)
javamail.jar=$(build-classpath geronimo/javamail-1.4-api)
jms.jar=$(build-classpath geronimo/jms-1.1-api)
velocity.jar=$(build-classpath apache-velocity)
3rdparty.present=true
__GIL

%build

# -Dfindbugs.homedir=$PWD/findbugs

PROTOCOLS_CLASSES=build/protocol/http:build/protocol/ftp:build/protocol/jdbc:build/protocol/java:build/protocol/ldap:build/protocol/mail:build/protocol/tcp:build/protocol/jms
CLASSES_DIR=build/jorphan:build/monitor/model:build/core:build/components:build/functions:build/monitor/components:build/junit:build/reports
export JAVA_HOME=%{javahome}

export CLASSPATH=""
CLASSPATH=$CLASSPATH:$(build-classpath excalibur/excalibur-pool-instrumented \
	excalibur/excalibur-pool-impl ant/ant-findbugs junit48 xpp3 apache-commons-codec \
	commons-lang24 commons-collections commons-logging commons-cli bsf3/api bsf24 xstream htmlparser \
	excalibur/excalibur-logger-2.2.2 excalibur/avalon-framework commons-jexl commons-cli-avalon \
	svnant bsh2b5 excalibur/avalon-logkit jtidyr938):$CLASSES_DIR:$PROTOCOLS_CLASSES

ant -Djava.awt.headless=true -Dbuild.sysclasspath=only compile-jorphan
%{jar_bin}  cf lib/jorphan.jar -C build/jorphan .

CLASSPATH=$CLASSPATH:$(build-classpath commons-httpclient commons-io oro rhino xmlgraphics-commons \
	jtidyr938 jdom xalan-j2 geronimo/javamail-1.4-api jcharts htmllexer ws-soap excalibur/excalibur-datasource \
	commons-net excalibur/excalibur-instrument-api geronimo/jms-1.1-api geronimo/activation-1.1-api bcmail bcprov xsltc)
ant -Djava.awt.headless=true -Dbuild.sysclasspath=only -Dsrc.java.version=1.5 -Dtarget.java.version=1.5

CLASSPATH=$CLASSPATH:$(build-classpath anakia doccheck apache-velocity)
ant \
  -Djava.awt.headless=true \
  -Dj2se.api=%{_javadocdir}/java \
  -Djmeter.version=%{version} \
  docs-api docs-site docs-printable

rm -rf build/junit/org
%{jar_bin}  cf lib/junit/test.jar -C build/junit .

JMETERHOME=$PWD
(
  cd extras
  mv ant-jmeter-1.0.9.jar.no ant-jmeter-1.0.9.jar
  mkdir -p classes
  cd classes
    %{jar_bin}  xf ../ant-jmeter-1.0.9.jar
    rm org/programmerplanet/ant/taskdefs/jmeter/*.class
  cd ..
  mkdir -p src
  cd src
    %{jar_bin}  xf ../ant-jmeter-1.0.9.jar
    rm org/programmerplanet/ant/taskdefs/jmeter/*.class
  cd ..
  rm -rf ant-jmeter-1.0.9.jar.no
  %{javac_bin} \
  -classpath CLASSPATH=$CLASSPATH:$(build-classpath ant) \
  -d classes \
  `find src -name '*.java'`
  %{jar_bin} cf ant-jmeter-1.0.9.jar -C classes .
  rm -rf classes src
  mkdir -p addons
#  export CLASSPATH=$CLASSPATH:$(build-classpath xalan-j2)
#  ant -f addons.xml -Djava.awt.headless=true -Djmeter.home=$JMETERHOME package
)

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

mkdir -p %{buildroot}%{_datadir}/jmeter/bin
install -m 644 bin/ApacheJMeter.jar %{buildroot}%{_datadir}/jmeter/bin/ApacheJMeter.jar
install -m 755 bin/jmeter %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/jmeter.sh %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/jmeter-report %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/jmeter-server %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/mirror-server.sh %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/shutdown.sh %{buildroot}%{_datadir}/jmeter/bin
install -m 755 bin/stoptest.sh %{buildroot}%{_datadir}/jmeter/bin

install -m 644 bin/BeanShellS*.bshrc %{buildroot}%{_datadir}/jmeter/bin
install -m 644 bin/httpclient.parameters %{buildroot}%{_datadir}/jmeter/bin

install -m 644 bin/*.properties %{buildroot}%{_datadir}/jmeter/bin
install -m 644 bin/log4j.conf %{buildroot}%{_datadir}/jmeter/bin

install -m 644 bin/*.xml %{buildroot}%{_datadir}/jmeter/bin
install -m 644 bin/*.dtd %{buildroot}%{_datadir}/jmeter/bin

mkdir -p %{buildroot}%{_datadir}/jmeter/bin/testfiles
cp -pr bin/testfiles/* %{buildroot}%{_datadir}/jmeter/bin/testfiles

mkdir -p %{buildroot}%{_datadir}/jmeter/bin/examples
cp -pr bin/examples/* %{buildroot}%{_datadir}/jmeter/bin/examples

mkdir -p %{buildroot}%{_datadir}/jmeter/extras
cp -pr extras/* %{buildroot}%{_datadir}/jmeter/extras/

mkdir -p %{buildroot}%{_javadir}/jmeter
mv %{buildroot}%{_datadir}/jmeter/extras/ant-jmeter-1.0.9.jar %{buildroot}%{_javadir}/jmeter/ant-jmeter-%{version}.jar
ln -sf %{_javadir}/jmeter/ant-jmeter-%{version}.jar %{buildroot}%{_datadir}/jmeter/extras/ant-jmeter-1.0.9.jar
install -m 644 lib/bshclient.jar %{buildroot}%{_javadir}/jmeter/bshclient-%{version}.jar
install -m 644 lib/jorphan.jar %{buildroot}%{_javadir}/jmeter/jorphan-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_core.jar %{buildroot}%{_javadir}/jmeter/core-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_components.jar %{buildroot}%{_javadir}/jmeter/components-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_functions.jar %{buildroot}%{_javadir}/jmeter/functions-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_http.jar %{buildroot}%{_javadir}/jmeter/http-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_ftp.jar %{buildroot}%{_javadir}/jmeter/ftp-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_jdbc.jar %{buildroot}%{_javadir}/jmeter/jdbc-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_java.jar %{buildroot}%{_javadir}/jmeter/java-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_junit.jar %{buildroot}%{_javadir}/jmeter/junit-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_report.jar %{buildroot}%{_javadir}/jmeter/report-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_ldap.jar %{buildroot}%{_javadir}/jmeter/ldap-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_mail.jar %{buildroot}%{_javadir}/jmeter/mail-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_tcp.jar %{buildroot}%{_javadir}/jmeter/tcp-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_monitors.jar %{buildroot}%{_javadir}/jmeter/monitors-%{version}.jar
install -m 644 lib/ext/ApacheJMeter_jms.jar %{buildroot}%{_javadir}/jmeter/jms-%{version}.jar
install -m 644 lib/junit/test.jar  %{buildroot}%{_javadir}/jmeter/woolfel-test-%{version}.jar

(
  cd %{buildroot}%{_javadir}/jmeter
  for jar in *-%{version}*; do
    ln -sf ${jar} ${jar/-%{version}/}
  done
)

mkdir -p %{buildroot}%{_datadir}/jmeter/lib/{ext,junit}
ln -sf %{_javadir}/jmeter/bshclient-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/bshclient.jar
ln -sf %{_javadir}/jmeter/jorphan-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/jorphan.jar
ln -sf %{_javadir}/jmeter/core-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_core.jar
ln -sf %{_javadir}/jmeter/components-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_components.jar
ln -sf %{_javadir}/jmeter/functions-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_functions.jar
ln -sf %{_javadir}/jmeter/http-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_http.jar
ln -sf %{_javadir}/jmeter/ftp-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_ftp.jar
ln -sf %{_javadir}/jmeter/jdbc-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_jdbc.jar
ln -sf %{_javadir}/jmeter/java-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_java.jar
ln -sf %{_javadir}/jmeter/junit-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_junit.jar
ln -sf %{_javadir}/jmeter/report-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_report.jar
ln -sf %{_javadir}/jmeter/ldap-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_ldap.jar
ln -sf %{_javadir}/jmeter/mail-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_mail.jar
ln -sf %{_javadir}/jmeter/tcp-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_tcp.jar
ln -sf %{_javadir}/jmeter/monitors-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_monitors.jar
ln -sf %{_javadir}/jmeter/jms-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/ext/ApacheJMeter_jms.jar
ln -sf %{_javadir}/jmeter/woolfel-test-%{version}.jar %{buildroot}%{_datadir}/jmeter/lib/junit/test.jar


#mkdir -p %{buildroot}%{_datadir}/jmeter/lib/api,opt}
mkdir -p %{buildroot}%{_datadir}/jmeter/lib/opt
ln -sf %{_javadir}/svnant.jar %{buildroot}%{_datadir}/jmeter/lib/opt/svnant.jar
ln -sf %{_javadir}/doccheck.jar %{buildroot}%{_datadir}/jmeter/lib/opt/doccheck.jar
ln -sf %{_javadir}/bsh2b5/bsh.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-2.0b5.jar
ln -sf %{_javadir}/bsh2b5/bsh-classpath.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-classpath.jar
ln -sf %{_javadir}/bsh2b5/bsh-commands.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-commands.jar
ln -sf %{_javadir}/bsh2b5/bsh-engine.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-engine.jar
ln -sf %{_javadir}/bsh2b5/bsh-core.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-core.jar
ln -sf %{_javadir}/bsh2b5/bsh-reflect.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-reflect.jar
ln -sf %{_javadir}/bsh2b5/bsh-util.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-util.jar
ln -sf %{_javadir}/bsh2b5/bsh-bsf.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-bsf.jar
ln -sf %{_javadir}/bsh2b5/bsh-classgen.jar %{buildroot}%{_datadir}/jmeter/lib/opt/bsh-classgen.jar
ln -sf %{_javadir}/glassfish-jaf.jar %{buildroot}%{_datadir}/jmeter/lib/activation-1.1.1.jar
ln -sf %{_javadir}/sun-mail-api.jar %{buildroot}%{_datadir}/jmeter/lib/mail-1.4.3.jar
ln -sf %{_javadir}/geronimo/activation-1.1-api.jar %{buildroot}%{_datadir}/jmeter/lib/geronimo-activation_1.1_spec-1.1.jar
ln -sf %{_javadir}/geronimo/javamail-1.4-api.jar %{buildroot}%{_datadir}/jmeter/lib/geronimo-javamail_1.4_mail-1.8.1.jar
ln -sf %{_javadir}/geronimo/jms-1.1-api.jar %{buildroot}%{_datadir}/jmeter/lib/geronimo-jms_1.1_spec-1.1.1.jar
ln -sf %{_javadir}/bsf24.jar %{buildroot}%{_datadir}/jmeter/lib/bsf-2.4.0.jar
ln -sf %{_javadir}/bsf3/api-%{version}.jar  %{buildroot}%{_datadir}/jmeter/lib/bsf-api-3.1.jar
ln -sf %{_javadir}/apache-commons-codec.jar %{buildroot}%{_datadir}/jmeter/lib/commons-codec-1.4.jar
ln -sf %{_javadir}/commons-collections.jar %{buildroot}%{_datadir}/jmeter/lib/commons-collections-3.2.1.jar
ln -sf %{_javadir}/commons-httpclient.jar %{buildroot}%{_datadir}/jmeter/lib/commons-httpclient-3.1.jar
ln -sf %{_javadir}/commons-io.jar %{buildroot}%{_datadir}/jmeter/lib/commons-io-1.4.jar
ln -sf %{_javadir}/commons-jexl.jar %{buildroot}%{_datadir}/jmeter/lib/commons-jexl-1.1.jar
ln -sf %{_javadir}/commons-lang24.jar %{buildroot}%{_datadir}/jmeter/lib/commons-lang-2.4.jar
ln -sf %{_javadir}/commons-logging.jar %{buildroot}%{_datadir}/jmeter/lib/commons-logging-1.1.1.jar
ln -sf %{_javadir}/commons-net.jar %{buildroot}%{_datadir}/jmeter/lib/commons-net-1.4.1.jar
ln -sf %{_javadir}/commons-cli-avalon.jar %{buildroot}%{_datadir}/jmeter/lib/commons-cli.jar
ln -sf %{_javadir}/excalibur/excalibur-datasource.jar %{buildroot}%{_datadir}/jmeter/lib/excalibur-datasource-1.1.1.jar
ln -sf %{_javadir}/excalibur/avalon-framework.jar %{buildroot}%{_datadir}/jmeter/lib/avalon-framework-4.1.4.jar
ln -sf %{_javadir}/excalibur/excalibur-instrument-api.jar %{buildroot}%{_datadir}/jmeter/lib/excalibur-instrument-1.0.jar
ln -sf %{_javadir}/excalibur/excalibur-logger.jar %{buildroot}%{_datadir}/jmeter/lib/excalibur-logger-1.1.jar
ln -sf %{_javadir}/excalibur/excalibur-pool-api.jar %{buildroot}%{_datadir}/jmeter/lib/excalibur-pool-1.2.jar
ln -sf %{_javadir}/excalibur/avalon-logkit.jar %{buildroot}%{_datadir}/jmeter/lib/logkit-2.0.jar
ln -sf %{_javadir}/htmllexer.jar %{buildroot}%{_datadir}/jmeter/lib/htmllexer-2.0-20060923.jar
ln -sf %{_javadir}/htmlparser.jar %{buildroot}%{_datadir}/jmeter/lib/htmlparser-2.0-20060923.jar
ln -sf %{_javadir}/oro.jar %{buildroot}%{_datadir}/jmeter/lib/oro-2.0.8.jar
ln -sf %{_javadir}/jcharts.jar %{buildroot}%{_datadir}/jmeter/lib/jCharts-0.7.5.jar
ln -sf %{_javadir}/jdom.jar %{buildroot}%{_datadir}/jmeter/lib/jdom-1.1.jar
ln -sf %{_javadir}/rhino.jar %{buildroot}%{_datadir}/jmeter/lib/js-1.6R5.jar
ln -sf %{_javadir}/junit48.jar %{buildroot}%{_datadir}/jmeter/lib/junit-4.8.1.jar
ln -sf %{_javadir}/ws-soap.jar %{buildroot}%{_datadir}/jmeter/lib/soap-2.3.1.jar
ln -sf %{_javadir}/jtidyr938.jar %{buildroot}%{_datadir}/jmeter/lib/jtidy-r938.jar
ln -sf %{_javadir}/xalan-j2.jar %{buildroot}%{_datadir}/jmeter/lib/xalan-2.7.1.jar
ln -sf %{_javadir}/xercesImpl.jar %{buildroot}%{_datadir}/jmeter/lib/xercesImpl-2.9.1.jar
ln -sf %{_javadir}/xerces-j2.jar %{buildroot}%{_datadir}/jmeter/lib/xml-apis-2_9_1.jar
ln -sf %{_javadir}/xml-commons-apis.jar %{buildroot}%{_datadir}/jmeter/lib/xml-apis-1.3.04.jar
ln -sf %{_javadir}/xalan-j2-serializer.jar %{buildroot}%{_datadir}/jmeter/lib/serializer-2.7.1.jar
ln -sf %{_javadir}/bcmail.jar %{buildroot}%{_datadir}/jmeter/lib/bcmail.jar
ln -sf %{_javadir}/bcprov.jar %{buildroot}%{_datadir}/jmeter/lib/bcprov.jar
ln -sf %{_javadir}/xmlgraphics-commons.jar %{buildroot}%{_datadir}/jmeter/lib/xmlgraphics-commons-1.3.1.jar
ln -sf %{_javadir}/xpp3-minimal.jar %{buildroot}%{_datadir}/jmeter/lib/xpp3_min-1.1.4c.jar
ln -sf %{_javadir}/xstream.jar %{buildroot}%{_datadir}/jmeter/lib/xstream-1.3.1.jar

mkdir -p %{buildroot}%{_datadir}/jmeter/printable_docs
cp -pr printable_docs/* %{buildroot}%{_datadir}/jmeter/printable_docs

mkdir -p %{buildroot}%{_javadocdir}/jmeter-%{version}
cp -pr docs/api/* %{buildroot}%{_javadocdir}/jmeter-%{version}
ln -sf jmeter-%{version} %{buildroot}%{_javadocdir}/jmeter
rm -rf docs/api

mkdir -p %{buildroot}%{_docdir}/jmeter
cp -pr docs/* %{buildroot}%{_docdir}/jmeter
install -m 644 LICENSE %{buildroot}%{_docdir}/jmeter
install -m 644 NOTICE %{buildroot}%{_docdir}/jmeter
install -m 644 README %{buildroot}%{_docdir}/jmeter
install -m 644 STATUS %{buildroot}%{_docdir}/jmeter

ln -sf %{_javadocdir}/jmeter %{buildroot}%{_docdir}/jmeter/api
ln -sf %{_docdir}/jmeter %{buildroot}%{_datadir}/jmeter/docs

mkdir -p %{buildroot}%{_bindir}
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/jmeter

for png in 16 22 24 32 48 64 128; do
	mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${png}x${png}/apps/
	convert -geometry ${png}x${png} %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/${png}x${png}/apps/jmeter.png
done

mkdir -p %{buildroot}%{_datadir}/pixmaps
convert -geometry ${png}x${png} %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/jmeter.png

cat > jmeter.desktop << __GIL
[Desktop Entry]
Encoding=UTF-8
Name=JMeter
Comment=Load testing application
GenericName=JMeter: Load testing application
Exec=jmeter
Icon=jmeter
Terminal=false
Type=Application
StartupNotify=true
Categories=X-JPackage;Java;Development;
__GIL

mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --mode=644 --dir %{buildroot}%{_datadir}/applications jmeter.desktop

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

%post
%{_bindir}/update-desktop-database -q %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor

%postun
if [ $1 -eq 0 ]; then
	touch --no-create %{_datadir}/icons/hicolor
	%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
fi

%posttrans
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :

%files
%defattr(-,root,root)
%attr(755, root, root) %{_bindir}/jmeter
%{_datadir}/applications/jmeter.desktop
%{_datadir}/icons/hicolor/*x*/apps/jmeter.png
%{_datadir}/pixmaps/jmeter.png
%{_javadir}/jmeter/ant-jmeter-%{version}.jar
%{_javadir}/jmeter/ant-jmeter.jar
%{_javadir}/jmeter/bshclient-%{version}.jar
%{_javadir}/jmeter/bshclient.jar
%{_javadir}/jmeter/components-%{version}.jar
%{_javadir}/jmeter/components.jar
%{_javadir}/jmeter/core-%{version}.jar
%{_javadir}/jmeter/core.jar
%{_javadir}/jmeter/ftp-%{version}.jar
%{_javadir}/jmeter/ftp.jar
%{_javadir}/jmeter/functions-%{version}.jar
%{_javadir}/jmeter/functions.jar
%{_javadir}/jmeter/http-%{version}.jar
%{_javadir}/jmeter/http.jar
%{_javadir}/jmeter/java-%{version}.jar
%{_javadir}/jmeter/java.jar
%{_javadir}/jmeter/jdbc-%{version}.jar
%{_javadir}/jmeter/jdbc.jar
%{_javadir}/jmeter/jms-%{version}.jar
%{_javadir}/jmeter/jms.jar
%{_javadir}/jmeter/jorphan-%{version}.jar
%{_javadir}/jmeter/jorphan.jar
%{_javadir}/jmeter/junit-%{version}.jar
%{_javadir}/jmeter/junit.jar
%{_javadir}/jmeter/ldap-%{version}.jar
%{_javadir}/jmeter/ldap.jar
%{_javadir}/jmeter/mail-%{version}.jar
%{_javadir}/jmeter/mail.jar
%{_javadir}/jmeter/monitors-%{version}.jar
%{_javadir}/jmeter/monitors.jar
%{_javadir}/jmeter/report-%{version}.jar
%{_javadir}/jmeter/report.jar
%{_javadir}/jmeter/tcp-%{version}.jar
%{_javadir}/jmeter/tcp.jar
%{_javadir}/jmeter/woolfel-test-%{version}.jar
%{_javadir}/jmeter/woolfel-test.jar
%dir %{_docdir}/jmeter
%{_docdir}/jmeter/LICENSE
%{_docdir}/jmeter/NOTICE
%{_docdir}/jmeter/README
%{_docdir}/jmeter/STATUS
%{_docdir}/jmeter/usermanual
%dir %{_datadir}/jmeter
%{_datadir}/jmeter/printable_docs
%{_datadir}/jmeter/bin
%{_datadir}/jmeter/lib
%{_datadir}/jmeter/extras
%dir %{_datadir}/jmeter/extras/addons

%files javadoc
%defattr(-,root,root)
%{_docdir}/jmeter/api
%{_javadocdir}/jmeter-%{version}
%{_javadocdir}/jmeter

%files manual
%defattr(-,root,root)
%{_datadir}/jmeter/docs
%{_docdir}/jmeter/*.html
%{_docdir}/jmeter/css
%{_docdir}/jmeter/demos
%{_docdir}/jmeter/extending
%{_docdir}/jmeter/images
%{_docdir}/jmeter/localising

%changelog
* Fri Dec 31 2010 gil <puntogil@...> 2.4-2mamba
- rebuilt with java-bsh2b5 support

* Fri Dec 10 2010 gil <puntogil@...> 2.4-1mamba
- update to 2.4

* Sat Oct 03 2009 gil <puntogil@...> 2.3.4-1mamba
- package created by autospec