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