aboutsummaryrefslogtreecommitdiffstats
path: root/www/asterisk-stat/Makefile
diff options
context:
space:
mode:
authorlwhsu <lwhsu@FreeBSD.org>2007-07-28 17:21:15 +0800
committerlwhsu <lwhsu@FreeBSD.org>2007-07-28 17:21:15 +0800
commitdc7a98836bae2a12d044ac6568c25b9b20a668f3 (patch)
tree3ef3a32a31cf4c4c2b549d20d7c1f96ba272c286 /www/asterisk-stat/Makefile
parent8fcf85b4b115f4212bce9aed2b1509d189f67ac1 (diff)
downloadfreebsd-ports-gnome-dc7a98836bae2a12d044ac6568c25b9b20a668f3.tar.gz
freebsd-ports-gnome-dc7a98836bae2a12d044ac6568c25b9b20a668f3.tar.zst
freebsd-ports-gnome-dc7a98836bae2a12d044ac6568c25b9b20a668f3.zip
Add asterisk-stat 2.0.1, ASTERISK Call Detail Records Analizer.
PR: ports/113738 Submitted by: Fumihiko Kimura <jfkimura at yahoo.com>
Diffstat (limited to 'www/asterisk-stat/Makefile')
-rw-r--r--www/asterisk-stat/Makefile73
1 files changed, 73 insertions, 0 deletions
diff --git a/www/asterisk-stat/Makefile b/www/asterisk-stat/Makefile
new file mode 100644
index 000000000000..42b54b828dcb
--- /dev/null
+++ b/www/asterisk-stat/Makefile
@@ -0,0 +1,73 @@
+# New ports collection makefile for: www/asterisk-stat
+# Date created: 16 June 2007
+# Whom: Fumihiko Kimura <jfkimura@yahoo.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= asterisk-stat
+PORTVERSION= 2.0.1
+CATEGORIES= www
+MASTER_SITES= http://www.areski.net/${SITE_SUBDIR}/
+DISTNAME= ${PORTNAME}-v${PORTVERSION:S/./_/g}
+
+MAINTAINER= jfkimura@yahoo.com
+COMMENT= ASTERISK Call Detail Records Analizer
+
+LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd
+
+NO_BUILD= yes
+USE_APACHE= yes
+USE_PHP= session gd pcre
+WANT_PHP_WEB= yes
+ASTERISKDIR?= ${WWWDIR}
+SITE_SUBDIR= asterisk-stat-v2
+WRKSRC= ${WRKDIR}/${SITE_SUBDIR}
+SUB_FILES= pkg-message
+SUB_LIST+= ASTERISKDIR=${ASTERISKDIR}
+
+OPTIONS= PGSQL "Use PostgreSQL instead of MySQL" off
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 700000
+BROKEN= Depends on net/asterisk-addons which does not build on 7-CURRENT
+.endif
+
+.if defined(WITH_PGSQL)
+ASTERISKSTATDB= pgsql
+.else
+ASTERISKSTATDB= mysql
+# net/asterisk-addons
+RUN_DEPENDS+= ${LOCALBASE}/lib/asterisk/modules/cdr_addon_mysql.so:${PORTSDIR}/net/asterisk-addons
+.endif
+
+USE_PHP+= ${ASTERISKSTATDB}
+EXTRA_PATCHES+= ${FILESDIR}/${ASTERISKSTATDB}__patch-cdr.php \
+ ${FILESDIR}/${ASTERISKSTATDB}__patch-defines.php
+
+post-patch:
+ @${MV} ${WRKSRC}/images/print.css ${WRKSRC}/css
+ @${CP} ${WRKSRC}/images/spacer.gif ${WRKSRC}/images/clear.gif
+ @${CP} ${WRKSRC}/css/images/*png ${WRKSRC}/images
+ @${RM} ${WRKSRC}/about.php \
+ ${WRKSRC}/lib/defines.php.orig \
+ ${WRKSRC}/cdr.php.orig \
+ ${WRKSRC}/export_pdf.php.orig
+
+do-install:
+ @${MKDIR} ${ASTERISKDIR}
+ @${MV} ${WRKSRC}/lib/defines.php ${WRKSRC}/lib/defines.php-dist
+ ${CP} -r ${WRKSRC}/ ${ASTERISKDIR}
+ ${CP} ${FILESDIR}/cdr_${ASTERISKSTATDB}.tbl ${PREFIX}/etc/asterisk
+ ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${ASTERISKDIR}
+
+post-install:
+ @${FIND} ${WRKSRC}/${file} -not -type d \
+ | ${SED} -ne 's,^${WRKSRC},${ASTERISKDIR:S,^${TARGETDIR}/,,},p' >> ${TMPPLIST}
+ @${FIND} -d ${WRKSRC}/${file} -type d \
+ | ${SED} -ne 's,^${WRKSRC},@dirrm ${ASTERISKDIR:S,^${TARGETDIR}/,,},p' >> ${TMPPLIST}
+ @${ECHO} etc/asterisk/cdr_${ASTERISKSTATDB}.tbl >> ${TMPPLIST}
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>