diff options
author | sem <sem@FreeBSD.org> | 2005-04-21 15:02:05 +0800 |
---|---|---|
committer | sem <sem@FreeBSD.org> | 2005-04-21 15:02:05 +0800 |
commit | f794fc6197b0e18e3e4ecd9cd1f2738ac7471d07 (patch) | |
tree | 6cb312f6c294903d27d85fac389f44cb641d0eca /net/cacti | |
parent | 4b86782824e4a4e6b867cbc81a86f0aea8cf5103 (diff) | |
download | freebsd-ports-gnome-f794fc6197b0e18e3e4ecd9cd1f2738ac7471d07.tar.gz freebsd-ports-gnome-f794fc6197b0e18e3e4ecd9cd1f2738ac7471d07.tar.zst freebsd-ports-gnome-f794fc6197b0e18e3e4ecd9cd1f2738ac7471d07.zip |
- Fix removing logic for user config [1]
- Remove useless empty dirs
- Fix package
- Makefile refactoring
- Utilize SUB_FILES magic
- Update pkg-message
Reported by: kris (via pointyhat) [1]
Diffstat (limited to 'net/cacti')
-rw-r--r-- | net/cacti/Makefile | 28 | ||||
-rw-r--r-- | net/cacti/files/pkg-install.in (renamed from net/cacti/pkg-install) | 4 | ||||
-rw-r--r-- | net/cacti/files/pkg-message.in (renamed from net/cacti/pkg-message) | 7 | ||||
-rw-r--r-- | net/cacti/pkg-plist | 4 |
4 files changed, 21 insertions, 22 deletions
diff --git a/net/cacti/Makefile b/net/cacti/Makefile index e8247a057587..e703f216f50f 100644 --- a/net/cacti/Makefile +++ b/net/cacti/Makefile @@ -7,7 +7,7 @@ PORTNAME= cacti PORTVERSION= 0.8.6c -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net www MASTER_SITES= http://www.cacti.net/downloads/ @@ -35,32 +35,27 @@ USE_PHP= mysql pcre session xml WANT_PHP_WEB= yes NO_BUILD= yes PKGMESSAGE= ${WRKDIR}/pkg-message +PKGINSTALL= ${WRKDIR}/pkg-install +SUB_FILES= pkg-message pkg-install CACTIDIR?= share/cacti CACTIUSER?= cacti CACTIGROUP?= ${CACTIUSER} PLIST_SUB+= CACTIDIR=${CACTIDIR} - -post-extract: - @${RM} -rf ${WRKSRC}/cactid/.deps +SUB_LIST+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \ + CACTIGROUP=${CACTIGROUP} post-patch: - @${CAT} pkg-message | ${SED} -e 's|%%PREFIX%%|${PREFIX}| ; \ - s|%%LOCALBASE%%|${LOCALBASE}| ; \ - s|%%CACTIDIR%%|${CACTIDIR}| ; \ - s|%%CACTIUSER%%|${CACTIUSER}|' > ${PKGMESSAGE} + @${FIND} ${WRKSRC} -name \*.orig -delete; \ + ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig; \ + ${RM} -d ${WRKSRC}/include/lang/en ${WRKSRC}/include/lang -# Create cacti user/group and clean *.orig files pre-install: - @PREFIX=${PREFIX} CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \ - CACTIGROUP=${CACTIGROUP} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \ - cd ${WRKSRC}; \ - ${FIND} . -name \*.orig -delete + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \ do-install: @${MKDIR} ${PREFIX}/${CACTIDIR}; \ - ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig; \ - ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/ + ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \ if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \ ${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \ ${PREFIX}/${CACTIDIR}/include/config.php; \ @@ -68,8 +63,7 @@ do-install: # Fix permissions post-install: - @PREFIX=${PREFIX} CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \ - CACTIGROUP=${CACTIGROUP} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/net/cacti/pkg-install b/net/cacti/files/pkg-install.in index 86d8f0d137ed..da76801ae6b9 100644 --- a/net/cacti/pkg-install +++ b/net/cacti/files/pkg-install.in @@ -3,6 +3,10 @@ PW=/usr/sbin/pw UID=107 GID=${UID} +CACTIUSER=%%CACTIUSER%% +CACTIGROUP=%%CACTIGROUP%% +CACTIDIR=%%CACTIDIR%% +PREFIX=%%PREFIX%% case $2 in diff --git a/net/cacti/pkg-message b/net/cacti/files/pkg-message.in index 9b37b13e9b41..f2df9ffd151e 100644 --- a/net/cacti/pkg-message +++ b/net/cacti/files/pkg-message.in @@ -5,14 +5,17 @@ to make it work correctly. 1: Create the MySQL database # mysqladmin --user=root create cacti 2: Create a mysql user/password for cacti +(change user and/or password if requered) # echo "GRANT ALL ON cacti.* TO cactiuser at localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql && 3: Import the default cacti database # mysql cacti < %%PREFIX%%/%%CACTIDIR%%/cacti.sql -4: Edit your config.php +4: Edit include/config.php Specify the MySQL user, password and database for your cacti configuration. 5: Add a line to your /etc/crontab file similar to: */5 * * * * %%CACTIUSER%% %%LOCALBASE%%/bin/php %%PREFIX%%/%%CACTIDIR%%/poller.php > /dev/null 2>&1 -6: Point your web browser to the cacti dir and login with admin/admin +6: Add alias in apache config for the cacti dir +Alias /cacti "%%PREFIX%%/%%CACTIDIR%%/" +7: Open cacti login page in your web browser and login with admin/admin Have fun! ================================================================== diff --git a/net/cacti/pkg-plist b/net/cacti/pkg-plist index 6f01b6feb0a8..530ea61c03fc 100644 --- a/net/cacti/pkg-plist +++ b/net/cacti/pkg-plist @@ -126,9 +126,9 @@ %%CACTIDIR%%/images/transparent_line.gif %%CACTIDIR%%/include/auth.php %%CACTIDIR%%/include/bottom_footer.php +@unexec cmp -s %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php && rm -f %D/%%CACTIDIR%%/include/config.php %%CACTIDIR%%/include/config.php.orig @exec [ -f %D/%%CACTIDIR%%/include/config.php ] || cp %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php -@unexec if cmp -s %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php; then rm -f %D/%%CACTIDIR%%/include/config.php; fi %%CACTIDIR%%/include/config_arrays.php %%CACTIDIR%%/include/config_constants.php %%CACTIDIR%%/include/config_form.php @@ -379,8 +379,6 @@ @dirrm %%CACTIDIR%%/lib @dirrm %%CACTIDIR%%/install @dirrm %%CACTIDIR%%/include/treeview -@dirrm %%CACTIDIR%%/include/lang/en -@dirrm %%CACTIDIR%%/include/lang @dirrm %%CACTIDIR%%/include/jscalendar/lang @dirrm %%CACTIDIR%%/include/jscalendar @dirrm %%CACTIDIR%%/include/html |