File cheops-ng.spec of Package cheops-ng

# norootforbuild

%if 0%sles_version == 10 || 0%suse_version == 1010
%define xpm_lib xorg-x11-devel
%if 0%sles_version == 9
%define xpm_lib XFree86-devel
%define xpm_lib xorg-x11-libXpm-devel

Summary:	Multipurpose network exploration tool
Name:		cheops-ng
Version:	0.2.3
Release:	1
License:	GPL
Group:		Networking/Other
Source0:	%{name}-%{version}.tar.bz2
Source1:	cheops-agent.init
Source2:        sysconfig.cheops-agent
Source3:        cheopsng-rpmlintrc
Patch:		%{name}-errno.patch
Patch1:         cheops-ng-missing_autoheader_templates.patch
Patch2:         cheops-ng-modernize_configure.patch
Patch3:         cheops-ng-use_external_libadns.patch
Patch4:         cheops-ng-rename_clog.patch
Patch5:         cheops-ng-pointer_int_casts.patch
Patch6:         cheops-ng-codecleanup.patch
Patch7:         cheops-ng-off_by_one.patch
Patch8:         cheops-ng-destdir.patch
Patch9:         cheops-ng-fix_desktop_file.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:	gtk-devel bison flex gnome-libs-devel ORBit-devel libadns-devel
BuildRequires:	glib-devel libxml-devel %xpm_lib nmap imlib-devel
BuildRequires:  libjpeg-devel libnetpbm libpng-devel libtiff-devel giflib-devel update-desktop-files

%if 0%suse_version > 1020
BuildRequires:  fdupes libopenssl-devel
BuildRequires:  openssl-devel
Requires:	nmap
PreReq:         %insserv_prereq %fillup_prereq

Cheops-ng is a Network management tool for mapping and monitoring your network.
It has host/network discovery functionality as well as OS detection of hosts. 
Cheops-ng has the ability to probe hosts to see what services they are running.
On some services, cheops-ng is actually able to see what program is running for
a service and the version number of that program.

NB: Run cheops-agent as root to enable the backend.

%setup -q

%{?suse_update_config:%{suse_update_config -f}}
rm -f Makefile
aclocal -I m4
autoheader -I m4
autoconf -I m4
export CFLAGS="%{optflags}"
# make -j2 does not work
make XCFLAGS="%{optflags}"

make DESTDIR=%{buildroot} install

mkdir -p %{buildroot}/%{_initrddir}
cp %{SOURCE1} %{buildroot}%{_initrddir}/cheops-agent
ln -s /etc/init.d/cheops-agent %{buildroot}%{_sbindir}/rccheops-agent

mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
%__install -m 644 %{S:2} %{buildroot}%{_localstatedir}/adm/fillup-templates

%__install -d %{buildroot}%{_datadir}/applications
mv %{buildroot}/%{_datadir}/gnome/apps/Internet/%{name}.desktop %{buildroot}%{_datadir}/applications/

%suse_update_desktop_file %name

%if 0%suse_version > 1020
%fdupes %buildroot

rm -rf %{buildroot}

%fillup_and_insserv -y -n cheops-agent

%stop_on_removal cheops-agent

%restart_on_update cheops-agent

%doc AUTHORS ChangeLog README doc/*
%attr(755,root,root) %{_initrddir}/cheops-agent

openSUSE Build Service is sponsored by