]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
- add sample config
[packages/ntop.git] / ntop.spec
1 %define snap    03-02-13
2 Summary:        Network monitoring tool
3 Summary(pl):    Narzêdzie do monitorowania sieci
4 Name:           ntop
5 Version:        2.2
6 Release:        0.2
7 License:        GPL
8 Group:          Networking
9 Source0:        http://snapshot.ntop.org/tgz/%{name}-%{version}.tgz
10 # Source0-md5:  4586e4173fcab64d2394502603fc73aa
11 Source1:        %{name}.init
12 Source2:        %{name}.sysconfig
13 Source3:        %{name}.conf
14 Patch0:         %{name}-acam.patch
15 Patch1:         %{name}-externallib.patch
16 Patch2:         %{name}-perl.patch
17 URL:            http://www.ntop.org/
18 BuildRequires:  autoconf
19 BuildRequires:  automake
20 BuildRequires:  gd-devel >= 2.0.1
21 BuildRequires:  gdbm-devel >= 1.8.3
22 BuildRequires:  libpcap-devel
23 BuildRequires:  libpng-devel
24 BuildRequires:  libtiff-devel
25 BuildRequires:  libwrap-devel
26 BuildRequires:  libtool
27 BuildRequires:  ncurses-devel >= 5.2
28 BuildRequires:  openssl-devel >= 0.9.7c
29 BuildRequires:  readline-devel >= 4.2
30 BuildRequires:  zlib-devel
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 ntop is a tool that shows the network usage, similar to what the
35 popular top Unix command does.
36
37 %description -l pl
38 ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
39 robi to popularna Unixowa komenda top.
40
41 %prep
42 %setup -q
43 #%%patch0 -p1
44 cd %{name}*
45 %patch2 -p1
46 cd ../gdchart*
47 %patch1 -p1
48
49 %build
50 cd gdchart*
51 rm -rf gd-* zlib-*
52 %{__libtoolize}
53 %{__aclocal}
54 %{__autoconf}
55 %configure
56 %{__make}
57
58 cd ../%{name}*
59 #mv -f acinclude.m4.in acinclude.m4
60 #rm -f missing
61 #%%{__libtoolize}
62 %{__aclocal}
63 %{__autoconf}
64 %{__automake}
65 %configure \
66         --with-ossl-root=%{_prefix} \
67         --with-gdchart-root=`pwd`/../gdchart0.94c \
68         --enable-tcpwrap \
69         --with-gnu-ld \
70         --localstatedir=%{_var}/lib/%{name} || true
71
72 %configure \
73         --with-ossl-root=%{_prefix} \
74         --with-gdchart-root=`pwd`/../gdchart0.94c \
75         --enable-tcpwrap \
76         --with-gnu-ld \
77         --localstatedir=%{_var}/lib/%{name}
78
79
80 %{__make}
81 cd plugins
82 %{__make}
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 cd %{name}*
87 install -d      $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
88
89 %{__make} install \
90         DESTDIR=$RPM_BUILD_ROOT
91
92 #mv $RPM_BUILD_ROOT%{_bindir}/*.pem $RPM_BUILD_ROOT%{_datadir}/%{name}
93
94 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
95 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
96 install %{SOURCE3} $RPM_BUILD_ROOT/etc/ntop.conf
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %pre
102 if [ -n "`getgid ntop`" ]; then
103         if [ "`getgid ntop`" != "120" ]; then
104                 echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
105                 exit 1
106         fi
107 else
108         /usr/sbin/groupadd -g 120 -r -f ntop
109 fi
110 if [ -n "`id -u ntop 2>/dev/null`" ]; then
111         if [ "`id -u ntop`" != "120" ]; then
112                 echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
113                 exit 1
114         fi
115 else
116         /usr/sbin/useradd -u 120 -r -d /var/lib/ntop -s /bin/false -c "ntop User" -g ntop ntop 1>&2
117 fi
118
119 %post   
120 /sbin/ldconfig
121 /sbin/chkconfig --add ntop
122
123 %preun
124 if [ "$1" = "0" ]; then
125         if [ -f /var/lock/subsys/ntop ]; then
126                 /etc/rc.d/init.d/ntop stop 1>&2
127         fi
128         /sbin/chkconfig --del ntop
129 fi
130
131 %postun 
132 /sbin/ldconfig
133 if [ "$1" = "0" ]; then
134         /usr/sbin/userdel ntop
135         /usr/sbin/groupdel ntop
136 fi
137
138 %files
139 %defattr(644,root,root,755)
140 %doc ntop/AUTHORS ntop/NEWS ntop/README ntop/THANKS ntop/docs/1STRUN.TXT ntop/docs/FAQ
141 %dir %{_var}/lib/%{name}
142 %attr(755,root,root) %{_bindir}/*
143 %attr(755,root,root) %{_libdir}/lib*
144 #%attr(755,root,root) /usr/share/ntop/*
145 %attr(755,root,root) %{_datadir}/%{name}
146 #%%{_libdir}/lib*.la
147 #%dir %{_libdir}/%{name}
148 #%dir %{_libdir}/%{name}/plugins
149 %attr(755,root,root) %{_libdir}/%{name}/plugins
150 %{_mandir}/man*/*
151 %attr(755,root,root) /etc/rc.d/init.d/ntop
152 %attr(644,root,root) /etc/sysconfig/ntop
153 %attr(644,ntop,ntop) /etc/ntop.conf
This page took 0.121637 seconds and 3 git commands to generate.