Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # New ports collection makefile for: freepbx
- # Date created: 26 April 2007
- #
- # $FreeBSD$
- #
- # Based in primary port make of Phillip Neumann <pneumann@gmail.com>
- # Phillip Neumann autorized my work inside old PR.
- PORTNAME= freepbx
- PORTVERSION= 2.3.0
- CATEGORIES= www net
- MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
- MASTER_SITE_SUBDIR= amportal
- MAINTAINER=
- COMMENT= A modular web gui for Asterisk PBX
- OPTIONS= APACHE "Enable Apache13 support" off\
- APACHE2 "Enable Apache2 support" off\
- APACHE22 "Enable Apache22 support" off\
- LIGHTTPD "Enable Lighttpd support" on\
- MYSQL4 "Enable MySQL4 support" off\
- MYSQL5 "Enable MySQL5 support" on\
- SQLITE3 "Enable SQLite3 support" off\
- PHP4 "Enable PHP4 support" off\
- PHP5 "Enable PHP5 support" on
- RUN_DEPENDS= asterisk:${PORTSDIR}/net/asterisk \
- ${LOCALBASE}/lib/asterisk/modules/format_mp3.so:${PORTSDIR}/net/asterisk-addons \
- ${LOCALBASE}/share/pear/DB.php:${PORTSDIR}/databases/pear-DB \
- ${SITE_PERL}/Asterisk.pm:${PORTSDIR}/misc/p5-Asterisk \
- ${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet \
- ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql \
- ${SITE_PERL}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \
- ${LOCALBASE}/share/pear/Console/Getargs.php:${PORTSDIR}/devel/pear-Console_Getargs \
- bash:${PORTSDIR}/shells/bash
- WWWDIR?= www
- WEBPATH?= ${PREFIX}/${WWWDIR}/data/FreePBX
- TARGET?= ${WEBPATH}
- WWWCGI?= ${PREFIX}/${WWWDIR}/cgi-bin
- PANEL?= ${TARGET}/panel
- BASE_FREEPBX?= www
- PLIST_SUB= BASE_FREEPBX=${BASE_FREEPBX}
- WWWOWN?= www
- WWWGRP?= www
- DBUSER?= asteriskuser
- DBUSERPASS?= amp109
- DBHOST?= localhost
- ASTMGRUSER?= AsteriskUser
- ASTMGRPASS?= AsteriskPass
- HOSTNAME?= localhost
- #Until amportal looks more descent, prepare the files here
- EXEC_FILES= ${PREFIX}/bin/retrieve_conf \
- ${PREFIX}/bin/ampbackup.pl \
- ${PREFIX}/bin/fax-process.pl \
- ${PREFIX}/bin/retrieve_queues_conf_from_mysql.pl \
- ${PREFIX}/bin/retrieve_zap_conf_from_mysql.pl \
- ${PREFIX}/bin/retrieve_sip_conf_from_mysql.pl \
- ${PREFIX}/bin/retrieve_backup_cron_from_mysql.pl \
- ${PREFIX}/bin/retrieve_op_conf_from_mysql.pl \
- ${PREFIX}/bin/retrieve_iax_conf_from_mysql.pl \
- ${PREFIX}/bin/retrieve_parse_amportal_conf.pl \
- ${PREFIX}/share/asterisk/agi-bin/dialparties.agi \
- ${PREFIX}/share/asterisk/agi-bin/fixlocalprefix \
- ${PREFIX}/share/asterisk/agi-bin/phpagi.php \
- ${PREFIX}/share/asterisk/agi-bin/dialparties.agi.pl \
- ${PREFIX}/share/asterisk/agi-bin/list-item-remove.php \
- ${PREFIX}/share/asterisk/agi-bin/recordingcheck \
- ${PREFIX}/share/asterisk/agi-bin/directory \
- ${PREFIX}/share/asterisk/agi-bin/phpagi-asmanager.php \
- ${TARGET}/admin/bounce_op.sh \
- ${WWWCGI}/vmail.cgi
- NO_BUILD= yes
- PKGMESSAGE= ${WRKDIR}/pkg-message
- SUB_FILES= pkg-message
- SUB_LIST+= TARGET=${TARGET} DOCS=${DOCSDIR}
- PLIST_SUB+= WWWDIR=${PREFIX}/WWW
- DOCS= SQL/cdr_mysql_table.sql SQL/newinstall.sql docs/README.directory amportal-db-functions.sh amportal-db-remove.sh amportal-db-install.sh
- .include <bsd.port.pre.mk>
- .if defined(WITH_APACHE13) && defined(WITH_APACHE2)
- IGNORE= does not support both Apache13 and Apache2 - disable one of them
- APACHEDIR= www
- LIB_DEPENDS+= apache:${PORTSDIR}/www/apache13
- PLIST_SUB+= apache=""
- WANT_PHP_MOD= yes
- .else
- PLIST_SUB+= apache13="@comment "
- .endif
- .if defined(WITH_APACHE2) && defined(WITH_APACHE13)
- IGNORE= does not support both c-ares and IPv6 - disable one of them
- APACHEDIR= www
- LIB_DEPENDS+= apache2:${PORTSDIR}/www/apache2
- PLIST_SUB+= apache2=""
- WANT_PHP_MOD= yes
- .else
- PLIST_SUB+= apache2="@comment "
- .endif
- .if defined(WITH_APACHE22) && defined(WITH_APACHE2)
- IGNORE= does not support both - disable one of them
- APACHEDIR= www/apache22
- LIB_DEPENDS+= apache22:${PORTSDIR}/www/apache22
- PLIST_SUB+= apache22=""
- WANT_PHP_MOD= yes
- .else
- PLIST_SUB+= apache22="@comment "
- .endif
- .if defined(WITH_LIGHTTPD)
- LIB_DEPENDS+= lighttpd:${PORTSDIR}/www/lighttpd
- PLIST_SUB+= LIGHTTPD=""
- .else
- PLIST_SUB+= LIGHTTPD="@comment "
- .endif
- .if defined(WITH_MYSQL4) && defined(WITH_MYSQL5)
- IGNORE= does not support both MySQL4 and Mysql5 - disable one of them
- LIB_DEPENDS+= mysql:${PORTSDIR}/databases/mysql-server
- PLIST_SUB+= MYSQL=""
- .else
- PLIST_SUB+= MYSQL="@comment "
- .endif
- .if defined(WITH_MYSQL5) && defined
- IGNORE= does not support both MySQL4 and MySQL5- disable one of them
- LIB_DEPENDS+= mysql5:${PORTSDIR}/databases/mysql50-server
- PLIST_SUB+= MYSQL5=""
- .else
- PLIST_SUB+= MYSQL5="@comment "
- .endif
- .if defined(WITH_SQLITE3)
- LIB_DEPENDS+= sqlite3:${PORTSDIR}/databases/sqlite3
- PLIST_SUB+= SQLITE3=""
- .else
- PLIST_SUB+= SQLITE3="@comment "
- .endif
- .if defined(WITH_PHP4) && defined(WITH_PHP5)
- IGNORE= does not support both PHP4 and PHP5 - disable one of them
- LIB_DEPENDS+= php:${PORTSDIR}/lang/php
- PLIST_SUB+= PHP="gd gettext mysql session openssl posix"
- .else
- PLIST_SUB+= PHP="@comment "
- .endif
- .if defined(WITH_PHP5) && defined(WITH_PHP4)
- IGNORE= does not support both PHP4 and PHP5 - disable one of them
- LIB_DEPENDS+= php5:${PORTSDIR}/lang/php5
- PLIST_SUB+= PHP5="gd gettext mysql session openssl posix"
- .else
- PLIST_SUB+= PHP5="@comment "
- .endif
- post-patch:
- @${ECHO}
- @${ECHO} " NOTE: Apache22 user should define /apache22..."
- @${ECHO}
- .if exists(/tmp/mysql.sock)
- @(cd ${PATCHDIR} && ${PERL} install.pl --check-mysql)
- .else
- @(cd ${PATCHDIR} && ${PERL} install.pl --check-mysql)
- @(${RM} -rf ${WRKDIR})
- exit 1
- .endif
- .if !exists(${LOCALBASE}/etc/php.ini)
- @${ECHO}
- @${ECHO} Making a default php.ini...
- @${CP} ${PATCHDIR}/php${PHP_VER}.ini ${LOCALBASE}/etc/php.ini
- @${REINPLACE_CMD} -e 's|%%TARGET%%|${TARGET}|g' ${LOCALBASE}/etc/php.ini
- .endif
- do-install:
- @${ECHO} Backing up your asterisk configuration...
- @(cd ${PREFIX}/etc && ${CP} -ripf asterisk asterisk.orig)
- @(${CP} ${PATCHDIR}/amportal*.sh ${WRKSRC})
- @(cd ${WRKSRC}/amp_conf && ${CHMOD} -R +x bin sbin agi-bin cgi-bin)
- @(${FIND} ${WRKSRC}/amp_conf -type f | ${XARGS} ${REINPLACE_CMD} -e 's|/usr/bin/php|${LOCALBASE}/bin/php|g')
- @(${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -e 's|/var/lib/asterisk|${LOCALBASE}/share/asterisk|g')
- @(${FIND} ${WRKSRC} -type f -name "*.bak" | ${XARGS} rm)
- @(${FIND} ${WRKSRC} -type f -name "*.orig" | ${XARGS} rm)
- @(cd ${PATCHDIR} && ${PERL} install.pl --create-base)
- @(cd ${WRKSRC} && ./install_amp --username ${DBUSER} --password ${DBUSERPASS} --dbhost ${DBHOST} --fopwebroot=${PANEL} --webroot=${TARGET} --cgibin=${WWWCGI} --bin=${PREFIX}/bin --sbin=${PREFIX}/sbin --asteriskuser=${ASTMGRUSER} --asteriskpass=${ASTMGRPASS} --systemconfig=${PREFIX}/etc)
- @(${FIND} ${TARGET} -type d | ${XARGS} ${CHMOD} 755)
- @(${FIND} ${TARGET} -type f | ${XARGS} ${CHMOD} 644)
- @(${MKDIR} ${PREFIX}/share/asterisk/sounds/custom)
- @for WRITABLE in ${PREFIX}/etc/asterisk ${TARGET}/admin/modules ${PREFIX}/share/asterisk/sounds/custom /var/spool/asterisk; do\
- ${CHMOD} -R 755 $$WRITABLE; \
- ${CHOWN} -R ${WWWOWN}:${WWWGRP} $$WRITABLE; \
- done;
- .if !defined(NOPORTDOCS)
- @${MKDIR} ${DOCSDIR}
- @for doc in ${DOCS}; do \
- ${CP} ${WRKSRC}/$$doc ${DOCSDIR};\
- done;
- .endif
- @for EXECUTABLE in ${EXEC_FILES}; do\
- ${CHMOD} +x $$EXECUTABLE; \
- done;
- post-install:
- @(cd ${PATCHDIR} && ${PERL} install.pl --install-base)
- @${CAT} ${PKGMESSAGE}
- .include <bsd.port.post.mk>
Add Comment
Please, Sign In to add comment