La base di partenza e' stato questo articolo che ho trovato su Internet.
Download NTOP 4.1 da SourceForge
- wget http://downloads.sourceforge.net/project/ntop/ntop/Stable/ntop-4.1.0.tar.gz
- tar xvzf ntop-4.1.0.tar.gz
- cd /tmp/ntop-4.1.0/packages/RedHat
- cp /tmp/ntop-4.1.0.tgz /usr/src/redhar/SOURCES
- cp ntop* /usr/src/redhat/SOURCES
- mv /usr/src/redhat/SOURCES/ntop.spec /usr/src/redhat/SPECS
%define rpmversion 4.1
%define rpmsuffix 0
%define rpmrelease 1
%define rpmdistro el5
Summary: ntop shows the network usage
Name: ntop
Version: %{rpmversion}.%{rpmsuffix}
Release: %{rpmrelease}.%{rpmdistro}
Source: %{name}-%{rpmversion}.%{rpmsuffix}.tgz
Source1: ntop.init
Source2: ntop.logrotate
Source3: ntop.conf.sample
###Patch1: version.patch
%prep
echo Unpacked directory will be %{name}-%{rpmversion}.%{rpmsuffix}
%setup -q -n %{name}-%{rpmversion}.%{rpmsuffix}
# Patches
##%patch1 -p1
Modificare la sezione build rimuovendo tutti i comandi ed inserendo l'esecuzione del tool autogen.sh con opzioni aggiuntive come di seguito. autogen.sh passa quasiasi opzione sulla command line al tool configure
%build
unset RPM_OPT_FLAGS
%undefine optflags
# Now, configure and build ntop
./autogen.sh --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \
--target=x86_64-redhat-linux-gnu \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib64 \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info --enable-optimize --bindir=/usr/bin --datadir=/usr/share \
--enable-sslv3 \
--enable-i18n
make
Eseguire la build degli RPM
rpmbuild -bb /usr/src/redhat/SPECS/ntop.spec
Gli RPM si trovano sotto /usr/src/redhat/RPMS/x86_64 .
No comments:
Post a Comment