Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > b810f313c3cd61f5fa6aa35502cfc96a > files > 5

struts-1.2.7-1.1mdk.src.rpm

%define gcj_support	0
%define name		struts
%define full_name	jakarta-%{name}
%define version		1.2.7
%define release		1.1mdk
%define _localstatedir	%{_var}
%define tomcat5appsdir  %{_localstatedir}/lib/tomcat5/webapps
%define tomcat5ctxdir   %{_sysconfdir}/tomcat5/Catalina/localhost
%define section		free
%define webapps		blank documentation example examples tiles-documentation
%define webapplibs commons-beanutils commons-digester commons-fileupload commons-validator oro struts

Name:		%{name}
Version:	%{version}
Release:	%{release}
Epoch:		0
Summary:	Web application framework
License:	Apache License
Group:          Development/Libraries/Java
Source0:	%{name}-%{version}-src.tar.bz2
Source2:	tomcat4-context-allowlinking.xml
Source3:	tomcat5-context-allowlinking.xml
Patch0:		%{name}-%{version}.build.patch.bz2
Patch1:		%{name}-1.2.4.bz157205.patch.bz2
Patch2:         %{name}-1.2.7-noclasspath.patch.bz2
Url:		http://jakarta.apache.org/%{name}
Requires:	servletapi5
Requires:	jdbc-stdext
Requires:	jakarta-commons-beanutils >= 0:1.7.0
Requires:	jakarta-commons-digester >= 0:1.6
Requires:	jakarta-commons-fileupload >= 0:1.0
Requires:	jakarta-commons-logging >= 0:1.0.4
Requires:	jakarta-commons-validator >= 0:1.1.4
Requires:	oro >= 0:2.0.7
BuildRequires:	jpackage-utils >= 1.5
BuildRequires:	ant >= 1.6.1
BuildRequires:	antlr >= 2.7.2
BuildRequires:	ant-trax
BuildRequires:	ant-nodeps
BuildRequires:	jaxp_transform_impl
BuildRequires:	sed
BuildRequires:	servletapi5
BuildRequires:	jdbc-stdext
BuildRequires:  jakarta-commons-beanutils >= 0:1.7.0
BuildRequires:  jakarta-commons-digester >= 0:1.6
BuildRequires:  jakarta-commons-fileupload >= 0:1.0
BuildRequires:  jakarta-commons-logging >= 0:1.0.4
BuildRequires:  jakarta-commons-validator >= 0:1.1.4
BuildRequires:  oro >= 0:2.0.7
Group:		Development/Java
Buildroot:	%{_tmppath}/%{name}-%{version}-buildroot
# libgcj aot-compiled native libraries
%if %{gcj_support}
BuildRequires:    java-gcj-compat-devel >= 1.0.35
Requires(post):   java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%else
BuildArch:	noarch
%endif

%description
Welcome to the Struts Framework! The goal of this project is to provide
an open source framework useful in building web applications with Java
Servlet and JavaServer Pages (JSP) technology. Struts encourages
application architectures based on the Model-View-Controller (MVC)
design paradigm, colloquially known as Model 2 in discussions on various
servlet and JSP related mailing lists.
Struts includes the following primary areas of functionality:
A controller servlet that dispatches requests to appropriate Action
classes provided by the application developer.
JSP custom tag libraries, and associated support in the controller
servlet, that assists developers in creating interactive form-based
applications.
Utility classes to support XML parsing, automatic population of
JavaBeans properties based on the Java reflection APIs, and
internationalization of prompts and messages.
Struts is part of the Jakarta Project, sponsored by the Apache Software
Foundation. The official Struts home page is at
http://jakarta.apache.org/struts.

%package manual
Summary:        Manual for %{name}
Group:          Development/Java

%description manual
Documentation for %{name}.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Java

%description javadoc
Javadoc for %{name}.

%package webapps-tomcat5
Summary:        Sample %{name} webapps for tomcat5
Group:          Development/Java
Requires:       %{name} = %{version}-%{release}
Requires:       tomcat5
%if %{gcj_support}
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%endif

%description webapps-tomcat5
Sample %{name} webapps for tomcat5.


%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{name}-%{version}-src -q
%patch0
%patch1 -p1
%patch2 -p1
# remove all binary libs
find . -name "*.class" -exec rm -f {} \;
find . -name "*.jar" -exec rm -f {} \;
find . -name "*.war" -exec rm -f {} \;

%build

# build struts
%ant -Dlibdir=%{_javadir} \
        -Dcommons-beanutils.jar=$(build-classpath commons-beanutils) \
        -Dcommons-digester.jar=$(build-classpath commons-digester) \
        -Dcommons-fileupload.jar=$(build-classpath commons-fileupload) \
        -Dcommons-logging.jar=$(build-classpath commons-logging) \
        -Dcommons-validator.jar=$(build-classpath commons-validator) \
        -Djakarta-oro.jar=$(build-classpath oro) \
        -Djdbc20ext.jar=$(find-jar jdbc-stdext) \
        -Djsp.jar=$(build-classpath jspapi) \
        -Dservlet.jar=$(build-classpath servletapi5) \
        -Dantlr.jar=$(build-classpath antlr) \
         compile.library compile.webapps compile.javadoc

%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 target/library/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr target/documentation/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
rm -rf target/documentation/api
# data
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 target/library/*.tld $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 target/library/*.dtd $RPM_BUILD_ROOT%{_datadir}/%{name}

# tomcat 5 webapps
install -d -m 755 $RPM_BUILD_ROOT%{tomcat5appsdir}
install -d -m 755 $RPM_BUILD_ROOT%{tomcat5ctxdir}
for webapp in %{webapps}; do
    cp -pr target/$webapp $RPM_BUILD_ROOT%{tomcat5appsdir}/%{name}-$webapp
    cat %{SOURCE3} | sed -e "s/@@@APPNAME@@@/$webapp/g;" > $RPM_BUILD_ROOT%{tomcat5ctxdir}/%{name}-$webapp.xml
	# XXX: move to %%post/preun
	for jar in %{webapplibs}; do
        (cd $RPM_BUILD_ROOT%{tomcat5appsdir}/%{name}-$webapp/WEB-INF/lib \
        && ln -sf ../../../../../../..%{_javadir}/$jar.jar .)
    done
    (cd $RPM_BUILD_ROOT%{tomcat5appsdir}/%{name}-$webapp/WEB-INF \
    && for tld in ../../../../../..%{_datadir}/%{name}/*.tld; do ln -sf $tld `basename $tld`; done)
done

%{__perl} -pi -e 's|\r$||g' \
  README LICENSE.txt NOTICE.txt STATUS.txt INSTALL target/documentation/uml/Credits.html
find $RPM_BUILD_ROOT -name download.cgi | xargs %{__chmod} 755
find $RPM_BUILD_ROOT -name download.cgi | xargs %{__perl} -pi -e 's|\r$||g'

%if %{gcj_support}
aot-compile-rpm

%post
%{_bindir}/rebuild-gcj-db

%postun
%{_bindir}/rebuild-gcj-db

%post webapps-tomcat5
%{_bindir}/rebuild-gcj-db

%postun webapps-tomcat5
%{_bindir}/rebuild-gcj-db
%endif


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc INSTALL LICENSE.txt README NOTICE.txt STATUS.txt
%{_javadir}/*
%{_datadir}/%{name}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif

%files manual
%defattr(-,root,root)
%doc target/documentation/*.html
%doc target/documentation/*.gif
%doc target/documentation/uml
%doc target/documentation/userGuide
%doc target/documentation/images

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

%files webapps-tomcat5
%defattr(-,tomcat,tomcat)
%dir %{tomcat5appsdir}/%{name}-blank
%{tomcat5appsdir}/%{name}-blank/*
%dir %{tomcat5appsdir}/%{name}-documentation
%{tomcat5appsdir}/%{name}-documentation/*
%dir %{tomcat5appsdir}/%{name}-example
%{tomcat5appsdir}/%{name}-example/*
%dir %{tomcat5appsdir}/%{name}-examples
%{tomcat5appsdir}/%{name}-examples/*
%dir %{tomcat5appsdir}/%{name}-tiles-documentation
%{tomcat5appsdir}/%{name}-tiles-documentation/*
%config(noreplace) %{tomcat5ctxdir}/%{name}-*.xml
%if %{gcj_support}
%attr(-,root,root) %{_libdir}/gcj/%{name}/*classes.jar.*
%endif

%changelog
* Wed Aug 17 2005 David Walluck <walluck@mandriva.org> 0:1.2.7-1.1mdk
- 1.2.7
- add conditional %%gcj_support

* Fri Jul 22 2005 Gary Benson <gbenson@redhat.com> - 0:1.2.4-2jpp_3fc
- Remove workarounds for #163689.

* Wed Jul 20 2005 Gary Benson <gbenson@redhat.com> - 0:1.2.4-2jpp_2fc
- Build on ia64, ppc64, s390 and s390x.
- Switch to aot-compile-rpm (also BC-compiles webapps).

* Wed Jun 15 2005 Gary Benson <gbenson@redhat.com> - 0:1.2.4-2jpp_1fc
- Make workaround for #157205 specific to libgcj.

* Tue Jun 14 2005 Gary Benson <gbenson@redhat.com>
- Remove jars, wars and classes from the tarball.

* Fri May 27 2005 Gary Benson <gbenson@redhat.com> - 0:1.2.4-2jpp
- Build with servletapi5.
- Add build dependency on ant-nodeps.

* Fri May 27 2005 Gary Benson <gbenson@redhat.com> - 0:1.2.4-1jpp_1fc
- Build into Fedora.

* Tue Feb  1 2005 Joe Orton <jorton@redhat.com>
- Change webapps subpackages' tomcat dependencies to prereqs.

* Fri Nov 26 2004 Fernando Nasser <fnasser@redhat.com> - 0:1.2.4-1jpp
- Upgrade to 1.2.4

* Sat Sep 04 2004 Fernando Nasser <fnasser@redhat.com> - 0:1.1-3jpp
- Rebuilt with Ant 1.6.2

* Sat Jan 10 2004 Kaj J. Niemi <kajtzu@fi.basen.net> - 0:1.1-2jpp
- Fixed runtime requires
- Fix examples by making symlinks work in their respective (sub-)directories,
  the template comes for tomcat4 from Source #2 and for tomcat5 from Source #3

* Fri Jan  9 2004 Kaj J. Niemi <kajtzu@fi.basen.net> - 0:1.1-1jpp
- Updated to 1.1
- Use tomcat4 real webapps dir instead of -compat provided app dir
- To compile against < JDK 1.4 jdkmajorver needs to be set to 1.3

* Tue Mar 25 2003 Nicolas Mailhot <Nicolas.Mailhot (at) JPackage.org> 1.0.2-4jpp
- for jpackage-utils 1.5

* Thu Mar 28 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0.2-3jpp 
- fixed incorrect files in manual package

* Wed Mar 27 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0.2-2jpp 
- corrected URL
- cleaned webapps
- tagged webapps

* Sun Mar 24 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0.2-1jpp 
- 1.0.2
- generic servlet support
- distinct webapps for tomcat3 and tomcat4
- no duplicate files for webapps
- correct file ownership for webapps

* Wed Jan 23 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0-4jpp
- section macro
- versioned dir for javadoc
- no dependencies for manual and javadoc packages
- stricter dependencies for webapp package
- requires tomcat3
- no more requires servlet3 as tomcat3 requires it
- requires and buildrequires xalan-j2 >= 2.2.0
- adaptation to new servlet3 package
- adaptation to new xalan-j2 package
- adapation to new tomcat3 package
- uncompressed webapps

* Wed Dec 5 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0-3jpp
- javadoc into javadoc package

* Tue Nov 20 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.0-2jpp
- removed packager tag
- new jpp extension
- added xalan 2.2.D13 support

* Thu Nov 1 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.0-1jpp
- first JPackage release