diff options
Diffstat (limited to 'network_daemons/apache/apache.build')
-rwxr-xr-x | network_daemons/apache/apache.build | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/network_daemons/apache/apache.build b/network_daemons/apache/apache.build new file mode 100755 index 0000000..5038f99 --- /dev/null +++ b/network_daemons/apache/apache.build @@ -0,0 +1,178 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd> + +source /usr/src/ports/Build/build.sh + +NAME=apache +VERSION=2.4.4 +BUILD=2 +DEPENDS=('apr >= 1.4.6-1' 'expat >= 2.1.0-1' 'pcre >= 8.32-1') +OPTDEPENDS=('file >= 5.14-1' 'openssl >= 1.0.1e-1' 'lua >= 5.2.2-1') + +# Description + +cat > ${PKG}/install/slack-desc <<EOF +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + +$(padd)|-----handy-ruler------------------------------------------------------| +${NAME}: apache (The Apache HTTP Server) +${NAME}: +${NAME}: Apache is an HTTP server designed as a plug-in replacement for the +${NAME}: NCSA HTTP server. It fixes numerous bugs in the NCSA server and +${NAME}: includes many frequently requested new features, and has an API which +${NAME}: allows it to be extended to meet users' needs more easily. +${NAME}: +${NAME}: Apache is the most popular web server in the known universe; over +${NAME}: half of the servers on the Internet are running Apache or one of +${NAME}: its variants. +${NAME}: +EOF + +cat >> ${PKG}/install/doinst.sh <<EOF +#!/bin/sh + +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# If the apache user and group do not exist, add them + +if grep "^apache:x:" etc/passwd 1> /dev/null 2> /dev/null ; then + true +else + echo "apache:x:80:80:Apache:/srv/www:/bin/false" >> etc/passwd +fi +if grep "^apache:x:" etc/group 1> /dev/null 2> /dev/null ; then + true +else + echo "apache:x:80:" >> etc/group +fi +if grep "^apache:" etc/shadow 1> /dev/null 2> /dev/null ; then + true +else + echo "apache:*:9797:0:::::" >> etc/shadow +fi + +# Create apache's run directory if it isn't there + +if [ ! -d run/apache ]; then + install -m 0755 -d run/apache +fi + +config etc/rc.d/rc.httpd.new +config etc/logrotate.d/apache.new + +# Now copy the Apache config files into place if there are not existing copies: + +for cfgfile in httpd.conf magic mime.types; do + if [ ! -f etc/apache/\${cfgfile} ]; then + cp -a etc/apache/\${cfgfile}.default etc/apache/\${cfgfile} + fi +done +EOF + +# Sources + +SRCNAME[0]=httpd +SRCVERS[0]=${VERSION} +SRCPACK[0]=http://www.apache.org/dist/httpd/${SRCNAME[0]}-${SRCVERS[0]}.tar.bz2 + +configure() +{ +CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \ +./configure \ + --build="${ARCH}-slackware-linux" \ + --enable-so \ + --with-mpm=worker \ + --enable-layout=Slackware \ + --enable-mpms-shared=all \ + --enable-mods-shared=all \ + --enable-modules=all \ + --enable-pie \ + --enable-ssl \ + --enable-dbd \ + --enable-cgi \ + --enable-cgid \ + --enable-deflate \ + --enable-rewrite \ + --enable-vhost-alias \ + --enable-proxy \ + --enable-proxy-http \ + --enable-proxy-ftp \ + --enable-proxy-connect \ + --enable-cache \ + --enable-mem-cache \ + --enable-file-cache \ + --enable-disk-cache \ + --enable-authn-anon \ + --enable-authn-dbd \ + --enable-authn-dbm \ + --enable-authz-dbd \ + --enable-authz-dbm \ + --enable-dav-fs \ + --disable-ldap \ + --with-libxml2 \ + --with-pcre="${SYS_DIR[usr]}" + ${*} + # --enable-ldap \ + # --enable-authnz-ldap \ + # --enable-lua \ + # --enable-luajit \ +} + +build0() +{ +sed -e 's|User daemon|User apache|g' \ + -e 's|Group daemon|Group apache|g' \ + -i docs/conf/httpd.conf.in +configure +make ${JOBS} +make install DESTDIR="${PKG}" +doc ABOUT_APACHE README +changelog CHANGES +license LICENSE +install.dir ${PKG}${SYS_DIR[etc]}/{rc.d,tmpfiles.d,logrotate.d} +install.bin rc.httpd.new ${PKG}${SYS_DIR[etc]}/rc.d +install.cfg apache.conf.tmpfiles ${PKG}${SYS_DIR[etc]}/tmpfiles.d/apache.conf +install.cfg apache.logrotate ${PKG}${SYS_DIR[etc]}/logrotate.d/apache.new +install.dir ${PKG}${SYS_DIR[systemdsystemunitdir]} +install.cfg apache.service ${PKG}${SYS_DIR[systemdsystemunitdir]} +mv \ + ${PKG}${SYS_DIR[etc]}/apache/httpd.conf \ + ${PKG}${SYS_DIR[etc]}/apache/httpd.conf.default +mv \ + ${PKG}${SYS_DIR[etc]}/apache/mime.types \ + ${PKG}${SYS_DIR[etc]}/apache/mime.types.default +mv \ + ${PKG}${SYS_DIR[etc]}/apache/magic \ + ${PKG}${SYS_DIR[etc]}/apache/magic.default +rm -rf \ + ${PKG}${SYS_DIR[run]} +sed \ + -e 's|#\(LoadModule negotiation_module \)|\1|' \ + -e 's|#\(LoadModule include_module \)|\1|' \ + -e 's|#\(LoadModule userdir_module \)|\1|' \ + -e 's|#\(LoadModule slotmem_shm_module \)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-multilang-errordoc.conf\)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-autoindex.conf\)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-languages.conf\)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-userdir.conf\)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-default.conf\)|\1|' \ + -e 's|#\(Include /etc/apache/extra/httpd-mpm.conf\)|\1|' \ + -i ${PKG}${SYS_DIR[etc]}/apache/httpd.conf.default +} |