PKGBUILD 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Maintainer (AUR): Tom Richards <tom@tomrichards.net>
  2. # Maintainer (Arch:nginx): Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
  3. # Maintainer (Arch:nginx): Sébastien Luttringer
  4. # Contributor (Arch:nginx): Sergej Pupykin <pupykin.s+arch@gmail.com>
  5. # Contributor (Arch:nginx): Miroslaw Szot <mss@czlug.icis.pcz.pl>
  6. # Contributor (Arch:nginx): Daniel Micay <danielmicay@gmail.com>
  7. # Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
  8. _nginxver=1.12.1
  9. _passengerver=5.1.6
  10. pkgname=nginx-passenger
  11. pkgver=$_nginxver.passenger.$_passengerver
  12. pkgrel=1
  13. pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server'
  14. pkgdesc+=" (with Passenger module)"
  15. arch=('x86_64')
  16. arch+=('i686')
  17. url='https://nginx.org'
  18. license=('custom')
  19. depends=('pcre' 'zlib' 'openssl' 'geoip' 'curl' 'gd' 'ruby' 'ruby-rake' 'mailcap')
  20. optdepends=('python: Support for python web apps'
  21. 'nodejs: Support for node.js web apps'
  22. 'geoip-database: For country geolocation'
  23. 'geoip-database-extra: For city/ASN geolocation')
  24. makedepends=('apache')
  25. conflicts=('nginx' 'passenger')
  26. backup=('etc/nginx/fastcgi.conf'
  27. 'etc/nginx/fastcgi_params'
  28. 'etc/nginx/koi-win'
  29. 'etc/nginx/koi-utf'
  30. 'etc/nginx/mime.types'
  31. 'etc/nginx/nginx.conf'
  32. 'etc/nginx/scgi_params'
  33. 'etc/nginx/uwsgi_params'
  34. 'etc/nginx/win-utf'
  35. 'etc/logrotate.d/nginx')
  36. source=($url/download/nginx-$_nginxver.tar.gz{,.asc}
  37. https://phusion-passenger.s3.amazonaws.com/releases/passenger-$_passengerver.tar.gz{,.asc}
  38. service
  39. logrotate
  40. fix-build-with-curl-7.62.0.patch::https://github.com/phusion/passenger/commit/e290bdd0d9e51dc8f2f331058494f5672c9dcd6a.patch
  41. packaging.patch)
  42. validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8' # Maxim Dounin <mdounin@mdounin.ru>
  43. 'D5F0851426939232F437AB722AC745A50A212A8C' # Phusion Software Signing <software-signing@phusion.nl>
  44. '16378A33A6EF16762922526E561F9B9CAC40B2F7') # Phusion Automated Software Signing (Used by automated tools to sign software packages) <auto-software-signing@phusion.nl>
  45. sha256sums=('8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb'
  46. 'SKIP'
  47. 'e897cc5f0ec6446bfdc226404dca4bd29f7418ae92010c389661b9f024a3cf24'
  48. 'SKIP'
  49. '8489da1745910be89d19b695f5a4d066b477f704f9beddc17d33d855aac3f3df'
  50. 'b9af19a75bbeb1434bba66dd1a11295057b387a2cbff4ddf46253133909c311e'
  51. '35292243a0303fbc727fd4368196727daeb67fa3b5ec154fd29b171fd9d5eb45'
  52. '2da1ede016ca328f254bfb10e95ff0a5ef2790382a9a87ffde77524956a31749')
  53. _flags=(
  54. --with-ipv6
  55. --with-pcre-jit
  56. --with-file-aio
  57. --with-http_addition_module
  58. --with-http_auth_request_module
  59. --with-http_dav_module
  60. --with-http_degradation_module
  61. --with-http_flv_module
  62. --with-http_geoip_module
  63. --with-http_gunzip_module
  64. --with-http_gzip_static_module
  65. --with-http_image_filter_module
  66. --with-http_mp4_module
  67. --with-http_random_index_module
  68. --with-http_realip_module
  69. --with-http_secure_link_module
  70. --with-http_slice_module
  71. --with-http_ssl_module
  72. --with-http_stub_status_module
  73. --with-http_sub_module
  74. --with-http_v2_module
  75. --with-mail
  76. --with-mail_ssl_module
  77. --with-stream
  78. --with-stream_ssl_module
  79. --with-threads
  80. )
  81. prepare() {
  82. cd "$srcdir/passenger-$_passengerver"
  83. patch -p1 -i "$srcdir"/packaging.patch
  84. patch -Np1 -i "$srcdir"/fix-build-with-curl-7.62.0.patch
  85. }
  86. build() {
  87. # Passenger
  88. export EXTRA_CFLAGS=$CFLAGS
  89. export EXTRA_CXXFLAGS=$CXXFLAGS
  90. export FS_PREFIX="/usr"
  91. export FS_SBINDIR="/usr/bin"
  92. export NATIVE_PACKAGING_METHOD="arch"
  93. cd "$srcdir/passenger-$_passengerver"
  94. _nginx_addon_dir=`bin/passenger-config --nginx-addon-dir`
  95. rake fakeroot
  96. # Nginx
  97. cd "$srcdir/nginx-$_nginxver"
  98. ./configure \
  99. --prefix=/etc/nginx \
  100. --conf-path=/etc/nginx/nginx.conf \
  101. --sbin-path=/usr/bin/nginx \
  102. --pid-path=/run/nginx.pid \
  103. --lock-path=/run/lock/nginx.lock \
  104. --user=http \
  105. --group=http \
  106. --http-log-path=/var/log/nginx/access.log \
  107. --error-log-path=stderr \
  108. --http-client-body-temp-path=/var/lib/nginx/client-body \
  109. --http-proxy-temp-path=/var/lib/nginx/proxy \
  110. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  111. --http-scgi-temp-path=/var/lib/nginx/scgi \
  112. --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
  113. ${_flags[@]} \
  114. --add-module="$_nginx_addon_dir"
  115. make
  116. }
  117. package() {
  118. # Nginx
  119. cd "$srcdir/nginx-${_nginxver}"
  120. make DESTDIR="$pkgdir" install
  121. sed -e 's|\<user\s\+\w\+;|user html;|g' \
  122. -e '44s|html|/usr/share/nginx/html|' \
  123. -e '54s|html|/usr/share/nginx/html|' \
  124. -i "$pkgdir"/etc/nginx/nginx.conf
  125. rm "$pkgdir"/etc/nginx/*.default
  126. rm "$pkgdir"/etc/nginx/mime.types # in mailcap
  127. install -d "$pkgdir"/var/lib/nginx
  128. install -dm700 "$pkgdir"/var/lib/nginx/proxy
  129. chmod 750 "$pkgdir"/var/log/nginx
  130. chown http:log "$pkgdir"/var/log/nginx
  131. install -d "$pkgdir"/usr/share/nginx
  132. mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
  133. install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx
  134. install -Dm644 ../service "$pkgdir"/usr/lib/systemd/system/nginx.service
  135. install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  136. rmdir "$pkgdir"/run
  137. install -d "$pkgdir"/usr/share/man/man8/
  138. gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz
  139. for i in ftdetect indent syntax; do
  140. install -Dm644 contrib/vim/${i}/nginx.vim \
  141. "${pkgdir}/usr/share/vim/vimfiles/${i}/nginx.vim"
  142. done
  143. # Passenger
  144. cp -R "${srcdir}/passenger-${_passengerver}"/pkg/fakeroot/usr "${pkgdir}"/
  145. }