Changeset 73174


Ignore:
Timestamp:
Nov 6, 2010, 1:44:12 AM (7 years ago)
Author:
markd@…
Message:

nedi: Closes #22088. Update to 1.0.5 to fix missing tarball. Path cleanup.

Location:
trunk/dports/net/nedi
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/net/nedi/Portfile

    r58230 r73174  
    44
    55name                    nedi
    6 version                 1.0
    7 revision                3
     6version                 1.0.5
    87categories              net
    98maintainers             markd
     
    1615
    1716homepage                http://www.nedi.ch/
    18 master_sites            http://nedi.web.psi.ch/
     17master_sites            http://www.nedi.ch/_media/files:
    1918
    2019extract.suffix          .tgz
    2120worksrcdir              ${name}
    22 checksums               md5 adae0699ea6d010d6d92f807f04ca442
    23 patchfiles              patch-html-Reports-Modules.php-diff
     21checksums               md5 6ed980228483addfdc5caf14430d7570
    2422
    2523depends_lib             path:bin/perl:perl5 \
     
    4644
    4745# Set some useful variables
    48 set nedidir ${prefix}/share
     46set nedidir ${prefix}/share/${name}
    4947set rrdbin ${prefix}/bin/rrdtool
    50 set rrdfiles ${nedidir}/${name}/rrd
     48set rrdfiles ${nedidir}/rrd
    5149set fpingpath ${prefix}/sbin
    5250set cacticlidir ${prefix}/share/cacti/cli
     
    5452startupitem.create      yes
    5553startupitem.name        nedimonitor
    56 startupitem.executable  ${nedidir}/${name}/moni.pl
     54startupitem.executable  ${nedidir}/moni.pl
    5755
    5856use_configure           no
    5957build {}
    6058
    61 post-patch {
    62         eval reinplace "s|__PREFIX__|${prefix}|g" \
    63                 [glob ${filespath}/*]
    64 }
     59#post-patch {
     60#       eval reinplace "s|__PREFIX__|${prefix}|g" \
     61#               [glob ${filespath}/*]
     62#}
    6563
    6664destroot {
    67         xinstall -m 755 -d ${destroot}${nedidir}
    68         system "cp -R ${worksrcpath} ${destroot}${nedidir}"
     65        file mkdir ${destroot}${nedidir}
     66        system "cp -R ${worksrcpath}/* ${destroot}${nedidir}"
    6967}
    7068
    7169post-destroot {
    7270# Fix general paths
    73        eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl|g" \
    74                 [glob ${destroot}${nedidir}/${name}/*.pl] \
    75                 [glob ${destroot}${nedidir}/${name}/inc/*.pl] \
    76                 [glob ${destroot}${nedidir}/${name}/html/inc/*.pl]
     71       eval reinplace "s|/usr/|${prefix}/|g" \
     72                [glob ${destroot}${nedidir}/*.pl] \
     73                [glob ${destroot}${nedidir}/inc/*.pl] \
     74                [glob ${destroot}${nedidir}/html/inc/*.pl] \
     75                [glob ${destroot}${nedidir}/contrib/*.pl]
    7776
    7877        reinplace "s|netstat|/usr/sbin/netstat|g" \
    79                 ${destroot}${nedidir}/${name}/inc/libmisc.pl
    80 
    81         reinplace "s|/etc/nedi.conf|${nedidir}/nedi/nedi.conf|g" \
    82                 ${destroot}${nedidir}/${name}/html/inc/libmisc.php
    83 
    84 # Fix rrdcmd and rrdpath variables in nedi.conf
     78                ${destroot}${nedidir}/inc/libmisc.pl
     79
     80        reinplace "s|/etc/nedi.conf|${nedidir}/nedi.conf|g" \
     81                ${destroot}${nedidir}/html/inc/libmisc.php
     82
     83# Fix rrdcmd location in nedi.conf
    8584        reinplace "s|rrdtool|${rrdbin}|g" \
    86                 ${destroot}${nedidir}/${name}/nedi.conf
    87         reinplace "s|/var/nedi/rrd|${rrdfiles}|g" \
    88                 ${destroot}${nedidir}/${name}/nedi.conf
     85                ${destroot}${nedidir}/nedi.conf
    8986
    9087# Fix fping path
    9188        reinplace "s|/usr/local/sbin|${fpingpath}|g" \
    92                 ${destroot}${nedidir}/${name}/html/Nodes-Toolbox.php
     89                ${destroot}${nedidir}/html/Nodes-Toolbox.php
    9390
    9491# Fix Cacti paths in nedi.conf
    9592        reinplace "s|/usr/bin/php /var/www/html/cacti/cli|${prefix}/bin/php ${cacticlidir}|g" \
    96                 ${destroot}${nedidir}/${name}/nedi.conf
     93                ${destroot}${nedidir}/nedi.conf
    9794
    9895# Create directory for rrd files
     
    10198# Keep these empty directories
    10299        destroot.keepdirs \
    103                 ${destroot}${nedidir}/${name}/db/cfg \
    104                 ${destroot}${nedidir}/${name}/html/log \
     100                ${destroot}${nedidir}/db/cfg \
     101                ${destroot}${nedidir}/html/log \
    105102                ${destroot}${rrdfiles}
    106103
    107104# Rename nedi.conf to nedi.conf.sample so port upgrades don't overwrite an installed nedi.conf
    108105# Also set permissions on nedi.conf because it has passwords.
    109         file rename ${destroot}${nedidir}/${name}/nedi.conf \
    110                 ${destroot}${nedidir}/${name}/nedi.conf.sample
    111                 system "chmod 600 ${destroot}${nedidir}/${name}/nedi.conf.sample"
     106        file rename ${destroot}${nedidir}/nedi.conf \
     107                ${destroot}${nedidir}/nedi.conf.sample
     108                system "chmod 600 ${destroot}${nedidir}/nedi.conf.sample"
    112109}
    113110
     
    1731704) Configure NeDi, initialize database, and Login to NeDi
    174171-----------------------------------------------
    175 -Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${nedidir}/${name}/
    176 -Apache symlink: ln -s ${nedidir}/${name}/html/  ${prefix}/apache2/htdocs/nedi
    177 -Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}/${name}/nedi.conf
     172-Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${nedidir}
     173-Apache symlink: ln -s ${nedidir}/html/  ${prefix}/apache2/htdocs/nedi
     174-Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}/nedi.conf
    178175        Leave nedi.conf permissions at 600 to protect your network passwords!
    179176backend         MSQ
     
    185182
    186183-Initialize the NeDi database:
    187         cd ${nedidir}/${name}
     184        cd ${nedidir}
    188185        sudo ./nedi.pl -i
    189186        When prompted for \"MySQL admin user:\" and enter 'root' and then MySQL root password.
     
    2052025) Discover Your Network with NeDi
    206203-----------------------------------------------
    207 -Edit nedi.conf Device Acc. variables: sudo pico ${nedidir}/${name}/nedi.conf
     204-Edit nedi.conf Device Acc. variables: sudo pico ${nedidir}/nedi.conf
    208205
    209206comm <my-community-string>
     
    214211-Make any other desired changes in nedi.conf
    215212-Start NeDi data collection:
    216         cd ${nedidir}/${name}
     213        cd ${nedidir}
    217214        sudo -u <nedi-user> nedi.pl -c -d (debug)
    218215-Put a command in the crontab to discover your network at regular intervals.
     
    222219        NeDi every hour, the cron entry is:
    223220
    224 0 * * * * cd ${nedidir}/${name} ; ./nedi.pl -c >> /dev/null 2>&1
     2210 * * * * cd ${nedidir} ; ./nedi.pl -c >> /dev/null 2>&1
    225222
    226223
     
    238235 snmptrapd.conf file with the entry:
    239236
    240         traphandle      default ${nedidir}/${name}/trap.pl
     237        traphandle      default ${nedidir}/trap.pl
    241238
    242239 Then load the startup script to run the Unix snmptrapd daemon:
Note: See TracChangeset for help on using the changeset viewer.