Author: pawelz                       Date: Wed Mar 24 13:28:57 2010 GMT
Module: template-specs                Tag: HEAD
---- Log message:
- new

---- Files affected:
template-specs:
   java-webapp.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: template-specs/java-webapp.spec
diff -u /dev/null template-specs/java-webapp.spec:1.1
--- /dev/null   Wed Mar 24 14:28:57 2010
+++ template-specs/java-webapp.spec     Wed Mar 24 14:28:51 2010
@@ -0,0 +1,96 @@
+# $Revision$, $Date$
+%include       /usr/lib/rpm/macros.java
+Summary:       -
+Summary(pl.UTF-8):     -
+Name:          -
+Version:       -
+Release:       0.1
+License:       - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name 
here)
+Group:         Networking/Daemons/Java/Servlets
+Source0:       -
+# Source0-md5: -
+Source1:       %{name}-context.xml
+URL:           -
+BuildRequires: rpm-javaprov
+BuildRequires: rpmbuild(macros) >= 1.546
+Requires:      jpackage-utils
+Requires:      tomcat >= 6
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define webappdir %{_datadir}/%{name}
+%define libdir    %{_datadir}/%{name}/WEB-INF/lib
+%define        logdir    %{_var}/log/%{name}
+
+%description
+
+%description subpackage -l pl.UTF-8
+
+%prep
+%setup -q
+
+#%%undos build.xml
+
+%build
+
+export JAVA_HOME="%{java_home}"
+
+required_jars="jaxp_parser_impl"
+CLASSPATH=$(build-classpath $required_jars)
+export CLASSPATH
+
+export LC_ALL=en_US # source code not US-ASCII
+
+%ant
+
+%{__make}
+
+# configure logdir
+# sed -i 
's,^\(log4j.appender.logfile.File=\)cas.log$,\1%{logdir}/%{name}.log,' 
webapp/WEB-INF/classes/log4j.properties
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d 
$RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_datadir},%{_sharedstatedir}/%{name},%{_tomcatconfdir},%{logdir}}
+
+# Copy content of web application (i.e. unpacked .war file) to webappdir
+cp -a webapp $RPM_BUILD_ROOT%{webappdir}
+
+# Install configuration files into /etc
+CONFIGFILES="
+  classes/log4j.properties
+  %{name}.properties
+  web.xml
+"
+
+for i in $CONFIGFILES; do
+  mv $RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i 
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$(basename $i)
+  ln -s %{_sysconfdir}/%{name}/$(basename $i) 
$RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i
+done
+
+# Install tomcat context descriptor
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/tomcat-context.xml
+ln -sf %{_sysconfdir}/%{name}/tomcat-context.xml 
$RPM_BUILD_ROOT%{_tomcatconfdir}/%{name}.xml
+
+%postun
+%tomcat_clear_cache %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}
+%{_tomcatconfdir}/%{name}.xml
+%{webappdir}
+%attr(2775,root,servlet) %dir %{_sharedstatedir}/%{name}
+%dir %attr(2770,root,servlet) %{logdir}
+
+%define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <[email protected]>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2010/03/24 13:28:51  pawelz
+- new
+
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to