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