diff options
author | M0Rf30 | 2015-06-17 15:24:53 +0200 |
---|---|---|
committer | M0Rf30 | 2015-06-17 15:24:53 +0200 |
commit | 89fdf028bf426c6ae63c61ffa1519e46b6187449 (patch) | |
tree | d7c2f84f78301a3a6cfc4fc7c24327796c26a6c2 | |
download | aur-89fdf028bf426c6ae63c61ffa1519e46b6187449.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | capana.conf | 22 | ||||
-rw-r--r-- | capanalysis.install | 39 | ||||
-rw-r--r-- | capanalysis.service | 13 |
5 files changed, 141 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3dc142d42004 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = capanalysis + pkgdesc = PCAP files from another point of view + pkgver = 1.1.3 + pkgrel = 1 + url = http://www.capanalysis.net/ + install = capanalysis.install + arch = i686 + arch = x86_64 + license = GPL + depends = glibc + depends = libpcap + depends = libpqxx + depends = sqlite + depends = openssl098 + depends = zlib + depends = wireshark-cli + depends = apache + depends = php-apache + depends = php-sqlite + depends = php-pgsql + depends = postgresql + source = http://www.capanalysis.net/pkg/capanalysis_1.1.3-trial_amd64.deb + source = capanalysis.service + source = capana.conf + md5sums = 5964cb23c2442013c8fae4ae0f5f9390 + md5sums = 9c33942e477795f97539cc7e57e404cf + md5sums = 9c8e3ca78f5dd0b8616b6c8b1e5e4e1e + +pkgname = capanalysis + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c4ae7cc238a8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Contributor: M0Rf30 + +pkgname=capanalysis +pkgver=1.1.3 +pkgrel=1 +arch=(i686 x86_64) +pkgdesc="PCAP files from another point of view" +url="http://www.capanalysis.net/" +license=('GPL') +_arch='amd64' +[[ "${CARCH}" = i686 ]] && _arch='i386' +depends=('glibc' 'libpcap' 'libpqxx' 'sqlite' 'openssl098' 'zlib' 'wireshark-cli' 'apache' 'php-apache' 'php-sqlite' 'php-pgsql' 'postgresql') + +source=(http://www.capanalysis.net/pkg/${pkgname}_${pkgver}-trial_${_arch}.deb + capanalysis.service + capana.conf) +install=capanalysis.install +md5sums=('5964cb23c2442013c8fae4ae0f5f9390' + '9c33942e477795f97539cc7e57e404cf' + '9c8e3ca78f5dd0b8616b6c8b1e5e4e1e') +[[ "${CARCH}" = i686 ]] && md5sums[0]='a8ec6f3c02118ee8597683c73a14eaa0' + +package() { + cd $srcdir/ + tar xvf data.tar.gz + mv {etc,opt,usr} $pkgdir + mkdir -p $pkgdir/etc/httpd/conf/extra + cp capana.conf $pkgdir/etc/httpd/conf/extra/httpd-capana.conf + rm -r $pkgdir/etc/{apache2,init.d} + rm -r $pkgdir/usr/share/applications + install -Dm644 capanalysis.service "${pkgdir}"/usr/lib/systemd/system/capanalysis.service + sed -i 's/sudo service capanalysis start/sudo systemctl start capanalysis.service/g' $pkgdir/opt/capanalysis/www/capinstall/app/pages/default/default.php + sed -i 's/sudo service postgresql restart/sudo systemctl start postgresql.service/g' $pkgdir/opt/capanalysis/www/capinstall/app/pages/default/default.php + + ln -s -r /usr/lib/libpcap.so $pkgdir/usr/lib/libpcap.so.0.8 +} + diff --git a/capana.conf b/capana.conf new file mode 100644 index 000000000000..93f5acc005f5 --- /dev/null +++ b/capana.conf @@ -0,0 +1,22 @@ +Listen 9877 + +<VirtualHost *:9877> + ServerAdmin info@capanalysis.net + + DocumentRoot /opt/capanalysis/www + <Directory "/opt/capanalysis/www"> + Options All + AllowOverride All + Require all granted + php_admin_value open_basedir "/opt/capanalysis:/tmp:/var/run" + </Directory> + + ErrorLog /var/log/httpd/capana_error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog /var/log/httpd/capana_access.log combined + +</VirtualHost> diff --git a/capanalysis.install b/capanalysis.install new file mode 100644 index 000000000000..41d3acaa799e --- /dev/null +++ b/capanalysis.install @@ -0,0 +1,39 @@ + +pre_install() { + if [ -f /opt/capanalysis/cfg/canalysis.cfg ]; then + if [ -d /opt/capanalysis/www/app/tmp/cache ]; then + rm -rf /opt/capanalysis/www/app/tmp/cache/models/* + rm -rf /opt/capanalysis/www/app/tmp/cache/views/* + rm -rf /opt/capanalysis/www/app/tmp/sessions/* + rm -rf /opt/capanalysis/www/app/tmp/logs/* + fi + cp /opt/capanalysis/cfg/canalysis.cfg /opt/capanalysis/cfg/canalysis.cfg.backup + fi + +} + post_install() { + if [ -f /opt/capanalysis/cfg/canalysis.cfg.backup ]; then + # upgrade DB + mv /opt/capanalysis/cfg/canalysis.cfg /opt/capanalysis/cfg/canalysis.cfg.last + cp /opt/capanalysis/cfg/canalysis.cfg.backup /opt/capanalysis/cfg/canalysis.cfg + fi + + chown -R http:http /opt/capanalysis + echo "Rember to paste this line" + echo " # Capanalysis" + echo " Include conf/extra/httpd-capana.conf" + echo "in /etc/httpd/conf/httpd.conf" + echo "Uncomment sqlite and pear in /etc/php/php.ini" + echo "Set the paramater date.timezone in your php.ini: for example date.timezone = "Europe/Rome"" +} + +post_remove(){ + if [ -d /opt/capanalysis ]; then + rm -rf /opt/capanalysis + echo 'drop database capanalysis;' > /tmp/dbrm + echo 'drop user capana;' >> /tmp/dbrm + sudo -u postgres psql -f /tmp/dbrm + rm -f /tmp/dbrm + fi + echo "Don't forget to restore php.ini and httpd.conf files" +} diff --git a/capanalysis.service b/capanalysis.service new file mode 100644 index 000000000000..ea5e69311cd1 --- /dev/null +++ b/capanalysis.service @@ -0,0 +1,13 @@ +[Unit] +Description=Capanalysis +After=network.target syslog.target + +[Service] +Type=forking +PrivateTmp=true +ExecStart=/opt/capanalysis/bin/capanalysis -c /opt/capanalysis/cfg/canalysis.cfg +Restart=always +PIDFile=/var/run/capana.pid + +[Install] +WantedBy=multi-user.target |