updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / sqlninja-svn / PKGBUILD
blob84be05b0d321d184d31b0d9e7a40d33b9ba80e13
1 # Contributor: fnord0 < fnord0 AT riseup DOT net >
3 pkgname=sqlninja-svn
4 pkgver=7
5 pkgrel=1
6 pkgdesc="A tool targeted to exploit SQL Injection vulnerabilities on a web application that uses Microsoft SQL Server as its back-end"
7 arch=('i686' 'x86_64')
8 url=("http://sqlninja.sourceforge.net")
9 license=('GPLv2')
10 depends=('perl' 'perl-netpacket' 'perl-net-pcap' 'perl-net-dns' 'perl-net-rawip' 'perl-io-socket-ssl')
11 makedepends=('subversion')
12 optdepends=('metasploit: to use the metasploit attack mode' 
13             'vnc: vncviewer, to use the VNC payload')
14 provides=('sqlninja')
15 conflicts=('sqlninja')
16 _svntrunk="https://sqlninja.svn.sourceforge.net/svnroot/sqlninja"
17 _svnmod=sqlninja
19 build() {
20         if [ -d ${srcdir}/.svn ]; then
21           msg 'Updating...'
22           svn up ${srcdir} || return 1
23         else
24           msg 'Checking out...'
25           svn co ${_svntrunk} ${srcdir} || return 1
26         fi
27         install -d ${pkgdir}/usr/{bin,src} || return 1
28         install -d ${pkgdir}/usr/share/licenses/${_svnmod} || return 1
29         cd ${pkgdir}/usr/src
30         svn export ${srcdir} ${_svnmod} || return 1
32         cd ${pkgdir}/usr/src/${_svnmod}
33         install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/${_svnmod}/LICENSE || return 1
35         # archlinux fixes
36         cd ${pkgdir}/usr/src/${_svnmod}
37         #check if metasploit-svn or metasploit stable is installed (-svn takes presidence)
38         #apply archlinux metasploit home directory to sqlninja.conf
39         if [ -d /usr/src/metasploit ]; then
40           sed -i 's|/home/icesurfer/trunk/|/usr/src/metasploit|g' ./sqlninja.conf || return 1
41         else
42           sed -i 's|/home/icesurfer/trunk/|/opt/metasploit|g' ./sqlninja.conf || return 1
43         fi
44         
45         #create startup app /usr/bin/sqlninja
46         echo "#!/bin/sh" > ${pkgdir}/usr/bin/${_svnmod}
47         echo "cd /usr/src/sqlninja" >> ${pkgdir}/usr/bin/${_svnmod}
48         echo "./sqlninja \"\$@\"" >> ${pkgdir}/usr/bin/${_svnmod}
49         echo "cd -" >> ${pkgdir}/usr/bin/${_svnmod}
50         chmod +x ${pkgdir}/usr/bin/${_svnmod}
52         #user notification
53         echo -e ""
54         echo -e "\e[1;31m[\e[0m\e[1;34m*\e[0m\e[1;31m]\e[0m \e[1;31mrun '\e[0m\e[1;34m/usr/bin/sqlninja\e[0m\e[1;31m' to call the application\e[0m"
55         echo -e "\e[1;31m[\e[0m\e[1;34m*\e[0m\e[1;31m]\e[0m \e[1;31ma default configuration file resides at '\e[0m\e[1;34m/usr/src/sqlninja/sqlninja.conf\e[0m\e[1;31m'\e[0m"
56         echo -e "\e[1;34m>>>\e[0m \e[1;31mthe sqlninja HOWTO resides at '\e[0m\e[1;34m/usr/src/sqlninja/sqlninja-howto.html\e[0m\e[1;31m'\e[0m"
57         echo -e "\e[1;34m>>>\e[0m \e[1;31mmore information @ \e[0m\e[1;32mhttp://sqlninja.sourceforge.net\e[0m"
58         echo -e ""
60 # vim:syntax=sh