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