aboutsummaryrefslogtreecommitdiff
path: root/network/nessus/nessus.build
blob: abea9992b759a20e55feb662f800e2a6e5bce92f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash

source /usr/src/ports/Build/build.sh

PACKAGER="Witukind <witukind@nsbm.kicks-ass.org>"
ARCH=i586
BUILD=1

# Sources
SRCNAME[0]=nessus-libraries
SRCVER[0]=2.3.1
SRCREP[0]=http://no/where
SRCPKG[0]=${SRCNAME[0]}-${SRCVER[0]}.tar.gz
SRCROOT[0]=${SRCNAME[0]}

SRCNAME[1]=libnasl
SRCVER[1]=${SRCVER[0]}
SRCREP[1]=http://no/where
SRCPKG[1]=${SRCNAME[1]}-${SRCVER[1]}.tar.gz
SRCROOT[1]=${SRCNAME[1]}

SRCNAME[2]=nessus-core
SRCVER[2]=${SRCVER[0]}
SRCREP[2]=http://no/where
SRCPKG[2]=${SRCNAME[2]}-${SRCVER[2]}.tar.gz
SRCROOT[2]=${SRCNAME[2]}

# Packages
PKGNAME[0]=nessus
PKGVER[0]=${SRCVER[0]}
PKGARCH[0]=${ARCH}

PKGNAME[1]=${PKGNAME[0]}_lib
PKGVER[1]=${SRCVER[0]}
PKGARCH[1]=${ARCH}
PKGOPTS[1]="nodocdir"

PKGNAME[2]=${PKGNAME[0]}_dev
PKGVER[2]=${SRCVER[0]}
PKGARCH[2]=${ARCH}
PKGOPTS[2]="nodocdir"

PKGNAME[3]=nessusd
PKGVER[3]=${SRCVER[0]}
PKGARCH[3]=${ARCH}
PKGOPTS[3]="nodocdir"

PKGNAME[4]=nasl
PKGVER[4]=${SRCVER[0]}
PKGARCH[4]=${ARCH}
PKGOPTS[4]="nodocdir"

begin

(
  cd ${SRC[0]}
  CFLAGS=$DISTFLAGS CXXFLAGS=$DISTFLAGS \
  ./configure \
  --enable-static=no \
  --enable-shared=yes \
  --prefix=/usr \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  --enable-cypher \
  $ARCH-pc-linux-gnu
  make
  make install DESTDIR=${PKG[1]}

  cd ${SRC[1]}
  CFLAGS="$DISTFLAGS -I${PKG[1]}/usr/include" \
  CXXFLAGS="$DISTFLAGS -I${PKG[1]}/usr/include" \
  LDFLAGS="-L${PKG[1]}/usr/lib" \
  NESSUSCONFIG=${PKG[1]}/usr/bin/nessus-config \
  ./configure \
  --enable-static=no \
  --enable-shared=yes \
  --prefix=/usr \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  $ARCH-pc-linux-gnu
  make
  make install DESTDIR=${PKG[1]}

  cd ${SRC[2]}
  CFLAGS="$DISTFLAGS -I${PKG[1]}/usr/include" \
  CXXFLAGS="$DISTFLAGS -I${PKG[1]}/usr/include" \
  LDFLAGS="-L${PKG[1]}/usr/lib" \
  NESSUSCONFIG=${PKG[1]}/usr/bin/nessus-config \
  ./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  --libdir=/usr/libexec \
  $ARCH-pc-linux-gnu
  make
  make install DESTDIR=${PKG[1]}

  mkdir -p \
   ${PKG[0]}/usr/{bin,man/man1} \
   ${PKG[2]}/usr/{bin,man/man1} \
   ${PKG[4]}/usr/{bin,man/man1}

  mv \
    ${PKG[1]}/usr/bin/*-config \
    ${PKG[2]}/usr/bin
 
  mv \
    ${PKG[1]}/usr/man/man1/*-config* \
    ${PKG[2]}/usr/man/man1

  mv \
    ${PKG[1]}/usr/include \
    ${PKG[2]}/usr

  # Nasl
  mv \
    ${PKG[1]}/usr/bin/nasl \
    ${PKG[4]}/usr/bin

  mv \
    ${PKG[1]}/usr/man/man1/nasl.1 \
    ${PKG[4]}/usr/man/man1

  mv \
   ${PKG[1]}/var \
   ${PKG[0]}

  rm -rf \
   ${PKG[1]}/usr/sbin
   ${PKG[1]}/usr/man
)

end nocleanup