From 5f9f6fcac1961f4f1022a0f88600278ced439e1f Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 27 Jun 2013 23:28:45 -0400 Subject: [PATCH] Add option to enable/disable httpd, lighttpd, webkit and gnash packages --- config/sysinfos.default | 17 ++++++++++++++++- stage5/hv-install-1 | 32 ++++++++++++++++++++------------ stage5/pkg/apache | 4 +++- stage5/pkg/lighttpd | 4 +++- stage5/pkg/php | 22 ++++++++++++---------- stage5/post-install | 34 ++++++++++++++++++---------------- 6 files changed, 72 insertions(+), 41 deletions(-) diff --git a/config/sysinfos.default b/config/sysinfos.default index 8cfb220..e2e29d0 100644 --- a/config/sysinfos.default +++ b/config/sysinfos.default @@ -82,9 +82,24 @@ MAILBOX_FORMAT="unix" # Alternate port for Sendmail SENDMAIL_PORT="25" +# Apache httpd web server support +USE_HTTPD="yes" + # Alternate port for Apache HTTPD_PORT="80" -APACHE_USER="www" +HTTPD_USER="www" + +# Lighttpd web server support +USE_LIGHTTPD="yes" + +# Define to httpd (Apache) or lighttpd +DEFAULT_WEB_SERVER="lighttpd" + +# Webkit support +USE_WEBKIT="no" + +# Gnash support +USE_GNASH="no" # Samba support (default yes) USE_SAMBA="yes" diff --git a/stage5/hv-install-1 b/stage5/hv-install-1 index 293dae4..90062f9 100755 --- a/stage5/hv-install-1 +++ b/stage5/hv-install-1 @@ -155,15 +155,17 @@ if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; the ipkg ${LIBNOTIFY} ipkg ${LIBVPX} "--enable-shared" - ipkg -m acnb -t -j ${WEBKIT} "\ - --libexecdir=/usr/lib/WebKitGTK \ - --with-gstreamer=0.10 \ - --enable-introspection \ - --with-gtk=2.0 \ - --disable-geolocation \ - --disable-gtk-doc" - ipkg ${VALA} - NOCOLOR=1 ipkg ${MIDORI} + if [ "x${USE_WEBKIT}" = "xyes" ]; then + ipkg -m acnb -t -j ${WEBKIT} "\ + --libexecdir=/usr/lib/WebKitGTK \ + --with-gstreamer=0.10 \ + --enable-introspection \ + --with-gtk=2.0 \ + --disable-geolocation \ + --disable-gtk-doc" + ipkg ${VALA} + NOCOLOR=1 ipkg ${MIDORI} + fi ipkg -m noac -l "${FIREFOX}-xulrunner" ${FIREFOX} ipkg -m noac -l "${FIREFOX}-browser" ${FIREFOX} @@ -174,7 +176,9 @@ if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; the ipkg -m acnb ${VLC} "--enable-mozilla --enable-qt4 --enable-ncurses" ipkg ${SDL} ipkg -m noac ${AGG} - ipkg ${GNASH} + if [ "x${USE_GNASH}" = "xyes" ]; then + ipkg ${GNASH} + fi fi ipkg ${LIBGAMIN} "--libexecdir=/usr/sbin" @@ -184,8 +188,12 @@ ipkg ${XARCHIVER} ipkg -m acnb ${LIBFM} ipkg ${PCMANFM} -ipkg -s apache ${HTTPD} # Apache -ipkg ${LIGHTTPD} +if [ "x${USE_HTTPD}" = "xyes" ]; then + ipkg -s apache ${HTTPD} +fi +if [ "x${USE_LIGHTTPD}" = "xyes" ]; then + ipkg ${LIGHTTPD} +fi ipkg ${PHP} if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then diff --git a/stage5/pkg/apache b/stage5/pkg/apache index ab8b2f7..8b6e66a 100644 --- a/stage5/pkg/apache +++ b/stage5/pkg/apache @@ -140,5 +140,7 @@ EOF install -v -m740 ${SCRDIR}/bootscripts/apache /etc/rc.d/init.d # script-name start stop - bootscript_add_rc3 apache 70 20 + if [ "x${DEFAULT_WEB_SERVER}" == "xhttpd" ]; then + bootscript_add_rc3 apache 70 20 + fi } diff --git a/stage5/pkg/lighttpd b/stage5/pkg/lighttpd index 6a0ea5a..d5ded9f 100644 --- a/stage5/pkg/lighttpd +++ b/stage5/pkg/lighttpd @@ -63,5 +63,7 @@ EOF install -v -m740 ${SCRDIR}/bootscripts/lighttpd /etc/rc.d/init.d # script-name start stop - bootscript_add_rc3 lighttpd 70 20 + if [ "x${DEFAULT_WEB_SERVER}" == "xlighttpd" ]; then + bootscript_add_rc3 lighttpd 70 20 + fi } diff --git a/stage5/pkg/php b/stage5/pkg/php index 5b34926..60ed440 100644 --- a/stage5/pkg/php +++ b/stage5/pkg/php @@ -43,17 +43,19 @@ hvbuild_post() fi cp ${LFS_TMP}/${PACKAGE}/php.ini-production /etc/php.ini - # To enable PHP support in the Apache web server, a new AddType directive - # must be added to the httpd.conf file. - if ! grep -q "application/x-httpd-php" /etc/httpd/httpd.conf; then - echo "AddType application/x-httpd-php .php" >> /etc/httpd/httpd.conf - fi + if [ "x${USE_HTTPD}" = "xyes" ]; then + # To enable PHP support in the Apache web server, a new AddType + # directive must be added to the httpd.conf file. + if ! grep -q "application/x-httpd-php" /etc/httpd/httpd.conf; then + echo "AddType application/x-httpd-php .php" >> /etc/httpd/httpd.conf + fi - # Est-ce nécessaire? - #cgi.discard_path = 1 + # Est-ce nécessaire? + #cgi.discard_path = 1 - if ! grep -q "DirectoryIndex" /etc/httpd/httpd.conf | grep "index.php"; then - sed -i -e "s!\(^\s*DirectoryIndex index.html.*\)!\1 index.php!g" \ - /etc/httpd/httpd.conf + if ! grep -q "DirectoryIndex" /etc/httpd/httpd.conf | grep "index.php"; then + sed -i -e "s!\(^\s*DirectoryIndex index.html.*\)!\1 index.php!g" \ + /etc/httpd/httpd.conf + fi fi } diff --git a/stage5/post-install b/stage5/post-install index aca3db4..e3f50c8 100755 --- a/stage5/post-install +++ b/stage5/post-install @@ -16,22 +16,24 @@ if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then ######################################### # Apache ######################################### - READ_VALID="no" - - while [ "${READ_VALID}" = "no" ]; do - echo "Do you want to generate SSL self-signed" - echo -n "certificate for Apache? (y/n): " - read USE_SSL - - if [ "${USE_SSL}" = "y" -o "${USE_SSL}" = "n" ]; then - READ_VALID="yes" - else - echo "Error, answer y or n" - fi - done - - if [ "${USE_SSL}" = "y" ]; then - /etc/httpd/generate-ssl-certs + if [ "x${USE_HTTPD}" = "xyes" ]; then + READ_VALID="no" + + while [ "${READ_VALID}" = "no" ]; do + echo "Do you want to generate SSL self-signed" + echo -n "certificate for Apache? (y/n): " + read USE_SSL + + if [ "${USE_SSL}" = "y" -o "${USE_SSL}" = "n" ]; then + READ_VALID="yes" + else + echo "Error, answer y or n" + fi + done + + if [ "${USE_SSL}" = "y" ]; then + /etc/httpd/generate-ssl-certs + fi fi ######################################### -- 2.20.1