PKGBUILD 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Maintainer (aur): Chris Severance aur.severach aATt spamgourmet dott com
  2. # Contributor: vorbote
  3. # Contributor: Fernando Jiménez Solano <fjim@sdfeu.org>
  4. # Contributor: Evangelos Foutras <evangelos@foutrelis.com>
  5. # Contributor: Link Dupont <link@subpop.net>
  6. # Contributor: Pierre Bourdin <pierre@pi3rrot.net>
  7. # parabola changes and rationale:
  8. # - removed superfluous 'set -u'
  9. # - rebranded to parabola
  10. pkgname='cherokee'
  11. pkgver=1.2.103.d021376
  12. pkgrel=2
  13. pkgdesc='A very fast, flexible and easy to configure Web server'
  14. arch=('i686' 'x86_64' 'armv7h')
  15. url='http://cherokee-project.com'
  16. license=('GPL2')
  17. depends=('openssl-1.0' 'pcre' 'python2')
  18. optdepends=('libldap: ldap validator'
  19. 'pam: pam validator'
  20. 'php-fpm: php5 support'
  21. 'libmariadbclient: mysql validator'
  22. 'ffmpeg: Audio/Video streaming handler'
  23. 'geoip: GeoIP rule module'
  24. 'rrdtool: RRDtool based information collector')
  25. makedepends=('libldap' 'pam' 'libmariadbclient' 'php-fpm' 'ffmpeg' 'geoip' 'rrdtool' 'wget')
  26. backup=('etc/cherokee/cherokee.conf'
  27. 'etc/logrotate.d/cherokee'
  28. 'etc/pam.d/cherokee')
  29. options=('!libtool')
  30. _srcdir="webserver-${pkgver}"
  31. _verwatch=("${url}/downloads.html" 'Version \(.\+\)' 't')
  32. _srcfile="v${pkgver}.zip"
  33. source=("${pkgname}-${_srcfile}::https://github.com/cherokee/webserver/archive/${_srcfile}"
  34. 'cherokee.rc'
  35. 'cherokee.logrotate'
  36. # 'fix-ctk-path-handler-match.patch'
  37. # 'cherokee-1.2.101-ffmpeg0.11.patch'
  38. 'cherokee.service')
  39. sha256sums=('fb6390e55ae901493806cdc9bdf0a8d68ba6ac3ac76b20b05ad247c05b771311'
  40. '4c06cebfab8b68edd4967c020bfb41b077cfff10d76596d1ed192d0b6cedbd86'
  41. '20e26d633f8c1cd90eb21f41dd163b73a83846e405b1ce995e072c4efefc522e'
  42. '415a2e4cd7d04afe21e502dd0ad76301f85a7087cadbfdab5566bec469679a68')
  43. prepare() {
  44. cd "${_srcdir}"
  45. # Fix path matching bug in CTK apps (e.g. market)
  46. #patch -Np1 -i "${srcdir}/fix-ctk-path-handler-match.patch"
  47. # Fix this bug : https://bugs.mageia.org/show_bug.cgi?id=6145
  48. #patch -Np1 -i "${srcdir}/cherokee-1.2.101-ffmpeg0.11.patch"
  49. # Use subdirectory for logs
  50. sed -r -e 's|(%localstatedir%/log)|\1/cherokee|' -i 'cherokee.conf.sample.pre'
  51. # Use Python 2 in cherokee-admin
  52. sed -e 's|"python"|"python2"|' -i 'cherokee/main_admin.c'
  53. # Fix pid file location
  54. sed -e 's:var/run/:run/:g' -i 'admin/PageNewConfig.py'
  55. }
  56. _configure() {
  57. cd "${srcdir}/${_srcdir}"
  58. if [ ! -s 'configure' ]; then
  59. #CPPFLAGS="${CPPFLAGS} -I/usr/include/openssl-1.0"
  60. CFLAGS="${CFLAGS} -I/usr/include/openssl-1.0" \
  61. LDFLAGS="${LDFLAGS} -L/usr/lib/openssl-1.0" \
  62. ./autogen.sh \
  63. --prefix='/usr' \
  64. --sysconfdir='/etc' \
  65. --localstatedir='/var' \
  66. --sbindir='/usr/bin' \
  67. --with-wwwroot='/srv/cherokee/http' \
  68. --with-cgiroot='/src/cherokee/cgi-bin' \
  69. --with-wwwuser='http' \
  70. --with-wwwgroup='http' \
  71. --disable-static \
  72. --with-php='/usr/bin/php-fpm' \
  73. --with-python='python2' \
  74. --enable-os-string='Parabola GNU/Linux-libre'
  75. #sed -e 's:^\(LIBSSL_LIBS = \).*$:\1 -lopenssl-1.0/libssl:g' -i 'Makefile'
  76. fi
  77. set +u
  78. cd "${srcdir}"
  79. }
  80. build() {
  81. _configure
  82. set -u
  83. cd "${_srcdir}"
  84. local _nproc="$(nproc)"; _nproc=$((_nproc>8?8:_nproc))
  85. nice make -s -j "${_nproc}"
  86. set +u
  87. }
  88. package() {
  89. cd "${_srcdir}"
  90. make -s -j1 DESTDIR="${pkgdir}" install
  91. # PAM configuration file for cherokee
  92. install -Dpm644 'pam.d_cherokee' "${pkgdir}/etc/pam.d/${pkgname}"
  93. # Fix ownership of /var/lib/cherokee/graphs
  94. chown -R 'http:http' "${pkgdir}/var/lib/${pkgname}/graphs"
  95. # Use Python 2 (mostly fixed upstream, from the Cherokee PKGBUILD)
  96. sed -e 's/env python$/&2/' -i "${pkgdir}/usr/bin/CTK-run"
  97. #"${pkgdir}/usr/share/cherokee/admin/"{server,upgrade_config}.py
  98. #"${pkgdir}/usr/bin/"{CTK-run,cherokee-{admin-launcher,tweak}}
  99. #sed -r -e "s/['\"]python/&2/g" -i "${pkgdir}/usr/share/cherokee/admin/wizards/django.py"
  100. # Compile Python scripts
  101. python2 -m 'compileall' "${pkgdir}"
  102. python2 -O -m 'compileall' "${pkgdir}"
  103. install -d -o 'http' -g 'http' "${pkgdir}/var/log/${pkgname}"
  104. #install -Dpm755 "${srcdir}/${pkgname}.rc" "${pkgdir}/etc/rc.d/${pkgname}"
  105. install -Dpm644 "${srcdir}/${pkgname}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgname}"
  106. install -Dpm644 "${srcdir}/${pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system/"
  107. # Cleanup
  108. rm -rf "${pkgdir}/srv"
  109. rmdir "${pkgdir}/var/run"
  110. set +u
  111. }
  112. # vim:set ts=2 sw=2 et: