O Projeto BrazilFW Anuncia:
- - Repositório de códigos-fontes (Sources) de Add-ons para o Projeto BrazilFW:
O repositório de códigos-fontes de (Add-ons) da Versão 3.x do BFW estará neste diretório: http://www.brazilfw.com.br/downloads/addons/bfw3.x/sources.
Exemplo: Códigos-fontes do Addon Ntop: => http://www.brazilfw.com.br/downloads/addons/bfw3.x/sources/ntop/
Em cada sub-diretório de código-fonte de cada Add-on terá tambem:
Arquivo README listando os comandos necessários para compilar o add-on:
Exemplo: http://www.brazilfw.com.br/downloads/addons/bfw3.x/sources/ntop/README- Código: Selecionar todos
To compile the NTOP:
32bits mode:
rm -fr /tmp/build64
clean-rrdtool
build-rrdtool
build-gdbm 32
build-geoip 32
build-graphviz 32
build-ntop 32
64bits mode:
touch /tmp/build64
clean-rrdtool
build-rrdtool
build-gdbm 64
build-geoip 64
build-graphviz 64
build-ntop 64
e o Arquivo build listando o detalhamento para compilar o add-on:
Exemplo: http://www.brazilfw.com.br/downloads/addons/bfw3.x/sources/ntop/build-ntop- Código: Selecionar todos
#!/bin/sh
# Copyright (C) 2011 Washington Rodrigues <woshman@brazilfw.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
DIR=/usr/src
PAK=/tmp-addon
PAT=$(pwd)
[ -z "$1" ] && ARCH=64 || ARCH=$1
[ "$ARCH" = "32" ] && EXT="bfw" || EXT="bfw64"
rm -fr $PAK >/dev/null 2>&1
rm -fr $DIR/ntop-4.1.0
tar -vzxf ntop-4.1.0.tar.gz -C $DIR
cd $DIR/ntop-4.1.0
./autogen.sh --noconfig
LDFLAGS="-L/devel/rrdtool-1.4.5/src/.libs -L/usr/src/GeoIP-1.4.7/libGeoIP/.libs -L/usr/src/gdbm-1.10/src/.libs" \
CPPFLAGS="-I/usr/src/GeoIP-1.4.7/libGeoIP -I/devel/rrdtool-1.4.5/src -I/usr/src/gdbm-1.10/src" \
configure$ARCH --disable-static
rm libtool
ln -sf /usr/bin/libtool-$ARCH libtool
[ "$ARCH" = 64 ] && sed -i s,/lib\ ,/lib64\ ,g Makefile
sed -i s,"#define pthread_rwlock_trywrlock pthread_mutex_trywrlock","#define pthread_rwlock_trywrlock pthread_mutex_trylock",g globals-structtypes.h
make $PARALELL
make DESTDIR=$PAK install
cd $PAK/usr/local
cd lib
mkdir -p $PAK/lib
strip --strip-debug *.so*
rm -fr *.a
rm -fr *.la
mv *.so* $PAK/lib
cd ../bin
[ "$ARCH" = 32 ] && mv i586-pc-linux-gnu-ntop ntop || mv x86_64-pc-linux-gnu-ntop ntop
strip --strip-all ntop
cd ../share
rm -fr man
cd ntop
rm -fr python
mkdir -p $PAK/var/htdocs/{addons-menu,webadmin/icons}
mkdir -p $PAK/etc/init.d
cp -va $PAT/020-ntop-daemon $PAK/etc/init.d
cp -va $PAT/ntop.menu $PAK/var/htdocs/addons-menu
cp -va $PAT/ntop.png $PAK/var/htdocs/webadmin/icons
chmod +x $PAK/etc/init.d/020-ntop-daemon
cd $PAK
tar -cj * -f $DIR/ntop.$EXT
rm -fr $PAK >/dev/null 2>&1