Blob Blame History Raw
%global _version	2008-05-R1

## Fedora Extras specific customization below...
%bcond_without       	fedora
##

## {Local macros...
%global username	kismet
%global crontabdir	%_sysconfdir/cron.daily
%global homedir		%_var/lib/%name
%global logdir		%_var/log/%name
%global cfgdir		%_sysconfdir/%name
%global _rpmversion	0.0.%(echo %_version | tr - .)
## ...local macros}

%{!?release_func:%global release_func() %1%{?dist}}

Summary:	WLAN detector, sniffer and IDS
Name:		kismet
Version:	%_rpmversion
Release:	%release_func 5
License:	GPLv2+
Group:		Applications/Internet
URL:		http://www.kismetwireless.net/
Source0:	http://www.kismetwireless.net/code/%name-%_version.tar.gz
Source1:	http://www.kismetwireless.net/code/%name-%_version.tar.gz.asc
Source10:	tmpwatch.kismet
Source11:	sysconfig.kismet
Patch7:		kismet-2006-04-R1-ssize.patch
Patch8:		kismet-2007-01-R1-setgroups.patch
Patch13:	kismet-2008-05-R1-typedef.patch
Patch14:	kismet-2008-05-R1-typo.patch
Patch15:	kismet-2008-05-R1-const.patch
Patch16:	kismet-2008-05-R1-fmt.patch
Patch17:	kismet-2008-05-R1-gcc44.patch
BuildRoot:	%_tmppath/%name-%version-%release-root
BuildRequires:		expat-devel ncurses-devel diffutils
BuildRequires:		gmp-devel wget libpcap-devel
BuildRequires:		ImageMagick-devel
# should be required by ImageMagick-devel but are missing in FC4
BuildRequires:		libtiff-devel libjpeg-devel freetype-devel
BuildRequires:		fedora-usermgmt-devel
BuildRequires:		dbus-devel
Provides:		user(%username)
Provides:		group(%username)
Requires(missingok):	tmpwatch
Requires(missingok):	crontabs
Requires(pre):		%crontabdir
Requires(postun):	%crontabdir
%{?FE_USERADD_REQ}


%package extras
Summary:	Non-core programs for 'kismet'
Group:		Applications/Internet
Requires:	%name = %version-%release


%description
Kismet is an 802.11 layer2 wireless network detector, sniffer, and
intrusion detection system. Kismet will work with any wireless card
which supports raw monitoring (rfmon) mode, and can sniff 802.11b,
802.11a, and 802.11g traffic.

Kismet identifies networks by passively collecting packets and detecting
standard named networks, detecting (and given time, decloaking) hidden
networks, and infering the presence of nonbeaconing networks via data
traffic.

%description extras
Kismet is an 802.11 layer2 wireless network detector, sniffer, and
intrusion detection system. Kismet will work with any wireless card
which supports raw monitoring (rfmon) mode, and can sniff 802.11b,
802.11a, and 802.11g traffic.

This subpackage contains programs which provide additional functionality
but introduce dependencies which are not needed for kismet to work.


%prep
%setup -q -n %name-%_version
%patch7  -p1 -b .ssize
%patch8  -p1 -b .setgroups
%patch13 -p1 -b .typedef
%patch14 -p1 -b .typo
%patch15 -p1 -b .const
%patch16 -p1 -b .fmt
%patch17 -p0 -b .gcc44

sed -e 's!/var/log/kismet!%logdir!g' %SOURCE10 >tmpwatch.kismet
touch --reference=%SOURCE10 tmpwatch.kismet || :	# keep timestamp

# set our 'kismet' user, disable GPS and log into %logdir by
# default
sed -i -e "s!your_user_here!%username!g;
           s!^gps=true!gps=false!;
           s!^logtemplate=%%!logtemplate=%logdir/%%!;
	   s!^configdir=.*!configdir=%h/!" \
		conf/kismet.conf.in conf/kismet_drone.conf

# do not strip installed binaries as it conflicts with the -debuginfo
# mechanism
sed -i -e "s!\(install .*\) -s !\1 !g" Makefile.in


%build
#export ac_cv_header_linux_netlink_h=yes	# we have netlink.h; just the check is buggy
export ac_cv_lib_uClibcpp_main=no	# we do not want to build against uClibc++, even when available
export LDFLAGS='-Wl,--as-needed'
%configure --enable-ipv6 --sysconfdir=%cfgdir

# HOME will be set to @srcdir@ which is disturbing distcc
make clean
make %{?_smp_mflags} HOME="$HOME"


%install
rm -rf $RPM_BUILD_ROOT
make install	\
	DESTDIR="$RPM_BUILD_ROOT" \
	INSTUSR="$(id -un)" INSTGRP="$(id -gn)" MANGRP="$(id -gn)"
install -d $RPM_BUILD_ROOT{%homedir,%logdir,%crontabdir,%_sysconfdir/sysconfig}
install -p -m755 tmpwatch.kismet $RPM_BUILD_ROOT%crontabdir
install -p -m644 %SOURCE11       $RPM_BUILD_ROOT%_sysconfdir/sysconfig/kismet


%pre
%__fe_groupadd 12 -r %username &>/dev/null || :
%__fe_useradd  12 -r -s /sbin/nologin -M -d %homedir		\
	          -c 'Kismet user' -g %username %username &>/dev/null || :


%postun
%__fe_userdel  %username &>/dev/null || :
%__fe_groupdel %username &>/dev/null || :


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc CHANGELOG* GPL README TODO docs
%dir %attr(0770,root,%username) %homedir
%dir %attr(0730,root,%username) %logdir
%dir %attr(0750,root,%username) %cfgdir
%config(noreplace) %cfgdir/*
%_bindir/kismet*
%_datadir/kismet
%_mandir/*/kismet*

%config            %crontabdir/tmpwatch.kismet
%config(noreplace) %_sysconfdir/sysconfig/kismet


%files extras
%defattr(-,root,root,-)
%_bindir/gps*
%_mandir/*/gps*


%changelog
* Wed Mar 18 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.0.2008.05.R1-5
- Add patch to fix build against GCC 4.4 (#490811)

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.2008.05.R1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Aug  5 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.0.2008.05.R1-3
- fix license tag

* Sat Jun 21 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2008.05.R1-2
- applied forgotten patch
- honor $NO_TMPWATCH instead of $NO_LOGROTATE in the tmpwatch script (#427262)

* Sat Jun 21 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2008.05.R1-1
- updated to 2008-05-R1
- removed some patches and added new ones

* Fri Jun 06 2008 Caolán McNamara <caolanm@redhat.com> - 0.0.2007.10.R1-4
- tweak configure to use -lMagickCore not -lMagick to rebuild for dependancies

* Fri Feb 22 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2007.10.R1-3
- fixed build with gcc43 (#434084, thx to Erik van Pienbroek)

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org>
- Autorebuild for GCC 4.3

* Sat Nov 10 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2007.10.R1-2
- rebuilt for new libexpat

* Mon Oct  8 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2007.10.R1-1
- updated to 2007-10-R1
- dropped/rediffed patches
- added BR on dbus-devel

* Sun Feb  4 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2007.01.R1b-7
- further x86_64 fixes for printf() format-string modifiers

* Sat Feb  3 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2007.01.R1b-6
- updated to 2007-01-R1b
- removed most patches which were applied upstream; rediffed remaining
  ones
- added -setgroups patch
- added libpcap-devel BR; removed the glib-devel + bzip2-devel one
- build with '-Wl,--as-needed'

* Fri Sep 15 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2006.04.R1-4
- rebuilt

* Sun Jul  9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2006.04.R1-3
- use new fedora-usermgmt code

* Sat Apr 29 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2006.04.R1-2
- fixed compilation problems on AMD64 introduced by my -alias patch
  (reported by Hans de Goede)
- fixed ssize_t vs. int problem on AMD64 (found and reported by Hans
  de Goede)
- initial import into Fedora Extra (review #165314)
- added 'freetype-devel' BR which is required for -devel branch

* Sat Apr 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2006.04.R1-1
- updated to 2006-04-R1
- fixed/improved some ./configure checks
- removed the starting 'A' from the summary
- added a bunch of patches fixing compiler warnings

* Fri Mar 17 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2005.08.R1-3
- fixed the usermgmt in the %%postun script: test for uninstallation
  and swap order of user- and groupdel operations
- moved logs to /var/log/kismet
- placed status information directly under /var/lib/kismet instead of
  /var/lib/kismet/.kismet
- added /etc/cron.dail/tmpwatch.kismet to cleanup the generated
  logfiles; used tmpwatch because kismet creates new, differently
  named logfiles.
- added -jobcontrol patch

* Thu Mar 16 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2005.08.R1-2
- set *USR and *GRP variables to avoid problems with certain 'install'
  versions

* Thu Aug 18 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2005.08.R1-1
- updated to 2005-08-R1 (SECURITY)
- do not use 'subst()' in %%prep anymore; the files *will* be touched
  so we do not need to care about the timestamp
- fixed copy&paste error in the gecos entry of the 'kismet' user

* Sun Aug  7 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2005.07.R1a-1
- updated to 2005-07-R1a

* Sat Jul  9 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2005.06.R1-1
- Initial build.


## Local Variables:
## outline-regexp: "##\\s-*{.*\\.\\.\\."
## outline-heading-end-regexp: "##\\s-*\\.\\.\\..*}"
## End: