1 # Maintainer: Maxime Gauduin <alucryd@archlinux.org>
2 # Contributor: Guillaume Alaux <guillaume@archlinux.org>
7 pkgdesc='Open source implementation of the Java Servlet 3.1 and JavaServer Pages 2.3 technologies'
9 url=https://tomcat.apache.org/
22 optdepends=('tomcat-native: to allow optimal performance in production environments')
24 etc/tomcat8/catalina.policy
25 etc/tomcat8/catalina.properties
26 etc/tomcat8/context.xml
27 etc/tomcat8/logging.properties
28 etc/tomcat8/server.xml
29 etc/tomcat8/tomcat-users.xml
32 install=tomcat8.install
33 _tag=237076605ea6b44ec7b97ee1158d5aa7f2f0b53c
35 git+https://github.com/apache/tomcat.git#tag=${_tag}
41 'b573a5c2d081539c57c35655c612108ae5ece6e362d887170fa52888272480f17f4e6637f378e9fbdf9cb992d91ce63f4fb45d2fca62b31fa1c817ae4465e94c'
42 'e2b63275530ce7e57756ccf6f3934506245888dbc41005275e039e25712c13d37c2f28fd3af0c1dcace1dabe7a1e33d7f056f4c3c8f4a336f952fd7de46345ef'
43 'a0e3052408ad8c64c88fcc7d4c3a883c16e7fd0d89a22fd6e89480b2021fc7fb4acf6f9b2ded78e64ebe9c2afb8bf85742da0299666b22f5cf6f63166ce1b141')
52 _pkgver=$(git describe --tags)
54 if [[ ${_pkgver} != 8.* ]]; then
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
73 export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
74 export PATH="$JAVA_HOME/bin:$PATH"
80 cd tomcat/output/build
82 # Tomcat general files
83 install -dm 755 "${pkgdir}"/usr/share/tomcat8/bin
84 install -m 755 bin/* -t "${pkgdir}"/usr/share/tomcat8/bin/
85 # commons-daemon is packaged on its own
86 rm "${pkgdir}"/usr/share/tomcat8/bin/{*.bat,commons-daemon*}
87 ln -s /usr/share/java/commons-daemon.jar "${pkgdir}"/usr/share/tomcat8/bin/commons-daemon.jar
89 install -dm 755 "${pkgdir}"/usr/share/java/tomcat8
90 install -m 644 lib/* -t "${pkgdir}"/usr/share/java/tomcat8/
91 # eclipse-ecj is packaged on its own
92 rm "${pkgdir}"/usr/share/java/tomcat8/ecj-*.jar
93 ln -s ../eclipse-ecj.jar "${pkgdir}"/usr/share/java/tomcat8/ecj.jar
95 ln -s /usr/share/java/tomcat8 "${pkgdir}"/usr/share/tomcat8/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/tomcat8
99 ln -s /var/log/tomcat8 "${pkgdir}"/usr/share/tomcat8/logs
100 touch "${pkgdir}"/var/log/tomcat8/catalina.{out,err}
101 chgrp ${_gid_log} "${pkgdir}"/var/log/tomcat8/catalina.{out,err}
103 install -dm 775 "${pkgdir}"/etc/tomcat8
104 install -m 640 -g ${_gid_tomcat} conf/* -t "${pkgdir}"/etc/tomcat8/
106 install -dm 775 -g ${_gid_tomcat} "${pkgdir}"/etc/tomcat8/Catalina
107 ln -s /etc/tomcat8 "${pkgdir}"/usr/share/tomcat8/conf
109 install -dm 775 "${pkgdir}"/var/lib/tomcat8
110 cp -dr --no-preserve=ownership webapps "${pkgdir}"/var/lib/tomcat8/
111 chown -R ${_uid_tomcat}:${_gid_tomcat} "${pkgdir}"/var/lib/tomcat8
112 chmod 775 "${pkgdir}"/var/lib/tomcat8/webapps
113 ln -s /var/lib/tomcat8/webapps "${pkgdir}"/usr/share/tomcat8/webapps
115 install -dm 1777 "${pkgdir}"/var/tmp
116 install -dm 775 -o ${_uid_tomcat} -g ${_gid_tomcat} "${pkgdir}"/var/tmp/tomcat8/{temp,work}
117 ln -s /var/tmp/tomcat8/temp "${pkgdir}"/usr/share/tomcat8/temp
118 ln -s /var/tmp/tomcat8/work "${pkgdir}"/usr/share/tomcat8/work
120 install -Dm 644 ../../../tomcat8.service "${pkgdir}"/usr/lib/systemd/system/tomcat8.service
121 install -Dm 644 ../../../tomcat8.sysusers "${pkgdir}"/usr/lib/sysusers.d/tomcat8.conf
122 install -Dm 644 ../../../tomcat8.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/tomcat8.conf