]> git.pld-linux.org Git - packages/jenkins.git/commitdiff
- deploy hudson in tomcat
authorpawelz <pawelz@pld-linux.org>
Mon, 26 Jan 2009 09:05:16 +0000 (09:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- is this a correct way to package .war apps? Please comment. It works
  out-of-the-box. If you have apache-tomcat installed, you can just
  rpm -ivh hudson and it works.

Changed files:
    jenkins.spec -> 1.3

jenkins.spec

index c69944d624c7a3d9bcadd5d44ac6383174543de1..a651a6cedd40b6d198aa027bc966b4ad063bdeaf 100644 (file)
@@ -9,10 +9,13 @@ License:      MIT License
 Group:         Development/Languages/Java
 Source0:       https://hudson.dev.java.net/files/documents/2402/124475/%{name}.war
 # Source0-md5: 223788eb7fd27ba970daf8e06053f356
+Source1:       %{name}-web.xml
+Source2:       %{name}-context.xml
 URL:           https://hudson.dev.java.net/
 BuildRequires: jpackage-utils
 BuildRequires: rpm-javaprov
 BuildRequires: rpmbuild(macros) >= 1.300
+Requires:      apache-tomcat
 Requires:      jpackage-utils
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -36,16 +39,25 @@ Among those things, current Hudson focuses on the following two jobs:
   notice when something is wrong.
 
 %prep
-%setup -qcT
+%setup -qc
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_javadir}
-cp -a %{SOURCE0} $RPM_BUILD_ROOT%{_javadir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/hudson,%{_datadir}/tomcat/webapps/hudson,%{_sharedstatedir}/{hudson,tomcat/conf/Catalina/localhost}}
+install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/hudson/web.xml
+install %SOURCE2 $RPM_BUILD_ROOT%{_sharedstatedir}/tomcat/conf/Catalina/localhost/hudson.xml
+cp -a * $RPM_BUILD_ROOT%{_datadir}/tomcat/webapps/hudson
+ln -sf %{_sysconfdir}/hudson/web.xml $RPM_BUILD_ROOT%{_datadir}/tomcat/webapps/hudson/WEB-INF/web.xml
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%{_javadir}/*.war
+%dir %{_sysconfdir}/hudson
+%config(noreplace) %{_sysconfdir}/hudson/web.xml
+# do not make this file writeable by tomcat. We do not want to allow user to
+# undeploy this app via tomcat manager.
+%config(noreplace) %{_sharedstatedir}/tomcat/conf/Catalina/localhost/hudson.xml
+%{_datadir}/tomcat/webapps/hudson
+%attr(755,http,http) %dir %{_sharedstatedir}/hudson
This page took 0.117579 seconds and 4 git commands to generate.