apache-apr.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. fw_depends gcc-6 openssl
  3. fw_installed apache-apr && return 0
  4. APR_VERSION=1.6.3
  5. TEMP_DIRECTORY="$(mktemp -d)"
  6. # Ask Apache about the preferred mirror for our connection using JSON response. Source: https://stackoverflow.com/a/39670213
  7. APR_MIRROR="$(wget -qO - http://www.apache.org/dyn/closer.lua?as_json=1 | grep -P '"preferred": "' | cut -d \" -f4)"
  8. APR_FILENAME=apr-${APR_VERSION}
  9. APR_URL=${APR_MIRROR}apr/${APR_FILENAME}.tar.gz
  10. APR_SIGNATURE=http://www.apache.org/dist/apr/${APR_FILENAME}.tar.gz.asc
  11. APACHE_KEYS=https://people.apache.org/keys/group/apr.asc
  12. # Download the files at temporal storage
  13. wget -P ${TEMP_DIRECTORY} ${APACHE_KEYS}
  14. wget -P ${TEMP_DIRECTORY} ${APR_SIGNATURE}
  15. wget -P ${TEMP_DIRECTORY} ${APR_URL}
  16. # It's highly unlikely Apache to change the filename of the GPG keys file
  17. gpg --import ${TEMP_DIRECTORY}/apr.asc
  18. # Verify the downloaded file using the signature file
  19. gpg --verify ${TEMP_DIRECTORY}/${APR_FILENAME}.tar.gz.asc ${TEMP_DIRECTORY}/${APR_FILENAME}.tar.gz
  20. #TODO below
  21. # Compile the project
  22. pushd "${TEMP_DIRECTORY}"
  23. fw_untar "${TEMP_DIRECTORY}/${APR_FILENAME}.tar.gz"
  24. pushd "$APR_FILENAME"
  25. # We need the newer custom OpenSSL
  26. ./configure --with-ssl=/usr/local/ssl
  27. make
  28. sudo make install
  29. sudo ldconfig
  30. popd
  31. popd
  32. echo "# Apache APR should be in /usr/local/ssl" > $IROOT/apache-apr.installed