|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +TOP=/abetterinternet |
| 4 | +DATADIR=$TOP/data |
| 5 | + |
| 6 | +fail() { |
| 7 | + echo "$@" |
| 8 | + exit 1 |
| 9 | +} |
| 10 | + |
| 11 | +needs_update() { |
| 12 | + local ref_file="$1" |
| 13 | + local check_dir="$2" |
| 14 | + if test ! -f "$ref_file"; then |
| 15 | + return 0 |
| 16 | + fi |
| 17 | + find "$check_dir" -type f -a -newer "$ref_file" -o -type d -name .git -prune -a -false | |
| 18 | + while read fname; do |
| 19 | + return 0 |
| 20 | + done |
| 21 | + return 1 |
| 22 | +} |
| 23 | + |
| 24 | +cd $DATADIR |
| 25 | +if test ! -f rustup.sh.run; then |
| 26 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh ||rm -f rustup.sh |
| 27 | + /bin/bash rustup.sh -y ||fail |
| 28 | + touch rustup.sh.run |
| 29 | +fi |
| 30 | + |
| 31 | +if test ! -d httpd; then |
| 32 | + git clone https://github.com/icing/httpd.git httpd ||fail |
| 33 | +fi |
| 34 | +cd httpd |
| 35 | +if test ! -d srclib/apr; then |
| 36 | + svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr |
| 37 | +fi |
| 38 | +git fetch origin icing/2.4.x-ap_ssl_things ||fail |
| 39 | +git checkout icing/2.4.x-ap_ssl_things ||fail |
| 40 | +if needs_update $DATADIR/apache2/.installed .; then |
| 41 | + rm -f $DATADIR/apache2/.installed |
| 42 | + ./buildconf ||fail |
| 43 | + ./configure --prefix=$DATADIR/apache2 --with-included-apr \ |
| 44 | + --enable-mpms-shared=event --enable-ssl --enable-http2 \ |
| 45 | + --enable-cgi --enable-md ||fail |
| 46 | + make install ||fail |
| 47 | + touch $DATADIR/apache2/.installed |
| 48 | +fi |
| 49 | + |
| 50 | + |
| 51 | +cd $DATADIR |
| 52 | +if test ! -d crustls; then |
| 53 | + git clone https://github.com/abetterinternet/crustls.git crustls |
| 54 | +fi |
| 55 | +cd crustls |
| 56 | +git fetch origin list-ciphersuites |
| 57 | +git checkout list-ciphersuites |
| 58 | +if needs_update $DATADIR/apache2/.crustls-installed .; then |
| 59 | + rm -f $DATADIR/apache2/.crustls-installed |
| 60 | + touch src/crustls.h ||fail "missing src/crustls.h" |
| 61 | + make install DESTDIR=$DATADIR/apache2 ||fail |
| 62 | + touch $DATADIR/apache2/.crustls-installed |
| 63 | +fi |
| 64 | + |
| 65 | +cd "$TOP/mod_tls" ||fail |
| 66 | +if needs_update .installed .; then |
| 67 | + rm -f .installed |
| 68 | + if test ! -f configure -o configure.ac -nt configure; then |
| 69 | + autoreconf -i ||fail |
| 70 | + fi |
| 71 | + if test ! -d Makefile -o ./configure -nt Makefile; then |
| 72 | + ./configure --with-apxs=$DATADIR/apache2/bin/apxs ||fail |
| 73 | + touch ./configure |
| 74 | + fi |
| 75 | + make clean||fail |
| 76 | + make ||fail |
| 77 | + find . |
| 78 | + make install ||fail |
| 79 | + touch .installed |
| 80 | +fi |
| 81 | +make test |
0 commit comments