]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
- updated to 3.1
[packages/ntop.git] / ntop.spec
1 # TODO:
2 # there is a problem with --localstatedir=%{_var}/lib/%{name} (not building)
3 #
4 Summary:        Network monitoring tool
5 Summary(pl):    Narzêdzie do monitorowania sieci
6 Name:           ntop
7 Version:        3.1
8 Release:        0.1
9 License:        GPL
10 Group:          Networking
11 Source0:        http://dl.sourceforge.net/ntop/%{name}-%{version}.tgz
12 # Source0-md5:  1c9b4097c2e464b84f2fe8f6626d2b06
13 Source1:        %{name}.init
14 Source2:        %{name}.sysconfig
15 Patch1:         %{name}-plugins_makefile.patch
16 Patch2:         %{name}-conf.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.7d
29 BuildRequires:  readline-devel >= 4.2
30 BuildRequires:  rpmbuild(macros) >= 1.159
31 BuildRequires:  zlib-devel
32 PreReq:         rc-scripts
33 Requires(pre):  /bin/id
34 Requires(pre):  /usr/bin/getgid
35 Requires(pre):  /usr/sbin/groupadd
36 Requires(pre):  /usr/sbin/useradd
37 Requires(post,preun):   /sbin/chkconfig
38 Requires(post,postun):  /sbin/ldconfig
39 Requires(postun):       /usr/sbin/groupdel
40 Requires(postun):       /usr/sbin/userdel
41 Provides:       group(ntop)
42 Provides:       user(ntop)
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 ntop is a tool that shows the network usage, similar to what the
47 popular top Unix command does.
48
49 %description -l pl
50 ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
51 robi to popularna uniksowa komenda top.
52
53 %prep
54 %setup -q -n %{name}
55 %patch1 -p1
56 %patch2 -p1
57
58 %build
59 #mv -f acinclude.m4.in acinclude.m4
60 #rm -f missing
61 #%%{__libtoolize}
62 %{__aclocal}
63 %{__autoconf}
64 %{__automake}
65 %configure \
66         --with-ossl-root=%{_prefix} \
67         --with-gdchart-root=`pwd`/../gdchart0.94c \
68         --enable-tcpwrap \
69         --with-gnu-ld \
70         --enable-i18n \
71         --enable-showoses \
72         --localstatedir=%{_var}/lib/%{name} || true
73
74 %configure \
75         --with-ossl-root=%{_prefix} \
76         --with-gdchart-root=`pwd`/../gdchart0.94c \
77         --enable-tcpwrap \
78         --with-gnu-ld \
79         --localstatedir=%{_var}/lib/%{name}
80
81
82 %{__make}
83 cd plugins
84 %{__make}
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 install -d      $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
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/etc/ntop.conf
96
97 mv $RPM_BUILD_ROOT%{_libdir}/lib*Plugin*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins
98 rm $RPM_BUILD_ROOT%{_libdir}/*.a
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %pre
104 if [ -n "`/usr/bin/getgid ntop`" ]; then
105         if [ "`/usr/bin/getgid ntop`" != "120" ]; then
106                 echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
107                 exit 1
108         fi
109 else
110         /usr/sbin/groupadd -g 120 ntop
111 fi
112 if [ -n "`/bin/id -u ntop 2>/dev/null`" ]; then
113         if [ "`/bin/id -u ntop`" != "120" ]; then
114                 echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
115                 exit 1
116         fi
117 else
118         /usr/sbin/useradd -u 120 -d /var/lib/ntop -s /bin/false \
119                 -c "ntop User" -g ntop ntop 1>&2
120 fi
121
122 %post
123 /sbin/ldconfig
124 /sbin/chkconfig --add ntop
125 if [ -f /var/lock/subsys/ntop ]; then
126         /etc/rc.d/init.d/ntop restart >&2
127 else
128         echo "Run \"/etc/rc.d/init.d/ntop start\" to start ntop daemon." >&2
129 fi
130
131 %preun
132 if [ "$1" = "0" ]; then
133         if [ -f /var/lock/subsys/ntop ]; then
134                 /etc/rc.d/init.d/ntop stop 1>&2
135         fi
136         /sbin/chkconfig --del ntop
137 fi
138
139 %postun
140 /sbin/ldconfig
141 if [ "$1" = "0" ]; then
142         %userremove ntop
143         %groupremove ntop
144 fi
145
146 %files
147 %defattr(644,root,root,755)
148 %doc AUTHORS ChangeLog NEWS README THANKS
149 %attr(770,root,ntop) %dir %{_var}/lib/%{name}
150 %attr(755,root,root) %{_bindir}/*
151 %attr(755,root,root) %{_libdir}/lib*
152 %attr(755,root,root) %{_datadir}/%{name}
153 %dir %{_libdir}/%{name}
154 %attr(755,root,root) %{_libdir}/%{name}/plugins
155 %{_mandir}/man*/*
156 %attr(754,root,root) /etc/rc.d/init.d/ntop
157 %attr(640,root,root) /etc/sysconfig/ntop
158 %attr(750,root,ntop) %dir /etc/ntop
159 %attr(640,root,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop/*
160 %attr(644,root,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop.conf
This page took 0.082855 seconds and 3 git commands to generate.