source: trunk/dports/net/nedi/Portfile @ 14151

Last change on this file since 14151 was 14151, checked in by markd, 15 years ago

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

  • Property svn:eol-style set to native
File size: 5.2 KB
Line 
1# $Id: Portfile,v 1.1 2005/09/18 23:28:22 markd Exp $
2
3PortSystem      1.0
4
5name                            nedi
6version                         1.0.v
7
8categories                      net
9maintainers                     markd@opendarwin.org
10platforms                       darwin
11
12description                     Network Discovery Suite
13
14long_description                A low noise network discovery, management, and inventory \
15                                system for Cisco networks with a user friendly web interface.
16
17homepage                        http://nedi.web.psi.ch/
18                                       
19master_sites                    http://nedi.web.psi.ch/
20
21distname                      ${name}-${version}
22extract.suffix                  .tgz
23
24checksums                       md5 4759ab5f93008f583a42e8354fafcb2d
25
26depends_lib                     port:perl5.8 \
27                                port:p5-net-snmp \
28                                port:p5-net-telnet \
29                                port:p5-net-telnet-cisco \
30                                port:p5-algorithm-diff \
31                                port:p5-dbi \
32                                port:p5-dbd-mysql
33
34worksrcdir              ${name}-${version}
35
36use_configure                   no
37build {}
38
39extract {}
40patch {}
41
42destroot {
43        xinstall -d ${worksrcpath}
44        xinstall -d ${destroot}${prefix}/var
45        system "cd ${destroot}${prefix}/var  && gzip -dc ${distpath}/${distname}.tgz | \
46                /usr/bin/gnutar --no-same-owner -xf -"
47
48# Keep nedi.conf from prying eyes because it has passwords!
49        system "chmod 600 ${destroot}${prefix}/var/${name}/nedi.conf"
50}
51
52post-destroot {
53# Fix paths
54       eval reinplace "s|/usr/bin/perl|/opt/local/bin/perl|g" \
55                [glob ${destroot}${prefix}/var/${name}/*.pl] \
56                [glob ${destroot}${prefix}/var/${name}/inc/*.pl] \
57                [glob ${destroot}${prefix}/var/${name}/html/inc/*.pl]
58
59        reinplace "s|netstat|/usr/sbin/netstat|g" \
60                ${destroot}${prefix}/var/${name}/inc/libmisc.pl
61
62# Keep these empty directories
63        destroot.keepdirs \
64                ${destroot}${prefix}/var/${name}/db/cfg \
65                ${destroot}${prefix}/var/${name}/html/log
66}
67
68
69post-activate {
70
71ui_msg "\n#### To complete the NeDi OS X installation ####
72
731) Download Applications
74------------------------------------------------
75-Download Complete Apache 2, Complete PHP, and Complete MySQL
76        http://www.serverlogistics.com/downloads.php
77
78  Notes about Apache, PHP, and MySQL
79  ----------------------------------
80  NeDi requires PHP with SNMP support enabled, which is a non-default option
81  and extremely challenging to compile into PHP.  Complete PHP is the only
82  PHP binary installer that has it -Complete PHP requires Complete Apache 2.
83  NeDi requires the MySQL 4.0.x series -the easiest way to install that is
84  with Complete MySQL.  All this entails using packages from Server Logistics
85  for Apache, PHP, and MySQL in combination to run NeDi.
86
87
882) Create an OS X nedi user (or choose an existing one) using the Accounts
89   pane in System Preferences
90
91
923) Install Complete Apache 2 (version 2.0.52)
93------------------------------------------------
94-Turn off Personal Web Sharing
95-Run Apache2.pkg installer
96-Drag Apache2.prefPane to /Library/PreferencePanes
97        Create this folder if it does not exist
98-Edit httpd.conf: pico /Library/Apache2/conf/httpd.conf
99
100User <nedi-user>
101Group <nedi-group>
102
103-Start Apache 2 via System Preferences pane
104
105
1064) Install Complete PHP 4 (version 4.3.9)
107------------------------------------------------
108-Run PHP4.pkg installer
109-Drag test.php to /Library/Apache2/htdocs
110-Start Apache via the Apache 2 System Preferences pane
111-Test PHP with this link: http://localhost/test.php
112
113
1145) Install Complete MySQL (version 4.0.21)
115------------------------------------------------
116-Run MySQL.pkg installer
117-Drag MySQL.prefPane to /Library/PreferencePanes
118-Add /Library/MySQL/bin to the *front* of your path statement in ~/.bash_profile
119-Use the MySQL Pane in System Preferences to initialize, set a root password, & start MySQL
120
121  NOTE:
122  A copy of MySQL 4.1.x is installed automatically during the NeDi DarwinPorts
123  install (below) because NeDi requires a MySQL Perl module, the installation
124  of which triggers a DarwinPorts MySQL install.  That version won't run if we
125  just ignore it, and we'll do that because NeDi does not work with MySQL 4.1.x.
126
127
1286) Configure, and Login to NeDi
129-----------------------------------------------
130-Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${prefix}/var/${name}/
131-Apache symlink: ln -s ${prefix}/var/${name}/html/  /Library/Apache2/htdocs/nedi
132-MySQL symlink: ln -s /tmp/mysql.sock  /opt/local/var/run/mysqld/mysqld.sock
133-Edit nedi.conf Backend/Authen. vars: sudo pico ${prefix}/var/${name}/nedi.conf
134        Leave nedi.conf permissions at 600 to protect your network passwords!
135backend         MSQ
136dbpass          <nedidb-access-pwd>
137authuser        mysql
138
139-Initialize the NeDi database: ${prefix}/var/${name}/nedi.pl -i
140        Enter 'root' and the MySQL root password when prompted
141-Login to the NeDi web interface: http://localhost/nedi/index.php
142        Initial user/pass is 'admin'/'admin'
143
144
1457) Discover Your Network with NeDi
146-----------------------------------------------
147-Edit the seedlist file: pico ${prefix}/var/${name}/seedlist
148-Edit nedi.conf Device Acc. variables: sudo pico ${prefix}/var/${name}/nedi.conf
149
150comm <my-community-string>
151<usr>  <pass>  <enablepass>
152
153-Make any other desired changes in nedi.conf
154-Start NeDi data collect.: sudo -u <nedi-user> ${prefix}/var/${name}/nedi.pl -c
155        Use -d for debug output until you know NeDi is running properly.
156-Put a command in the crontab to discover your network at regular intervals.
157        For example, to run NeDi every day at 11:00 and 3:00:
1581 11,15 * * * cd ${prefix}/var/${name} ; ./nedi.pl -c >> /dev/null 2>&1
159\n"
160}
Note: See TracBrowser for help on using the repository browser.