]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
- kill unnecessary linking
[packages/ntop.git] / ntop.spec
1 # TODO:
2 #  - duplicate configure. remove or write down reason.
3 #  - configure appears to need gawk
4 #  - service ntop init steals terminal (it doesnt finish nor background)
5 #  - paths wrong somewhere /var/lib/ntop/ntop is expected (should be without last path component)
6 #  - /var/lib/ntop/* should be %ghost
7 #  - .la files should be in -devel
8 #  - ntop apperars to be daemon, so it should be in _sbindir not in _bindir
9 #
10 Summary:        Network monitoring tool
11 Summary(pl):    Narzêdzie do monitorowania sieci
12 Name:           ntop
13 Version:        3.1
14 Release:        0.2
15 License:        GPL
16 Group:          Networking
17 Source0:        http://dl.sourceforge.net/ntop/%{name}-%{version}.tgz
18 # Source0-md5:  1c9b4097c2e464b84f2fe8f6626d2b06
19 Source1:        %{name}.init
20 Source2:        %{name}.sysconfig
21 Patch0:         %{name}-plugins_makefile.patch
22 Patch1:         %{name}-conf.patch
23 Patch2:         %{name}-DESTDIR.patch
24 URL:            http://www.ntop.org/
25 BuildRequires:  autoconf
26 BuildRequires:  automake
27 BuildRequires:  gd-devel >= 2.0.1
28 BuildRequires:  gdbm-devel >= 1.8.3
29 BuildRequires:  libpcap-devel
30 BuildRequires:  libpng-devel
31 BuildRequires:  libtiff-devel
32 BuildRequires:  libwrap-devel
33 BuildRequires:  libtool
34 BuildRequires:  ncurses-devel >= 5.2
35 BuildRequires:  openssl-devel >= 0.9.7d
36 BuildRequires:  readline-devel >= 4.2
37 BuildRequires:  rpmbuild(macros) >= 1.202
38 BuildRequires:  zlib-devel
39 PreReq:         rc-scripts
40 Requires(pre):  /bin/id
41 Requires(pre):  /usr/bin/getgid
42 Requires(pre):  /usr/sbin/groupadd
43 Requires(pre):  /usr/sbin/useradd
44 Requires(post,preun):   /sbin/chkconfig
45 Requires(post,postun):  /sbin/ldconfig
46 Requires(postun):       /usr/sbin/groupdel
47 Requires(postun):       /usr/sbin/userdel
48 Provides:       group(ntop)
49 Provides:       user(ntop)
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
53 ntop is a tool that shows the network usage, similar to what the
54 popular top Unix command does.
55
56 %description -l pl
57 ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
58 robi to popularna uniksowa komenda top.
59
60 %prep
61 %setup -q -n %{name}
62 %patch0 -p1
63 %patch1 -p1
64 %patch2 -p1
65
66 %build
67 #mv -f acinclude.m4.in acinclude.m4
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 %{__make} -C plugins
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 install -d $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
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/etc/ntop.conf
102
103 mv $RPM_BUILD_ROOT%{_libdir}/lib*Plugin*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins
104 rm $RPM_BUILD_ROOT%{_libdir}/*.a
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %pre
110 %groupadd -g 120 ntop
111 %useradd -u 120 -d /var/lib/ntop -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 %{_var}/lib/%{name}
141 %attr(755,root,root) %{_bindir}/*
142 %attr(755,root,root) %{_libdir}/lib*
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) /etc/sysconfig/ntop
149 %attr(750,root,ntop) %dir /etc/ntop
150 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) /etc/ntop/*
151 %attr(644,root,ntop) %config(noreplace) %verify(not md5 mtime size) /etc/ntop.conf
This page took 0.077879 seconds and 4 git commands to generate.