summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c859bd1066c072d9f3a147c63ac0aa7399d12a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Maintainer: 咸粽子 <xianzongzi aliyun.com>
pkgname=angie-tongsuo
_pkgname=angie
pkgver=1.4.1
_tongsuo_version=8.4.0
pkgrel=1
pkgdesc="Angie is an efficient, powerful, and scalable web server that was forked from angie.With Tongsuo.带了铜锁密码库的 angie,支持国密 NTLS。"
arch=("x86_64")
url="https://angie.software"
license=(custom)
groups=()
depends=(gd geoip pcre2 zlib glibc libxcrypt)
makedepends=()
provides=()
conflicts=()
replaces=()
options=()
backup=(etc/angie/fastcgi.conf
        etc/angie/fastcgi_params
        etc/angie/koi-win
        etc/angie/koi-utf
	etc/angie/mime.types
        etc/angie/angie.conf
        etc/angie/scgi_params
        etc/angie/uwsgi_params
        etc/angie/win-utf
        etc/logrotate.d/angie)
source=(https://download.angie.software/files/$_pkgname-$pkgver.tar.gz
        Tongsuo-$_tongsuo_version.tar.gz::https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/$_tongsuo_version.tar.gz
)
sha256sums=('83a3f2bb2ba59e5b676495a2674d62606d64e8bcf99cefa09de6fc338ab7587a'
            '57c2741750a699bfbdaa1bbe44a5733e9c8fc65d086c210151cfbc2bbd6fc975')


_common_flags=(
  --with-compat
  --with-debug
  --with-file-aio
  --with-http_addition_module
  --with-http_auth_request_module
  --with-http_dav_module
  --with-http_degradation_module
  --with-http_flv_module
  --with-http_geoip_module
  --with-http_gunzip_module
  --with-http_gzip_static_module
  --with-http_image_filter_module
  --with-http_mp4_module
  --with-http_random_index_module
  --with-http_realip_module
  --with-http_secure_link_module
  --with-http_slice_module
  --with-http_ssl_module
  --with-http_stub_status_module
  --with-http_sub_module
  --with-http_v2_module
  --with-http_v3_module
  --with-openssl=../Tongsuo-$_tongsuo_version
    --with-openssl-opt=enable-ntls
    --with-ntls
  --with-mail
  --with-mail_ssl_module
  --with-pcre-jit
  --with-stream
  --with-stream_geoip_module
  --with-stream_realip_module
  --with-stream_ssl_module
  --with-stream_ssl_preread_module
  --with-threads
)

_stable_flags=(
)

build() {
  cd "$_pkgname-$pkgver"
  ./configure \
    --prefix=/etc/angie \
    --conf-path=/etc/angie/angie.conf \
    --sbin-path=/usr/bin/angie \
    --pid-path=/run/angie.pid \
    --lock-path=/run/lock/angie.lock \
    --user=http \
    --group=http \
    --http-log-path=/var/log/angie/access.log \
    --error-log-path=stderr \
    --http-client-body-temp-path=/var/lib/angie/client-body \
    --http-proxy-temp-path=/var/lib/angie/proxy \
    --http-fastcgi-temp-path=/var/lib/angie/fastcgi \
    --http-scgi-temp-path=/var/lib/angie/scgi \
    --http-uwsgi-temp-path=/var/lib/angie/uwsgi \
    --with-cc-opt="$CFLAGS $CPPFLAGS" \
    --with-ld-opt="$LDFLAGS" \
    ${_common_flags[@]} \
    ${_stable_flags[@]}

  make
}

package() {
  cd "$_pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install

  rm "$pkgdir"/etc/angie/*.default
  # rm "$pkgdir"/etc/angie/mime.types  # in mailcap ==> /etc/nginx/mime.types

  install -d "$pkgdir"/var/lib/angie
  install -dm700 "$pkgdir"/var/lib/angie/proxy

  chmod 755 "$pkgdir"/var/log/angie
  chown root:root "$pkgdir"/var/log/angie

  install -Dm644 ../../logrotate "$pkgdir"/etc/logrotate.d/angie
  install -Dm644 ../../service "$pkgdir"/usr/lib/systemd/system/angie.service
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE_angie
  install -Dm644 ../Tongsuo-$_tongsuo_version/LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE_Tongsuo

  rmdir "$pkgdir"/run

  install -d "$pkgdir"/usr/share/man/man8/
  gzip -9c man/angie.8 > "$pkgdir"/usr/share/man/man8/angie.8.gz

}