updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / netcat-crypto / PKGBUILD
blob8db36432ec8c636822df10b56732fa81e004afa0
1 # Contributor: ice-man <icemanf@gmail.com>
2 pkgname=netcat-crypto
3 pkgver=1.10
4 pkgrel=1
5 pkgdesc="The network swiss army knife with ipv6 and crypto support"
6 url="http://www.securityfocus.com/data/tools/nc110.tgz"
7 provides=('netcat')
8 conflicts=('netcat')
9 makedepends=('glibc' 'gcc' 'make')
10 depends=('libmix')
11 source=('http://www.securityfocus.com/data/tools/nc110.tgz'
12         'ftp://sith.mimuw.edu.pl/pub/users/baggins/IPv6/nc-v6-20000918.patch.gz'
13         'netcat-110-patches-1.0.tar.bz2')
14 md5sums=('402632f2fe01c169ff19a0ad6e9d608c' '84d850745dd860aedce64b518e0e3330' 'd2ae47e06e13a824c0dbe555d56ba7cd')
16 build() {
17   # Build options
18   export XLIBS="-lmix"
19   export XFLAGS="-DLINUX -DTELNET -DINET6 -DAESCRYPT -DGAPING_SECURITY_HOLE"
21   cd $startdir/src
22   
23   echo -e "\nPATCHING THE SOURCE\n-------------------------------"
24   # ipv6 support
25   patch -p1 < nc-v6-20000918.patch > /dev/null
26   echo "nc-v6-20000918.patch applied"
27   
28   # Other patches
29   bzcat ./patch/00_all_unstripped.patch.bz2 | patch -p1 > /dev/null
30   echo "00_all_unstripped.patch applied"
31   bzcat ./patch/01_all_glibc_resolv_h.patch.bz2 | patch -p1 > /dev/null
32   echo "01_all_glibc_resolv_h.patch applied"
33   bzcat ./patch/02_all_arm_timer.patch.bz2 | patch -p1 > /dev/null
34   echo "02_all_arm_timer.patch applied"
35   bzcat ./patch/03_all_posix_setjmp.patch.bz2 | patch -p1 > /dev/null
36   echo "03_all_posix_setjmp.patch applied"
37   bzcat ./patch/10_all_nopunt.patch.bz2 | patch -p1 > /dev/null
38   echo "10_all_nopunt.patch applied"
39   bzcat ./patch/11_all_nosleep.patch.bz2 | patch -p1 > /dev/null
40   echo "11_all_nosleep.patch applied"
41   bzcat ./patch/12_all_single_verbose_ipv6.patch.bz2 | patch -p1 > /dev/null
42   echo "12_all_single_verbose_ipv6.patch applied"
43   bzcat ./patch/13_all_use_getservbyport.patch.bz2 | patch -p1 > /dev/null
44   echo "13_all_use_getservbyport.patch applied"
45   bzcat ./patch/14_all_read_overflow.patch.bz2 | patch -p1 > /dev/null
46   echo "14_all_read_overflow.patch applied"
47   bzcat ./patch/15_all_help_write_to_stdout.patch.bz2 | patch -p0 > /dev/null
48   echo "15_all_help_write_to_stdout.patch applied"
49   bzcat ./patch/20_all_inet_aton.patch.bz2 | patch -p1 > /dev/null
50   echo "20_all_inet_aton.patch applied"
51   bzcat ./patch/21_all_udp_broadcast_ipv6.patch.bz2 | patch -p1 > /dev/null
52   echo "21_all_udp_broadcast_ipv6.patch applied"
53   bzcat ./patch/22_all_quit_ipv6.patch.bz2 | patch -p1 > /dev/null
54   echo "22_all_quit_ipv6.patch applied"
55   bzcat ./patch/23_all_dash_port.patch.bz2 | patch -p1 > /dev/null
56   echo "23_all_dash_port.patch applied"
57   bzcat ./patch/24_all_sh_c.patch.bz2 | patch -p1 > /dev/null
58   echo "24_all_sh_c.patch applied"
59   bzcat ./patch/50_all_aes_crypto.patch.bz2 | patch -p1 > /dev/null
60   echo "50_all_aes_crypto.patch applied"
62   echo -e "\nSOURCE PATCHED!\n\n"
64   cp netcat.c netcat.c.orig
65   sed 's/res_init();//' netcat.c.orig >netcat.c
66   sed -i 's:#define HAVE_BIND:#undef HAVE_BIND:' netcat.c
67   sed -i 's:#define FD_SETSIZE 16:#define FD_SETSIZE 1024:' netcat.c
69   make -e CC="/usr/bin/gcc ${CFLAGS}" nc || return 1
70   mkdir -p $startdir/pkg/usr/bin
71   mkdir -p $startdir/pkg/usr/share/man/man1
72   cp nc $startdir/pkg/usr/bin
73   gzip nc.1
74   cp nc.1.gz $startdir/pkg/usr/share/man/man1