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