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