27 | | use_configure no |
| 8 | github.setup bammv sguil 0.9.0 |
| 9 | name sguil-client |
| 10 | #version 0.9.0 |
| 11 | categories security net |
| 12 | license QPL-1 Permissive |
| 13 | maintainers nomaintainer |
| 14 | description GUI Console for Sguil Network Security Monitor |
| 15 | long_description ${description} |
| 16 | platforms darwin |
| 17 | supported_archs noarch |
| 18 | homepage https://bammv.github.io/sguil/ |
| 19 | #master_sites sourceforge:sguil |
| 20 | master_sites https://github.com/bammv/sguil/archive/ |
| 21 | distname v${version} |
| 22 | |
| 23 | worksrcdir sguil-${version} |
| 24 | |
| 25 | checksums rmd160 b01425bcbe20fcce51f6ad73f88482ddfa2a811f \ |
| 26 | sha256 412be894d67a6487312dd16a98a580dda8c38cff2e24f7a6c25405857769782b |
| 27 | |
| 28 | depends_build port:itcl \ |
| 29 | port:tclx \ |
| 30 | port:itk \ |
| 31 | port:iwidgets \ |
| 32 | port:tcllib \ |
| 33 | port:tcl-tls \ |
| 34 | port:openssl |
| 35 | |
| 36 | use_configure no |
48 | | xinstall -m 755 -d ${destroot}${sguilbin} |
49 | | xinstall -m 755 ${worksrcpath}/client/sguil.tk ${destroot}${sguilbin} |
50 | | xinstall -m 755 -d ${destroot}${sguillib} |
51 | | system "cp -R ${worksrcpath}/client/lib/* ${destroot}${sguillib}" |
52 | | xinstall -m 755 -d ${destroot}${sguildoc} |
53 | | system "cp ${worksrcpath}/doc/* ${destroot}${sguildoc}" |
54 | | xinstall -m 755 -d ${destroot}${sguiletc} |
55 | | xinstall -m 755 ${worksrcpath}/client/sguil.conf ${destroot}${sguiletc}/sguil.conf.sample |
| 57 | xinstall -m 755 -d ${destroot}${sguilbin} |
| 58 | xinstall -m 755 ${worksrcpath}/client/sguil.tk ${destroot}${sguilbin} |
| 59 | xinstall -m 755 -d ${destroot}${sguillib} |
| 60 | system "cp -R ${worksrcpath}/client/lib/* ${destroot}${sguillib}" |
| 61 | xinstall -m 755 -d ${destroot}${sguildoc} |
| 62 | system "cp ${worksrcpath}/doc/* ${destroot}${sguildoc}" |
| 63 | xinstall -m 755 -d ${destroot}${sguiletc} |
| 64 | xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name} |
| 65 | xinstall -m 644 ${worksrcpath}/client/sguil.conf ${destroot}${prefix}/share/examples/${name}/ |
| 66 | |
| 67 | if {${subport} eq "sguil-server"} { |
| 68 | xinstall -m 755 ${worksrcpath}/server/sguild ${destroot}${prefix}/sbin/ |
| 69 | xinstall -m 755 -d ${destroot}${prefix}/share/sguild |
| 70 | copy ${worksrcpath}/server/lib ${destroot}${prefix}/share/sguild/ |
| 71 | |
| 72 | xinstall -m 755 -d ${destroot}${prefix}/share/examples/sguild |
| 73 | copy ${worksrcpath}/server/sql_scripts ${destroot}${prefix}/share/examples/sguild/ |
| 74 | foreach f { sguild.conf sguild.users sguild.queries sguild.access } { |
| 75 | xinstall -m 644 ${worksrcpath}/server/${f} ${destroot}${prefix}/share/examples/sguild/ |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | post-activate { |
| 81 | if {${subport} eq "sguil-client"} { |
| 82 | if ![file exists ${sguiletc}/sguil.conf ] { |
| 83 | copy ${prefix}/share/examples/${name}/sguil.conf ${sguiletc}/ |
| 84 | } |
| 85 | } |
| 86 | if {${subport} eq "sguil-server"} { |
| 87 | foreach f { sguild.conf sguild.users sguild.queries sguild.access } { |
| 88 | if ![file exists ${prefix}/etc/sguild/${f} ] { |
| 89 | copy ${prefix}/share/examples/sguild/${f} ${prefix}/etc/sguild/ |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | if {${subport} eq ${name}} { |
| 96 | |
| 97 | conflicts ${name}-devel |
| 98 | |
| 99 | } |
| 100 | |
| 101 | subport ${name}-devel { |
| 102 | fetch.type git |
| 103 | git.url https://github.com/bammv/sguil.git |
| 104 | version 20140813 |
| 105 | git.branch b708fa838722ac6cd8c006d3d6587e800ef14e67 |
| 106 | |
| 107 | conflicts ${name} |
| 108 | |
| 109 | livecheck.type none |
| 111 | |
| 112 | subport sguil-server { |
| 113 | ## variant ? |
| 114 | depends_run-append port:mysql56-server port:mysqltcl |
| 115 | |
| 116 | add_users sguil group=sguil home=${prefix}/var/db/sguil shell=/sbin/nologin realname=sguil\ user |
| 117 | |
| 118 | notes-append " |
| 119 | *** To install sguil server *** |
| 120 | |
| 121 | 1) Install and create sguil database |
| 122 | |
| 123 | shell> mysql -u root -p mysql |
| 124 | mysql> GRANT ALL PRIVILEGES ON sguildb.* |
| 125 | TO sguil@localhost IDENTIFIED BY 'sguilpasswd'; |
| 126 | mysql> FLUSH PRIVILEGES; |
| 127 | |
| 128 | $ mysql -u sguil -p -e \"CREATE DATABASE sguildb\" |
| 129 | $ mysql -u sguil -p -D sguildb < ./server/sql_scripts/create_sguildb.sql |
| 130 | |
| 131 | 2) Install the GUI server (sguild) |
| 132 | ?port select --list tclsh NOK |
| 133 | |
| 134 | Check ${prefix}/etc/sguild files especially snort rules path. |
| 135 | Add user: |
| 136 | $ sguild -adduser <username> |
| 137 | |
| 138 | " |
| 139 | |
| 140 | startupitem.create yes |
| 141 | startupitem.name sguild |
| 142 | startupitem.executable "${prefix}/bin/sguild -D" |
| 143 | } |
| 144 | |
| 145 | notes-append " |
| 146 | |
| 147 | *** To finish sguil install *** |
| 148 | |
| 149 | 3) Install the GUI client (sguil.tk) |
| 150 | 4) Install the sensor |
| 151 | |
| 152 | " |
| 153 | |
| 154 | livecheck.type regex |
| 155 | livecheck.url ${homepage} |
| 156 | livecheck.regex ">Sguil (\\d+(?:\\.\\d+)*)" |