archrelease: copy trunk to extra-x86_64
[arch-packages.git] / tomcat10 / repos / community-any / PKGBUILD
blobad233eb818f033ce5c81c633dfd942ad43d55dd1
1 # Maintainer: Maxime Gauduin <alucryd@archlinux.org>
2 # Contributor: Olli <olli@suruatoel.xyz>
4 pkgname=tomcat10
5 pkgver=10.0.15
6 pkgrel=1
7 pkgdesc='Open source implementation of the Java Servlet 5.0 and JavaServer Pages 3.0 technologies'
8 arch=(any)
9 url=https://tomcat.apache.org/
10 license=(APACHE)
11 depends=(
12   'java-runtime>=8'
13   java-jsvc
14   java-commons-daemon
15   eclipse-ecj
17 makedepends=(
18   ant
19   git
20   java-environment=8
22 optdepends=('tomcat-native: to allow optimal performance in production environments')
23 backup=(
24   etc/tomcat10/catalina.policy
25   etc/tomcat10/catalina.properties
26   etc/tomcat10/context.xml
27   etc/tomcat10/logging.properties
28   etc/tomcat10/server.xml
29   etc/tomcat10/tomcat-users.xml
30   etc/tomcat10/web.xml
32 install=tomcat10.install
33 _tag=3265e95e46f9d03589e3ac9a2385ba70e5efd621
34 source=(
35   git+https://github.com/apache/tomcat.git#tag=${_tag}
36   tomcat10.service
37   tomcat10.sysusers
38   tomcat10.tmpfiles
40 b2sums=('SKIP'
41         '2bdf5f9e0ff8766363b2f0ac636415ee416bcfc3f4cc2859e1917d5352da827d0d25dc1c81260c38c1cf3e149d3701931b5a6bd0f32daeed9af4612dbc0b1f72'
42         'ab6584d66e0e2e4d094a54d658af6e6397cbfee56ed211a6add84763d3b89c9e260127387a318c531f23182abde59c2289986773658f45e1c877687e1233b477'
43         '79ef7469fd113253479e212ed5faf9ec7e0e55b4eba25a120d1e3814b35241b6f8f2e78b1b36554088c8944b2652b8e304fd16615132db057e76a32a7778a39d')
45 _gid_log=19
46 _gid_tomcat=59
47 _uid_tomcat=59
49 pkgver() {
50   cd tomcat
52   _pkgver=$(git describe --tags)
54   if [[ ${_pkgver} != 10.* ]]; then
55     exit 1
56   fi
58   echo ${_pkgver}
61 prepare() {
62   cd tomcat
64   cp build.properties.default build.properties
65   sed "/^base\.path=/c\base\.path=${srcdir}" -i build.properties
66   sed "/^compile.debug=/c\compile.debug=false" -i build.properties
67   sed "/^trydownload.httpusecaches=/c\trydownload.httpusecaches=false" -i build.properties
70 build() {
71   cd tomcat
73   export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
74   export PATH="$JAVA_HOME/bin:$PATH"
76   ant
79 package() {
80   cd tomcat/output/build
82   # Tomcat general files
83   install -dm 755 "${pkgdir}"/usr/share/tomcat10/bin
84   install -m 755  bin/* -t "${pkgdir}"/usr/share/tomcat10/bin/
85   # commons-daemon is packaged on its own
86   rm "${pkgdir}"/usr/share/tomcat10/bin/{*.bat,commons-daemon*}
87   ln -s /usr/share/java/commons-daemon.jar "${pkgdir}"/usr/share/tomcat10/bin/commons-daemon.jar
89   install -dm 755 "${pkgdir}"/usr/share/java/tomcat10
90   install -m 644 lib/* -t "${pkgdir}"/usr/share/java/tomcat10/
91   # eclipse-ecj is packaged on its own
92   rm "${pkgdir}"/usr/share/java/tomcat10/ecj-*.jar
93   ln -s ../eclipse-ecj.jar "${pkgdir}"/usr/share/java/tomcat10/ecj.jar
95   ln -s /usr/share/java/tomcat10 "${pkgdir}"/usr/share/tomcat10/lib
97   # We log through systemd but this would still be required for stock Tomcat logging
98   install -dm 775 -o ${_uid_tomcat} -g ${_gid_log} "${pkgdir}"/var/log/tomcat10
99   ln -s /var/log/tomcat10 "${pkgdir}"/usr/share/tomcat10/logs
100   touch "${pkgdir}"/var/log/tomcat10/catalina.{out,err}
101   chgrp ${_gid_log} "${pkgdir}"/var/log/tomcat10/catalina.{out,err}
103   install -dm 775 "${pkgdir}"/etc/tomcat10
104   install -m 640 -g ${_gid_tomcat} conf/* -t "${pkgdir}"/etc/tomcat10/
106   install -dm 775 -g ${_gid_tomcat} "${pkgdir}"/etc/tomcat10/Catalina
107   ln -s /etc/tomcat10 "${pkgdir}"/usr/share/tomcat10/conf
109   install -dm 775 "${pkgdir}"/var/lib/tomcat10
110   cp -dr --no-preserve=ownership webapps "${pkgdir}"/var/lib/tomcat10/
111   chown -R ${_uid_tomcat}:${_gid_tomcat} "${pkgdir}"/var/lib/tomcat10
112   chmod 775 "${pkgdir}"/var/lib/tomcat10/webapps
113   ln -s /var/lib/tomcat10/webapps "${pkgdir}"/usr/share/tomcat10/webapps
115   install -dm 1777 "${pkgdir}"/var/tmp
116   install -dm 775 -o ${_uid_tomcat} -g ${_gid_tomcat} "${pkgdir}"/var/tmp/tomcat10/{temp,work}
117   ln -s /var/tmp/tomcat10/temp "${pkgdir}"/usr/share/tomcat10/temp
118   ln -s /var/tmp/tomcat10/work "${pkgdir}"/usr/share/tomcat10/work
120   install -Dm 644 ../../../tomcat10.service -t "${pkgdir}"/usr/lib/systemd/system/
121   install -Dm 644 ../../../tomcat10.sysusers "${pkgdir}"/usr/lib/sysusers.d/tomcat10.conf
122   install -Dm 644 ../../../tomcat10.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/tomcat10.conf
125 # vim: ts=2 sw=2 et: