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