]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
f789a45906b36ee5429a6a0d947a8646a07e9a68
[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 PreReq:         rc-scripts
32 Requires(pre):  /usr/bin/getgid
33 Requires(pre):  /bin/id
34 Requires(pre):  /usr/sbin/groupadd
35 Requires(pre):  /usr/sbin/useradd
36 Requires(post,preun):   /sbin/chkconfig
37 Requires(post,postun):  /sbin/ldconfig
38 Requires(postun):       /usr/sbin/groupdel
39 Requires(postun):       /usr/sbin/userdel
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 ntop is a tool that shows the network usage, similar to what the
44 popular top Unix command does.
45
46 %description -l pl
47 ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
48 robi to popularna Unixowa komenda top.
49
50 %prep
51 %setup -q
52 #%%patch0 -p1
53 cd %{name}*
54 %patch2 -p1
55 cd ../gdchart*
56 %patch1 -p1
57
58 %build
59 cd gdchart*
60 rm -rf gd-* zlib-*
61 %{__libtoolize}
62 %{__aclocal}
63 %{__autoconf}
64 %configure
65 %{__make}
66
67 cd ../%{name}*
68 #mv -f acinclude.m4.in acinclude.m4
69 #rm -f missing
70 #%%{__libtoolize}
71 %{__aclocal}
72 %{__autoconf}
73 %{__automake}
74 %configure \
75         --with-ossl-root=%{_prefix} \
76         --with-gdchart-root=`pwd`/../gdchart0.94c \
77         --enable-tcpwrap \
78         --with-gnu-ld \
79         --enable-i18n \
80         --enable-showoses \
81         --localstatedir=%{_var}/lib/%{name} || true
82
83 %configure \
84         --with-ossl-root=%{_prefix} \
85         --with-gdchart-root=`pwd`/../gdchart0.94c \
86         --enable-tcpwrap \
87         --with-gnu-ld \
88         --localstatedir=%{_var}/lib/%{name}
89
90
91 %{__make}
92 cd plugins
93 %{__make}
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 cd %{name}*
98 install -d      $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
99
100 %{__make} install \
101         DESTDIR=$RPM_BUILD_ROOT
102
103 #mv $RPM_BUILD_ROOT%{_bindir}/*.pem $RPM_BUILD_ROOT%{_datadir}/%{name}
104
105 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
106 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
107 install %{SOURCE3} $RPM_BUILD_ROOT/etc/ntop.conf
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %pre
113 if [ -n "`getgid ntop`" ]; then
114         if [ "`getgid ntop`" != "120" ]; then
115                 echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
116                 exit 1
117         fi
118 else
119         /usr/sbin/groupadd -g 120 -r -f ntop
120 fi
121 if [ -n "`id -u ntop 2>/dev/null`" ]; then
122         if [ "`id -u ntop`" != "120" ]; then
123                 echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
124                 exit 1
125         fi
126 else
127         /usr/sbin/useradd -u 120 -r -d /var/lib/ntop -s /bin/false -c "ntop User" -g ntop ntop 1>&2
128 fi
129
130 %post   
131 /sbin/ldconfig
132 /sbin/chkconfig --add ntop
133 if [ -f /var/lock/subsys/ntop ]; then
134         /etc/rc.d/init.d/ntop restart >&2
135 else
136         echo "Run \"/etc/rc.d/init.d/ntop start\" to start ntop daemon." >&2
137 fi
138
139 %preun
140 if [ "$1" = "0" ]; then
141         if [ -f /var/lock/subsys/ntop ]; then
142                 /etc/rc.d/init.d/ntop stop 1>&2
143         fi
144         /sbin/chkconfig --del ntop
145 fi
146
147 %postun 
148 /sbin/ldconfig
149 if [ "$1" = "0" ]; then
150         /usr/sbin/userdel ntop
151         /usr/sbin/groupdel ntop
152 fi
153
154 %files
155 %defattr(644,root,root,755)
156 %doc ntop/AUTHORS ntop/NEWS ntop/README ntop/THANKS 
157 #ntop/docs/1STRUN.TXT ntop/docs/FAQ
158 %dir %{_var}/lib/%{name}
159 %attr(755,root,root) %{_bindir}/*
160 %attr(755,root,root) %{_libdir}/lib*
161 #%attr(755,root,root) /usr/share/ntop/*
162 %attr(755,root,root) %{_datadir}/%{name}
163 #%%{_libdir}/lib*.la
164 #%dir %{_libdir}/%{name}
165 #%dir %{_libdir}/%{name}/plugins
166 %attr(755,root,root) %{_libdir}/%{name}/plugins
167 %{_mandir}/man*/*
168 %attr(754,root,root) /etc/rc.d/init.d/ntop
169 %attr(640,root,root) /etc/sysconfig/ntop
170 %attr(644,ntop,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop.conf
This page took 0.066607 seconds and 3 git commands to generate.