updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / vuurmuur / PKGBUILD
blob2476862f04099b2303b7f284dac15b5afd578e54
1 # Maintainer: Valere Monseur <valere_monseur@hotmail.com>
2 # Contributor: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
3 # Contributor: (asper, noob
5 pkgname=vuurmuur
6 _pkgname=Vuurmuur
7 pkgver=0.7
8 pkgrel=7
9 pkgdesc="A powerful firewall manager built on top of iptables"
10 arch=('i686' 'x86_64')
11 url="http://www.vuurmuur.org"
12 license=('GPL')
13 depends=('iptables')
14 optdepends=('conntrack-tools: for connection tracking'
15             'iproute2: for traffic shapping'
16             'iptrafvol: for traffic volume logging')
17 backup=('etc/vuurmuur/config.conf'
18         'etc/vuurmuur/modules.conf'
19         'etc/vuurmuur/vuurmuur_conf.conf'
20         'etc/vuurmuur/plugins/textdir.conf'
21         'etc/logrotate.d/vuurmuur')
22 source=(http://downloads.sourceforge.net/${pkgname}/${_pkgname}-${pkgver}.tar.gz \
23         config.conf \
24         modules.conf \
25         rc.${pkgname})
26 install=vuurmuur.install
27 md5sums=('bad91aafcbea5e3a434440f88d722778'
28          '3b873578a13bcfc27b22d085f42560a2'
29          '20675e323030d71e740706e8096033d3'
30          '8a9526896b8043bfc08f22b2b4c9b7e2')
32 build() {
33   # extract tarballs
34   cd ${srcdir}/${_pkgname}-${pkgver} || return 1
35   for TARBALL in lib${pkgname}-${pkgver}.tar.gz ${pkgname}-${pkgver}.tar.gz ${pkgname}_conf-${pkgver}.tar.gz ; do
36     tar xzf $TARBALL || return 1
37   done
39   # build vuurmuur library
40   cd ${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver} || return 1
41   ./configure --prefix=/usr --sysconfdir=/etc || return 1
42   make || return 1
43   make DESTDIR=${pkgdir} install || return 1
45   # build vuurmuur
46   cd ${srcdir}/${_pkgname}-${pkgver}/${pkgname}-${pkgver} || return 1
47   sed -i -e 's|-rpath|-rpath-link|' configure || return 1
48   ./configure \
49         --prefix=/usr \
50         --sysconfdir=/etc \
51         --with-libvuurmuur-includes="${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src" \
52         --with-libvuurmuur-libraries="${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src" \
53         --with-widec=yes \
54         LDFLAGS="-L${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src \
55                  -L${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src/.libs \
56                  -Wl,-rpath=/usr/lib/${pkgname}/plugins" || return 1
57   make || return 1
58   make DESTDIR=${pkgdir} install || return 1
60   # build vuurmuur_conf
61   cd ${srcdir}/${_pkgname}-${pkgver}/${pkgname}_conf-${pkgver} || return 1
62   sed -i -e 's|-rpath|-rpath-link|' configure || return 1
63   ./configure \
64         --prefix=/usr \
65         --sysconfdir=/etc \
66         --with-libvuurmuur-includes="${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src" \
67         --with-libvuurmuur-libraries="${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src" \
68         --with-widec=yes \
69         LDFLAGS="-L${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src \
70                  -L${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/src/.libs \
71                  -Wl,-rpath=/usr/lib/${pkgname}/plugins" || return 1
72   make || return 1
73   make DESTDIR=${pkgdir} install || return 1
75   # install configuration
76   install -d -m700 ${pkgdir}/etc/${pkgname} || return 1
77   install -D -m600 ${srcdir}/config.conf  ${pkgdir}/etc/${pkgname}/config.conf || return 1
78   install -D -m600 ${srcdir}/modules.conf ${pkgdir}/etc/${pkgname}/modules.conf || return 1
79   install -D -m600 ${srcdir}/${_pkgname}-${pkgver}/${pkgname}_conf-${pkgver}/config/${pkgname}_conf.conf.sample \
80                    ${pkgdir}/etc/${pkgname}/${pkgname}_conf.conf || return 1
82   sed -i -e 's|/usr/bin/iptrafvol.pl|/usr/sbin/iptrafvol.pl|' \
83              ${pkgdir}/etc/${pkgname}/${pkgname}_conf.conf || return 1
85   install -d -m700 ${pkgdir}/etc/${pkgname}/plugins || return 1
86   echo "LOCATION=\"/etc/${pkgname}/textdir\"" > ${pkgdir}/etc/${pkgname}/plugins/textdir.conf || return 1
88   install -D -m644 ${pkgdir}/usr/share/${pkgname}/scripts/${pkgname}-logrotate ${pkgdir}/etc/logrotate.d/${pkgname} || return 1
90   # default firewall setup in /usr/share
91   install -d ${pkgdir}/usr/share/${pkgname}/textdir/{interfaces,services,zones,rules} || return 1
93   touch ${pkgdir}/usr/share/${pkgname}/textdir/rules/rules.conf || return 1
94   touch ${pkgdir}/usr/share/${pkgname}/textdir/rules/blocklist.conf || return 1
96   cp -R ${srcdir}/${_pkgname}-${pkgver}/zones/*   ${pkgdir}/usr/share/${pkgname}/textdir/zones/ || return 1
97   cp -R ${pkgdir}/usr/share/${pkgname}/services/* ${pkgdir}/usr/share/${pkgname}/textdir/services/ || return 1
99   # install daemon, log and doc
100   install -D -m755 ${srcdir}/rc.${pkgname} ${pkgdir}/etc/rc.d/${pkgname} || return 1
101   install -d -m700 ${pkgdir}/var/log/${pkgname} || return 1
103   for FILE in ${pkgdir}/usr/share/${pkgname}/help/*.hlp
104   do
105     mv ${FILE} ${FILE}.iso8859 || return 1
106     iconv -f ISO-8859-1 -t UTF-8 ${FILE}.iso8859 > ${FILE} || return 1
107   done
109   # install licenses
110   install -D -m644 ${srcdir}/${_pkgname}-${pkgver}/lib${pkgname}-${pkgver}/COPYING \
111                    ${pkgdir}/usr/share/licenses/lib${pkgname}/COPYING || return 1
113   install -D -m644 ${srcdir}/${_pkgname}-${pkgver}/${pkgname}-${pkgver}/COPYING \
114                    ${pkgdir}/usr/share/licenses/${pkgname}/COPYING || return 1
116   install -D -m644 ${srcdir}/${_pkgname}-${pkgver}/${pkgname}_conf-${pkgver}/COPYING \
117                    ${pkgdir}/usr/share/licenses/${pkgname}_conf/COPYING || return 1
119   # remove useless stuffs
120   rm -rf ${pkgdir}/usr/share/doc || return 1
121   rm -rf ${pkgdir}/usr/share/${pkgname}/services || return 1
122   rm -f  ${pkgdir}/usr/share/${pkgname}/help/vuurmuur-ru.UTF-8.hlp || return 1