Blob Blame History Raw
%global _version	2010-07-R1

## {Local macros...
%global cfgdir		%_sysconfdir/%name
%global _rpmversion	0.0.%(echo %_version | tr - .)
## ...local macros}

%{!?release_func:%global release_func() %1%{?dist}}
%{!?apply:%global  apply(p:n:b:) %patch%%{-n:%%{-n*}} %%{-p:-p%%{-p*}} %%{-b:-b%%{-b*}} \
%nil}

Summary:	WLAN detector, sniffer and IDS
Name:		kismet
Version:	%_rpmversion
Release:	%release_func 1200
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

Source12:	kismet_capture.pam
Source13:	kismet_capture.console

Patch17:	kismet-2009-06-R1-perms.patch
Patch18:	kismet-2009-06-R1-envp.patch

BuildRoot:	%_tmppath/%name-%version-%release-root
BuildRequires:	ncurses-devel diffutils
BuildRequires:	libpcap-devel pcre-devel
BuildRequires:	openssl-devel libcap-devel libnl-devel
Requires:	usermode

Obsoletes:	kismet-extras < 0.0.2009.06.R1

# HACK: work around https://fedorahosted.org/usermode/ticket/1
Source50:	kismet_capture_wrap.c
BuildRequires:	dietlibc


%package plugins
Summary:	Plugins 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 plugins
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 plugins shipped by the kismet package.


%prep
%setup -q -n %name-%_version
%apply -n17 -p1
%apply -n18 -p1

/bin/cp -a /usr/lib/rpm/config.sub .

sed -i 's!\$(prefix)/lib/!%_libdir/!g' plugin-*/Makefile


# set our 'kismet' user, disable GPS and log into %logdir by
# default
sed -i \
    -e '\!^ouifile=/etc/manuf!d' \
    -e '\!^ouifile=/usr/share/wireshark/wireshark/manuf!d' \
    conf/kismet.conf.in conf/kismet_drone.conf


%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 \
	   --sysconfdir=%cfgdir \
	   CXXFLAGS="$RPM_OPT_FLAGS -D__STDC_FORMAT_MACROS"

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

for i in plugin-{ptw,spectools,autowep}; do
    make -C $i KIS_SRC_DIR=`pwd` \
	 CXX='%__cxx' CC='%__cc' LD='%__cxx' \
	 CFLAGS="-I\$(KIS_SRC_DIR) -fPIC $RPM_OPT_FLAGS" \
	 PLUGINLDFLAGS="-shared -rdynamic -Wl,--as-needed"
done


# HACK: work around https://fedorahosted.org/usermode/ticket/1
diet %__cc $RPM_OPT_FLAGS %SOURCE50 -o kismet_capture.wrap


%install
rm -rf $RPM_BUILD_ROOT _tmp

for i in . plugin-{ptw,spectools,autowep}; do
    make -C $i install	\
        KIS_SRC_DIR=`pwd` \
	DESTDIR="$RPM_BUILD_ROOT" \
	INSTUSR="$(id -un)" INSTGRP="$(id -gn)" MANGRP="$(id -gn)"
done

install -d $RPM_BUILD_ROOT{%homedir,%crontabdir,%_libdir/kismet{,_client},%_libexecdir,%_sysconfdir/{sysconfig,pam.d,security/console.apps}}

install -p -m 0644 %SOURCE12     $RPM_BUILD_ROOT%_sysconfdir/pam.d/kismet_capture
install -p -m 0644 %SOURCE13     $RPM_BUILD_ROOT%_sysconfdir/security/console.apps/kismet_capture
install -p -m 0755 kismet_capture $RPM_BUILD_ROOT%_libexecdir/

chmod 0755 $RPM_BUILD_ROOT%_libdir/kismet*/*.so


#ln -s ./consolehelper            $RPM_BUILD_ROOT%_bindir/kismet_capture
install -p -m 0755 kismet_capture.wrap $RPM_BUILD_ROOT%_bindir/kismet_capture


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc CHANGELOG* GPL README docs
%dir %attr(0755,root,root) %cfgdir
%config(noreplace) %cfgdir/*
%_bindir/kismet*
%_datadir/kismet
%_mandir/*/kismet*

%dir %_libdir/kismet
%dir %_libdir/kismet_client

%config(noreplace) %_sysconfdir/pam.d/*
%_sysconfdir/security/console.apps/*
%_libexecdir/*


%files plugins
%defattr(-,root,root,-)
%dir %_libdir/kismet/*.so
%dir %_libdir/kismet_client/*.so


%changelog
* Mon Aug 16 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2010.07.R1-1200
- updated to 2010-07-R1; rediffed patches

* Sun Feb 21 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2010.01.R1-1201
- added patch to honor listen configuration (#553275)

* Sat Jan 16 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2010.01.R1-1200
- updated to 2010-01-R1
- rediffed patches

* Sun Dec  6 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2009.11.R1-1200
- updated to 2009-11-R1

* Sun Aug  9 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
- enhanced kismet_capture's pam configuration file

* Sun Aug  9 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2009.06.R1-1
- added Obsoletes: entry for old -extras subpackage

* Sun Aug  9 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.0.2009.06.R1-0
- updated to 2009-06-R1
- reworked large parts of the package due to major upstream changes:
  * there is no separate user anymore but a kismet_capture consolehelper wrapper
  * a lot of the old filesystem layout has been changed/removed
  * removed -extras subpackage; added -plugins one

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.2008.05.R1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* 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: