packages apache-tomcat-connectors.spec
      Pages: < 1 >  DOWNLOAD      
Name:          apache-tomcat-connectors
Version:       1.2.31
Release:       1mamba
Summary:       The Apache Tomcat Web-Servers Connector
Group:         System/Libraries
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://tomcat.apache.org/connectors-doc/
Source0:       http://apache.panu.it/tomcat/tomcat-connectors/jk/source/jk-%{version}/tomcat-connectors-%{version}-src.tar.gz
Source1:       apache-tomcat-connectors-jkstatus-ant-1.2.30.pom
License:       Apache Software License Version 2.0
BuildRequires: apache-ant
BuildRequires: apache-devel
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-modeler
BuildRequires: jpackage-utils
BuildRequires: libtomcat5-server
BuildRequires: perl-GD
BuildRequires: perl-GD-Graph
BuildRequires: perl-Statistics-Descriptive
BuildRequires: sun-java
Requires:      apache
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

#configure: WARNING: ===========================================
#configure: WARNING: You have used one of the following options:
#configure: WARNING:     --enable-jni
#configure: WARNING:     --with-java-home
#configure: WARNING:     --with-java-platform
#configure: WARNING:     --with-os-type
#configure: WARNING: These options are only necessary if
#configure: WARNING: you want to use a worker of type jni.
#configure: WARNING: These workers have been deprecated.
#configure: WARNING: They do not work and will be removed from
#configure: WARNING: a future release
#configure: WARNING: ===========================================

%description
Tomcat Connectors is a new project to release web-servers connector
for the Tomcat servlet engine.

%package manual
Group:          Documentation
Summary:        Documentation for Tomcat Connectors

%description manual
Tomcat Connectors is a new project to release web-servers connector
for the Tomcat servlet engine.

This package contains documentation for Tomcat Connectors.

%package scripts
Group:         System/Tools
Summary:       Perl scripts for %{name}
Requires:      perl
Requires:      perl-GD
Requires:      perl-GD-Graph
Requires:      perl-Statistics-Descriptive

%description scripts
Tomcat Connectors is a new project to release web-servers connector
for the Tomcat servlet engine.

This package contains perl scripts which can be used to generate
statistics for tomcat requests and errors logged by mod_jk.

jkstatus

%package jkstatus
Group:         Development/Libraries/Java
Summary:       Libraries needed to run the Tomcat Web container (part)
Requires:      apache-tomcat5
Requires:      jpackage-utils

%description jkstatus
Libraries needed to run the Tomcat Web container (part)

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

%description jkstatus-javadoc
Libraries needed to run the Tomcat Web container (part)

This package contains javadoc for %{name}-jkstatus.

%prep

%setup -q -n tomcat-connectors-%{version}-src

%build


export JAVA_HOME=/usr/lib/jvm/jdk-sun

# -2.0.1.jar
pushd jkstatus
mkdir tomcat5
cat > build.properties  << GIL
compile.debug=on
compile.deprecation=off
compile.optimize=off
catalina.build=$PWD/tomcat5
commons-modeler.jar=$(build-classpath commons-modeler)
commons-logging.jar=$(build-classpath commons-logging-api)
GIL
cat > build.properties.default  << GIL
compile.debug=on
compile.deprecation=off
compile.optimize=off
catalina.build=$PWD/tomcat5
commons-modeler.jar=$(build-classpath commons-modeler)
commons-logging.jar=$(build-classpath commons-logging-api)
GIL
	export CLASSPATH=$(build-classpath commons-logging-api commons-modeler tomcat5/catalina catalina-ant5 tomcat5/tomcat-util)
	ant \
		-Djdk.1.3.present=true \
		-Djdk.1.4.present=true \
		dist javadoc
popd

export LDFLAGS="-lc"
pushd native
	sh buildconf.sh
	%configure \
		--with-apxs=%{_sbindir}/apxs \
		--enable-EAPI
	%make
popd



cd xdocs
ant \
	all
# dist >> war file
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_sysconfdir}/httpd/extra
install -m 644 conf/httpd-jk.conf %{buildroot}%{_sysconfdir}/httpd/extra

pushd native
	mkdir -p %{buildroot}%{_libdir}/apache
	install -m 755 apache-2.0/mod_jk.so %{buildroot}%{_libdir}/apache/mod_jk.so
popd

mkdir -p %{buildroot}%{_bindir}/
install -m 755 tools/reports/tomcat_reports.pl %{buildroot}%{_bindir}/tomcat_reports
install -m 755 tools/reports/tomcat_trend.pl %{buildroot}%{_bindir}/tomcat_trend
sed -i "s|#!/usr/local/bin/perl|#!%{__perl}|" %{buildroot}%{_bindir}/tomcat_*

mkdir -p %{buildroot}%{_bindir}/
install -m 755 tools/reports/tomcat_reports.pl %{buildroot}%{_bindir}/tomcat_reports
install -m 755 tools/reports/tomcat_trend.pl %{buildroot}%{_bindir}/tomcat_trend
sed -i "s|#!/usr/local/bin/perl|#!%{__perl}|" %{buildroot}%{_bindir}/tomcat_*

mkdir -p %{buildroot}%{_sysconfdir}/tomcat5
mkdir -p %{buildroot}%{_datadir}/tomcat5/bin
install -m 644 conf/uriworkermap.properties %{buildroot}%{_sysconfdir}/tomcat5/uriworkermap.properties
install -m 644 conf/workers.properties %{buildroot}%{_sysconfdir}/tomcat5/workers.properties
install -m 644 conf/workers.properties.minimal %{buildroot}%{_sysconfdir}/tomcat5/workers.properties.minimal
install -m 644 jkstatus/conf/jkstatus-tasks.xml %{buildroot}%{_datadir}/tomcat5/bin/jkstatus-tasks.xml

mkdir -p %{buildroot}%{_javadir}/tomcat5
install -m 644 jkstatus/dist/tomcat-jkstatus-ant.jar %{buildroot}%{_javadir}/tomcat5/tomcat-jkstatus-ant-%{version}.jar

mkdir -p %{buildroot}%{_datadir}/maven2/poms
%add_to_maven_depmap tomcat tomcat-jkstatus-ant %{version} JPP tomcat-jkstatus-ant
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP.tomcat5-tomcat-jkstatus-ant.pom

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

mkdir -p %{buildroot}%{_javadocdir}/jkstatus-%{version}
cp -pr jkstatus/build/javadoc/* %{buildroot}%{_javadocdir}/jkstatus-%{version}
ln -s jkstatus-%{version} %{buildroot}%{_javadocdir}/jkstatus

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

%post
if [ $1 -eq 1 ]; then
   apxs -e -a -n jk %{_libdir}/apache/mod_jk.so > /dev/null
   %{_initrddir}/httpd condrestart
fi
:

%postun
if [ $1 -eq 0 ]; then
   sed -i "/mod_jk.so/d" %{_sysconfdir}/httpd/httpd.conf
   %{_initrddir}/httpd condrestart
fi
:

%files
%defattr(-,root,root)
%{_sysconfdir}/httpd/extra/httpd-jk.conf
%{_libdir}/apache/mod_jk.so
%doc LICENSE

%files manual
%defattr(-,root,root)
%doc build/docs/* jkstatus/example

%files scripts
%defattr(-,root,root)
%{_bindir}/tomcat_reports
%{_bindir}/tomcat_trend
%doc tools/reports/README.txt

%post jkstatus
%update_maven_depmap
rm -f %{_datadir}/tomcat5/server/lib/[tomcat5][tomcat-jkstatus-ant].jar 2>&1
rm -f %{_var}/lib/tomcat5/server/lib/[tomcat5][tomcat-jkstatus-ant].jar 2>&1
build-jar-repository %{_var}/lib/tomcat5/server/lib tomcat5/tomcat-jkstatus-ant 2>&1

%postun jkstatus
%update_maven_depmap

%preun
if [ $1 = 0 ]; then
	rm -f %{_var}/lib/tomcat5/server/lib/[tomcat5][tomcat-jkstatus-ant].jar 2>&1
fi

%files jkstatus
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/tomcat5/uriworkermap.properties
%config(noreplace) %{_sysconfdir}/tomcat5/workers.properties
%config(noreplace) %{_sysconfdir}/tomcat5/workers.properties.minimal
%attr(0644,root,root) %{_datadir}/tomcat5/bin/jkstatus-tasks.xml
%{_javadir}/tomcat5/tomcat-jkstatus-ant-%{version}.jar
%{_javadir}/tomcat5/tomcat-jkstatus-ant.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}/*

%files jkstatus-javadoc
%defattr(-,root,root)
%{_javadocdir}/jkstatus-%{version}
%{_javadocdir}/jkstatus

%changelog
* Sun Dec 12 2010 gil <puntogil@...> 1.2.31-1mamba
- update to 1.2.31

* Sat Mar 06 2010 gil <puntogil@...> 1.2.30-1mamba
- first build