File tomcat-7070.spec of Package tomcat7

%define version		7.0.70
%define vers		7070
%define shortvers	7
%define pkgname		tomcat

%define prefix		/usr/share/tomcat

%define _unpackaged_files_terminate_build 0


%define srcdir /usr/src/packages/BUILD/apache-tomcat-%{version}

%define appdir /srv/%{pkgname}
%define confdir %{_sysconfdir}/%{pkgname}
%define libdir %{_javadir}/%{pkgname}
%define logdir %{_localstatedir}/log/%{pkgname}
%define cachedir %{_localstatedir}/cache/%{pkgname}
%define tempdir %{cachedir}/
%define workdir %{cachedir}/

Name:           	tomcat%{shortvers}
Summary:        	Apache Tomcat V%{version}
License:        	The Apache Software License
Group:          	Productivity/Networking/Web/Servers
Version:        	%{version}
Release:        	1.1
Source:			apache-tomcat-%{version}.tar.gz
Url:            	http://tomcat.apache.org/
BuildArch:              noarch
BuildRoot:      	%{_tmppath}/%{pkgname}-%{version}-build

# needed for brp-check-bytecode-version (jar, fastjar would do as well)  
BuildRequires:          unzip tar
#BuildRequires: java-1_7_0-openjdk

%description
Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project. To learn more about getting involved, click here.

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.

Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat project logo are trademarks of the Apache Software Foundation.


%prep
%setup -q -n apache-tomcat-%{version}

%build
 
%install
   test -d "%{buildroot}%{prefix}" || mkdir -p "%{buildroot}%{prefix}"
   cp -a bin %{buildroot}%{prefix}

   test -d "%{buildroot}%{confdir}" || mkdir -p "%{buildroot}%{confdir}" 
pushd conf
   cp -a * %{buildroot}%{confdir}
popd

   test -d "%{buildroot}%{libdir}" || mkdir -p "%{buildroot}%{libdir}" 
   cp -a lib %{buildroot}%{libdir}

   test -d "%{buildroot}%{logdir}" || mkdir -p "%{buildroot}%{logdir}" 

   test -d "%{buildroot}%{tempdir}" || mkdir -p "%{buildroot}%{tempdir}" 
   cp -a temp %{buildroot}%{tempdir}

   test -d "%{buildroot}%{appdir}" || mkdir -p "%{buildroot}%{appdir}" 
pushd webapps
   cp -a * %{buildroot}%{appdir}
popd

   test -d "%{buildroot}%{workdir}" || mkdir -p "%{buildroot}%{workdir}" 
   cp -a work %{buildroot}%{workdir}

pushd %{buildroot}%{prefix}
    %{__ln_s} %{appdir} webapps 
    %{__ln_s} %{confdir} conf
    %{__ln_s} %{libdir} lib
    %{__ln_s} %{logdir} logs
    %{__ln_s} %{tempdir}temp temp
    %{__ln_s} %{workdir}work work
popd

chmod 755 %{buildroot}%{confdir}/* 


%post


%files
%defattr(-,root,root)  
%doc LICENSE NOTICE RELEASE-NOTES RUNNING.txt

%dir %{prefix} 
%{prefix}/bin
%{prefix}/conf
%{prefix}/lib
%{prefix}/logs
%{prefix}/temp
%{prefix}/webapps
%{prefix}/work