#!/bin/sh # # $FreeBSD$ # PKG_PREFIX=${PKG_PREFIX:=/usr/local} BATCH=${BATCH:=no} ask() { local question default answer question=$1 default=$2 if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then read -p "${question} [${default}]? " answer fi if [ x${answer} = x ]; then answer=${default} fi echo ${answer} } yesno() { local question default answer question=$1 default=$2 while :; do answer=$(ask "${question}" "${default}") case "${answer}" in [Yy]*) return 0;; [Nn]*) return 1;; esac echo "Please answer yes or no." done } if [ x"$2" = xPRE-INSTALL ]; then USER=postfix GROUP=postfix GROUP2=maildrop if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." else if /usr/sbin/pw groupadd ${GROUP} -h - then echo "Added group \"${GROUP}\"." else echo "Adding group \"${GROUP}\" failed..." echo "Please create it, and try again." exit 1 fi fi if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then echo "You already have a group \"${GROUP2}\", so I will use it." else if /usr/sbin/pw groupadd ${GROUP2} -h - then echo "Added group \"${GROUP2}\"." else echo "Adding group \"${GROUP2}\" failed..." echo "Please create it, and try again." exit 1 fi fi if /usr/sbin/pw user show "${USER}" 2>/dev/null; then echo "You already have a user \"${USER}\", so I will use it." else if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \ -d /var/spool/postfix \ -s /sbin/nologin \ -c "Postfix Mail System" then echo "Added user \"${USER}\"." else echo "Adding user \"${USER}\" failed..." echo "Please create it, and try again." exit 1 fi fi if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then echo "You already have user \"${USER}\" in group \"mail\", so I will use it." else echo "You need user \"${USER}\" added to group \"mail\"." if yesno "Would you like me to add it" y; then /usr/sbin/pw groupmod mail -m ${USER} || exit echo "Done." else echo "Please create it, and try again." exit 1 fi fi fi if [ x"$2" = xPOST-INSTALL ]; then CONF1="main.cf master.cf access aliases canonical pcre_table \ regexp_table relocated transport virtual" for file in $CONF1 do if [ ! -f ${PKG_PREFIX}/etc/postfix/$file ]; then cp ${PKG_PREFIX}/etc/postfix/sample-$file ${PKG_PREFIX}/etc/postfix/$file fi done sh ${PKG_PREFIX}/etc/postfix/post-install tempdir=/tmp \ config_directory=${PKG_PREFIX}/etc/postfix \ daemon_directory=${PKG_PREFIX}/libexec/postfix \ command_directory=${PKG_PREFIX}/sbin \ queue_directory=/var/spool/postfix \ sendmail_path=${PKG_PREFIX}/sbin/sendmail \ newaliases_path=${PKG_PREFIX}/bin/newaliases \ mailq_path=${PKG_PREFIX}/bin/mailq \ mail_owner=postfix \ setgid_group=maildrop \ manpage_directory=${PKG_PREFIX}/man \ sample_directory=${PKG_PREFIX}/etc/postfix \ readme_directory=no \ upgrade-package # readme_directory is "no" above since the package will have correct perms # already, and we don't know if they had PORTDOCS. fi replace() { local orig repl orig=$1 repl=$2 if [ -e ${orig} ]; then mv -f ${orig} ${orig}.OFF chmod 0 ${orig}.OFF fi if [ -e ${repl} ]; then ln -s ${repl} ${orig} fi } if [ x"$2" = xPOST-INSTALL -a -z "${PACKAGE_BUILDING}" ]; then if [ -x /sbin/sysctl ]; then OSVERSION=`/sbin/sysctl -n kern.osreldate` else OSVERSION=`/usr/sbin/sysctl -n kern.osreldate` fi if [ ${OSVERSION} -ge 400014 ]; then if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" n; then mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old echo "#" > /etc/mail/mailer.conf echo -n "# Execute the Postfix sendmail program" >> /etc/mail/mailer.conf echo ", named ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf echo "#" >> /etc/mail/mailer.conf echo "sendmail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf echo "send-mail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf echo "mailq ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf echo "newaliases ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf fi else if yesno "Would you like to replace {sendmail,mailq,newaliases} with Postfix versions" n; then replace /usr/sbin/sendmail ${PKG_PREFIX}/sbin/sendmail replace /usr/bin/mailq ${PKG_PREFIX}/sbin/sendmail replace /usr/bin/newaliases ${PKG_PREFIX}/sbin/sendmail echo "Done." fi fi fi aboutsummaryrefslogtreecommitdiffstats
path: root/www/yahoo-ui
Commit message (Expand)AuthorAgeFilesLines
* Convert a bunch of www ports to new options frameworkbapt2013-03-221-18/+13
* www/yahoo-uiohauer2012-11-302-5/+25
* - document www/yahoo-ui security issue and mark port forbidden [1]ohauer2012-11-281-2/+4
* - unbreak buildohauer2012-09-051-6/+1
* - remove www/apache20 and devel/apr0ohauer2012-08-181-1/+1
* - bump PORTREVISION from ports if USE_APACHE=13+ or 20+ is definedohauer2011-08-211-1/+1
* - fix pkg-plist for non default OPTION (lost in pkg-plist r1.7)ohauer2011-04-221-0/+1
* - Updated to 2.8.2glarkin2010-12-162-5/+6
* - Updated to 2.8.1glarkin2010-05-063-7/+12
* - Updated to 2.8.0r4glarkin2009-11-243-31/+294
* - Updated to 2.7.0glarkin2009-08-083-138/+225
* - Update to 2.6.0glarkin2008-10-083-76/+267
* Changed my MAINTAINER address toglarkin2008-07-191-2/+2
* - Update to 2.5.2miwi2008-06-215-12/+42
* - Update to 2.5.1beech2008-03-253-1027/+1026
* - Update to 2.5.0beech2008-02-213-42/+290
* - Fix distfiles path [1]beech2008-02-022-6/+10