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