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