]> git.pld-linux.org Git - projects/template-specs.git/blame - java-webapp.spec
- really stop including rpm macros everywhere
[projects/template-specs.git] / java-webapp.spec
CommitLineData
48e66987 1Summary: -
2Summary(pl.UTF-8): -
3Name: -
4Version: -
5Release: 0.1
6License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
7Group: Networking/Daemons/Java/Servlets
8Source0: -
9# Source0-md5: -
10Source1: %{name}-context.xml
11URL: -
12BuildRequires: rpm-javaprov
13BuildRequires: rpmbuild(macros) >= 1.546
14Requires: jpackage-utils
15Requires: tomcat >= 6
16BuildArch: noarch
17BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19%define webappdir %{_datadir}/%{name}
20%define libdir %{_datadir}/%{name}/WEB-INF/lib
21%define logdir %{_var}/log/%{name}
22
23%description
24
25%description subpackage -l pl.UTF-8
26
27%prep
28%setup -q
29
30#%%undos build.xml
31
32%build
33
34export JAVA_HOME="%{java_home}"
35
36required_jars="jaxp_parser_impl"
37CLASSPATH=$(build-classpath $required_jars)
38export CLASSPATH
39
40export LC_ALL=en_US # source code not US-ASCII
41
42%ant
43
44%{__make}
45
46# configure logdir
47# sed -i 's,^\(log4j.appender.logfile.File=\)cas.log$,\1%{logdir}/%{name}.log,' webapp/WEB-INF/classes/log4j.properties
48
49%install
50rm -rf $RPM_BUILD_ROOT
51install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_datadir},%{_sharedstatedir}/%{name},%{_tomcatconfdir},%{logdir}}
52
53# Copy content of web application (i.e. unpacked .war file) to webappdir
54cp -a webapp $RPM_BUILD_ROOT%{webappdir}
55
56# Install configuration files into /etc
57CONFIGFILES="
58 classes/log4j.properties
59 %{name}.properties
60 web.xml
61"
62
63for i in $CONFIGFILES; do
64 mv $RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$(basename $i)
65 ln -s %{_sysconfdir}/%{name}/$(basename $i) $RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i
66done
67
68# Install tomcat context descriptor
69install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/tomcat-context.xml
70ln -sf %{_sysconfdir}/%{name}/tomcat-context.xml $RPM_BUILD_ROOT%{_tomcatconfdir}/%{name}.xml
71
72%postun
73%tomcat_clear_cache %{name}
74
75%clean
76rm -rf $RPM_BUILD_ROOT
77
78%files
79%defattr(644,root,root,755)
cbc1b81f 80%dir %{_sysconfdir}/%{name}
81%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.xml
82%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.properties
25a8688d 83%config(missingok) %{_tomcatconfdir}/%{name}.xml
48e66987 84%{webappdir}
85%attr(2775,root,servlet) %dir %{_sharedstatedir}/%{name}
86%dir %attr(2770,root,servlet) %{logdir}
This page took 0.993351 seconds and 4 git commands to generate.