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