forked from sabotage-linux/sabotage
/
hiawatha
54 lines (43 loc) · 1.69 KB
/
hiawatha
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
[mirrors]
https://www.hiawatha-webserver.org/files/hiawatha-9.14.tar.gz
[main]
filesize=891930
sha512=66ad77c132d34daa5eb597ce67d7b26581c59534e5cf83dd65f78567a9a1798030cd42fef2d612bd1935243db979a2ef1df873f01b0d0a009395ef3da1dca6e6
[deps.host]
cmake
[deps]
mbedtls
[build]
# NOTE: the mirror requires tls, download with curl:
# USE_CURL=1 butch install hiawatha
# NOTE: XSLT support requires libxlst
# NOTE about mbedtls:
# Hiawatha usually compiles its own mbedtls to make sure it has the
# right config options. In sabotage, we already have these options set,
# so we use the system library of course.
CFLAGS="-static" cmake \
-DENABLE_CACHE=OFF \
-DENABLE_RPROXY=OFF \
-DENABLE_TOOLKIT=OFF \
-DENABLE_XSLT=OFF \
-DUSE_SYSTEM_MBEDTLS=ON \
-DCMAKE_INSTALL_PREFIX="$butch_prefix" \
-DCMAKE_INSTALL_BINDIR="$butch_prefix/bin" \
-DCMAKE_INSTALL_SBINDIR="$butch_prefix/bin" \
-DCMAKE_INSTALL_SYSCONFDIR="$butch_prefix/etc/hiawatha" \
-DCMAKE_INSTALL_LIBDIR="$butch_prefix/lib" \
-DCMAKE_INSTALL_MANDIR="$butch_prefix/share/man" \
-DCONFIG_DIR="$butch_prefix/etc/hiawatha" \
-DLOG_DIR="$butch_prefix/var/log/hiawatha" \
-DPID_DIR="$butch_prefix/var/run/hiawatha" \
-DWEBROOT_DIR="$butch_prefix/var/www" \
# hack that adds missing statically linked mbedtls libraries
# thread: https://www.hiawatha-webserver.org/forum/topic/2010
sed -i 's/-lmbedtls/-lmbedtls -lmbedcrypto -lmbedx509/' CMakeFiles/*/link.txt
make V=1 -j$MAKE_THREADS
# set the user-id to www-data (as in the service)
sed -i 's/#ServerId = www-data/ServerId = www-data/' config/hiawatha.conf
make DESTDIR="$butch_install_dir" install
# install the service
IS="$K"/bin/install-service
"$IS" --down --log --force hiawatha "$K"/services/hiawatha