1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-03 01:23:49 +00:00
freebsd-ports/www/apache13-fp/pkg-install
Clive Lin 34e5685908 Upgrade to Apache 1.3.22, and
* fix libdescrypt detection: libdescrypt is only needed for
  OSVERSION < 430001 or OSVERSION > 499999 and OSVERSION < 500014,
  due to libdescrypt has been combined into the libcrypt library
  on recent FreeBSD versions.

* default to using the FreeBSD Frontpage Extentions on i386.
  There maybe problems with fpsrvadm.exe when it creates passwords
  on a system that by default uses MD5 passwords.  May need to set
  roots passwd_format to des and change the password, before
  installing (login.conf). BSDi FrontPage Extentions can be used
  by defining WANT_BSDI_EXT.

* Added dependacy on misc/compat3x for the FreeBSD FP Exts.

* Moved execfilename to the end of the request_rec structure
  in httpd.h, so that it would stop breaking binary compatiblity
  with other pre-compiled Apache modules.  This should allow
  compiled modules build for www/apache13 to also work on
  www/apache13-fp without needing to recompile them.

* Removed the Virtual host on port 8080 from httpd.conf, due to
  the manual directory is now exported using an Alias, which
  assigns it to a location on the main document root.

* Moved the Frontpage documents from manual/mod/mod_frontpage to
  manual/frontpage. (Avoids patching manual/mod/index.html*)

PR: ports/31361
Submitted by: Scot W. Hetzel <hetzels@westbend.net> (MAINTAINER)
2001-10-20 14:09:31 +00:00

150 lines
3.8 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# Created by: hetzels@westbend.net
PKG_BATCH=${BATCH:=NO}
PKG_USER=${PKG_USER:=apache}
PKG_GROUP=${PKG_GROUP:=apache}
PKG_PREFIX=${PKG_PREFIX}
HOST_NAME=`/bin/hostname`
AP_CGI=${PKG_PREFIX}/www/cgi-bin
AP_CONF=${PKG_PREFIX}/etc/apache
AP_DATA=${PKG_PREFIX}/www/data
AP_SHARE=${PKG_PREFIX}/share/doc/apache
FPINSTALL=${PKG_PREFIX}/frontpage/version4.0/fp_install.sh
CHANGESERVER=${PKG_PREFIX}/frontpage/version4.0/change_server.sh
FPDOCDIR=${AP_SHARE}/manual/frontpage
IMAGES_DIR=${AP_SHARE}/manual/images
IMAGES_VTI=${PKG_PREFIX}/www/data/images/_vti_cnf
create_user()
{
if [ ! -x /usr/sbin/pw ]; then
echo "*** Please add a user and a group name \`${PKG_GROUP}' before installing this package."
exit 69
fi
if ! pw show group ${PKG_GROUP} -q > /dev/null; then
gid=80
while pw show group -g ${gid} -q > /dev/null; do
gid=`expr ${gid} + 1`
done
if ! pw add group ${PKG_GROUP} -g ${gid}; then
e=$?
echo "*** Failed to add group \`${PKG_GROUP}'. Please add it manually."
exit ${e}
fi
echo "*** Added group \`${PKG_GROUP}' (id ${gid})."
else
gid=`pw show group ${PKG_GROUP} 2> /dev/null | cut -d: -f3`
fi
if [ -x /sbin/nologin ]; then
shell="/sbin/nologin"
else
shell="/nonexistent"
fi
if ! pw show user ${PKG_USER} -q > /dev/null; then
uid=80
while pw show user -u ${uid} -q > /dev/null; do
uid=`expr ${uid} + 1`
done
if ! pw add user ${PKG_USER} -u ${uid} -g ${gid} \
-d "${PKG_PREFIX}/www/data" \
-c "The Apache Web Server" \
-s "${shell}" -p "*" ; then
e=$?
echo "*** Failed to add user \`${PKG_USER}'. Please add it manually."
exit ${e}
fi
echo "*** Added user \`${PKG_USER}' (id ${uid})"
fi
}
create_apache_doc_root ()
{
if [ ! -d ${AP_CGI} ]; then
/bin/cp -rp ${AP_CGI}.default ${AP_CGI}
fi
if [ ! -d ${AP_DATA} ]; then
/bin/mkdir -p ${AP_DATA}/images
for file in apache_pb.gif fplogo.gif powerlogo.gif
{
/bin/cp -rp ${IMAGES_DIR}/${file} ${AP_DATA}/images
}
/bin/cp -rp ${AP_SHARE}/index.html.en ${AP_DATA}/index.html.en
fi
}
fix_frontpage_scripts ()
{
/bin/cat ${FPINSTALL}-dist | \
/usr/bin/sed -e 's;PREFIX;'${PKG_PREFIX}';' \
-e 's;MOD_FPDOCDIR;'${FPDOCDIR}';' \
> ${FPINSTALL}
/bin/cat ${CHANGESERVER}-dist | \
/usr/bin/sed -e 's;PREFIX;'${PKG_PREFIX}';' \
> ${CHANGESERVER}
/bin/chmod 555 ${CHANGESERVER} ${FPINSTALL}
/usr/sbin/chown bin ${CHANGESERVER} ${FPINSTALL}
}
fix_httpd_conf ()
{
if [ ! -f ${AP_CONF}/httpd.conf ] ; then
/bin/cat ${AP_CONF}/httpd.conf.default | \
/usr/bin/sed -e 's;@@HOSTNAME@@;'${HOST_NAME}';' \
> ${AP_CONF}/httpd.conf
fi
for file in mime.types magic srm.conf access.conf
{
if [ ! -f ${AP_CONF}/${file} ]; then
cp -rp ${AP_CONF}/${file}.default ${AP_CONF}/${file}
fi
}
}
#Add the appropriate comment to the images/_vti_cnf file.
comment_files ()
{
if [ -d ${IMAGES_VTI} ]; then
if [ -f ${IMAGES_VTI}/apache_pb.gif ] && \
[ ! "`grep description ${IMAGES_VTI}/apache_pb.gif`" ] ; then
/bin/echo "vti_description:SW|Apache Webserver" >> ${IMAGES_VTI}/apache_pb.gif
fi
if [ -f ${IMAGES_VTI}/fplogo.gif ] && \
[ ! "`grep description ${IMAGES_VTI}/fplogo.gif`" ] ; then
/bin/echo "vti_description:SW|Created with Microsoft FrontPage 2000" >> ${IMAGES_VTI}/fplogo.gif
fi
if [ -f ${IMAGES_VTI}/powerlogo.gif ] && \
[ ! "`grep description ${IMAGES_VTI}/powerlogo.gif`" ] ; then
/bin/echo "vti_description:SW|Powered by FreeBSD" >> ${IMAGES_VTI}/powerlogo.gif
fi
fi
}
case $2 in
PRE-INSTALL)
create_user
;;
POST-INSTALL)
# If we are not in batch mode then run the FP install script.
if [ "${PKG_BATCH}" = "NO" ]; then
create_apache_doc_root
fix_frontpage_scripts
fix_httpd_conf
${FPINSTALL}
comment_files
fi
;;
esac