# New ports collection makefile for:    ports-common
# Date created:                         2008-04-25
# Whom:                                 SW-Soft
# OS Version:                           5.5
#
# $FreeBSD: ports/swsoft/ports-common/Makefile 20080218000000 2008/04/25 22:52:27 Parallels Exp $
#

PORTNAME= psa
PORTVERSION= 8.4.0 
CATEGORIES= swsoft 

COMMENT= "Common Makefile for Plesk"

VALID_CATEGORIES+= swsoft 

OPTIONS=  PSA 		"Base packages of Plesk" "on"
OPTIONS+= ASP 		"Apache ASP support" "off"
OPTIONS+= MAILMAN 	"Mailman mailing list manager support" "off"
OPTIONS+= PGSQL 	"PosgreSQL server support" "off"
OPTIONS+= TOMCAT 	"Tomcat Java Servlets support" "off" 
OPTIONS+= SPAM 		"SpamAssassin support" "off"
OPTIONS+= HORDE 	"Additional Horde components for Plesk" "off"
OPTIONS+= MANUALS	"Additional Plesk manuals" "off"
OPTIONS+= BACKUP 	"Backup utilities" "off"
OPTIONS+= DRWEB 	"DrWeb antivirus" "off"
OPTIONS+= PPWSE 	"Plesk Professional Web Site Editor" "off" 
OPTIONS+= API 		"Plesk API former Plesk Agent" "off"
OPTIONS+= SSHTERM 	"SSH Terminal java applet" "off"
OPTIONS+= PMM 		"Migration manager" "off" 
OPTIONS+= FIREWALL 	"Firewall module" "off" 
OPTIONS+= KAV	 	"Kaspersky antivirus module" "off"
OPTIONS+= VPN 		"VPN module" "off"
OPTIONS+= FILESERVER	"Fileserver module and SMB file server package" "off"
OPTIONS+= WATCHDOG 	"System monitoring module" "off"
OPTIONS+= SBM		"Sitebuilder module for Plesk" "off"
OPTIONS+= SB_PUBLISH	"SiteBuilder publishing support for Plesk" "off"
OPTIONS+= APPVAULT	"Application vault" "off"
OPTIONS+= RUBY_RAILS	"Ruby on Rails support" "off"
OPTIONS+= MOD_FCGID	"mod_fcgid module for apache server" "off"
OPTIONS+= MOD_BW	"mod_bw module for apache server" "off"
OPTIONS+= QMAIL_RBL	"SPAM blocker for QMail daemon" "off"

.include <bsd.port.pre.mk>

.if defined(WITH_PSA)
SUBDIR+= psa
SUBDIR+= plesk-skins
SUBDIR+= psa-php-configurator
SUBDIR+= psa-api-rpc
SUBDIR+= psa-horde
.endif

.if defined(WITH_ASP)
SUBDIR+= psa-apacheasp
.endif 

.if defined(WITH_MAILMAN)
SUBDIR+= psa-mailman-configurator
.endif 

.if defined(WITH_PGSQL)
SUBDIR+= psa-postgresql-configurator
.endif 

.if defined(WITH_TOMCAT)
SUBDIR+= psa-tomcat-configurator
.endif 

.if defined(WITH_SPAM)
SUBDIR+= psa-spamassassin
.endif 

.if defined(WITH_HORDE)
SUBDIR+= psa-imp
SUBDIR+= psa-ingo
SUBDIR+= psa-kronolith
SUBDIR+= psa-mnemo
SUBDIR+= psa-turba
SUBDIR+= psa-mimp 
SUBDIR+= psa-passwd
.endif 

.if defined(WITH_MANUALS)
SUBDIR+= psa-manual-custom-skin-guide
.endif 

.if defined(WITH_BACKUP)
SUBDIR+= psa-backup-manager
.endif 

.if defined(WITH_DRWEB)
SUBDIR+= psa-drweb-qmail
.endif 

.if defined(WITH_PPWSE)
SUBDIR+= psa-ppwse
.endif 

.if defined(WITH_API)
SUBDIR+= psa-api-rpc
.endif 

.if defined(WITH_SSHTERM)
SUBDIR+= psa-sshterm
.endif 

.if defined(WITH_PMM)
SUBDIR+= psa-migration-manager
.endif 

.if defined(WITH_FIREWALL)
SUBDIR+= psa-module-firewall
.endif 

.if defined(WITH_KAV)
SUBDIR+= psa-module-kav
.endif

.if defined(WITH_CSTRIKE)
SUBDIR+= psa-module-cs-gs
.endif 

.if defined(WITH_VPN)
SUBDIR+= psa-module-vpn
.endif 

.if defined(WITH_WATCHDOG)
SUBDIR+= psa-module-watchdog
.endif 

.if defined(WITH_FILESERVER)
SUBDIR+= psa-module-fileserver
.endif 

.if defined(WITH_SBM)
SUBDIR+= psa-sbm3
.endif 

.if defined(WITH_SB_PUBLISH)
SUBDIR+= psa-sb-publish
.endif 

.if defined(WITH_MIVA)
SUBDIR+= psa-miva
.endif

.if defined(WITH_APPVAULT)
SUBDIR+= psa-appvault
.endif

.if defined(WITH_RUBY_RAILS)
WITH_MOD_FCGID=1
SUBDIR+= psa-rubyrails-configurator
.endif

.if defined(WITH_MOD_FCGID)
SUBDIR+= psa-mod-fcgid-configurator
.endif

.if defined(WITH_MOD_BW)
SUBDIR+= psa-bandwith
.endif

.if defined(WITH_QMAIL_RBL)
SUBDIR+= psa-qmail-rblsmtpd
.endif

install sw-install: 
	@[ -d "${PORTSDIR}/${CATEGORIES}/work" ] && rm -rf ${PORTSDIR}/${CATEGORIES}/work
	@${MKDIR} ${PORTSDIR}/${CATEGORIES}/work
	@_test=$$(awk '/SW_PORTS_DATE/ {print;}' ${PORTSDIR}/UPDATING 2>/dev/null || true); \
	if [ -z "$$_test" ]; then \
		echo '' > ${PORTSDIR}/${CATEGORIES}/work/depends; \
	    for i in ${SUBDIR}; do \
		cd ${PORTSDIR}/${CATEGORIES}/$$i && make all-depends-list >> ${PORTSDIR}/${CATEGORIES}/work/depends; \
	    done; \
	    depends=$$(cat ${PORTSDIR}/${CATEGORIES}/work/depends | sort | uniq | sed -e 's|${PORTSDIR}/||g' | xargs echo -n); \
	    ${MAKE} -f plesk.install.mk DEPENDS="$$depends" sw-test-ports; \
	fi
	@${MAKE} index
.	for i in ${SUBDIR}
		cd ${PORTSDIR}/${CATEGORIES}/${i} && make sw-install
.	endfor

index: 
	@echo -n "==> Making indexes of Plesk ports.. "
	@for i in `find ${.CURDIR} -type d -depth 1`; do \
                cd $$i && make index >/dev/null 2>&1 || true; \
	done
	@echo "done"

clean:
	@rm -rf ${PORTSDIR}/${CATEGORIES}/work

.include <bsd.port.post.mk>

