From 029133a8fdea7c65eedbbb79c0f00a3aa57d9176 Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 12 Oct 2009 14:42:50 +0000 Subject: [PATCH] init --- Makefile | 51 +++++++++++++++++++++++++++++++++++ spectools.spec | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 Makefile create mode 100644 spectools.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ce297c --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +# $Id$ +WEBFETCH := wget +SHA1SUM = sha1sum + +# default - overridden by the build +SPECFILE = spectools.spec + +main.URL := http://mirror.onelab.eu/third-party/spectools-2009_06_R1.tar.gz +main.SHA1SUM := 5591d8b737fdb0d3c95df2fae6e122d7b19d6f79 +main.FILE := $(notdir $(main.URL)) + +# Thierry - when called from within the build, PWD is /build +SOURCEFILES := $(main.FILE) + +$(main.FILE): #FORCE + @if [ ! -e "$@" ] ; then echo "$(WEBFETCH) $(main.URL)" ; $(WEBFETCH) $(main.URL) ; fi + @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi + @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \ + echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \ + echo "Local copy: $$(sha1sum $@)" ; \ + echo "In sources: $$(grep $@ sources)" ; \ + exit 1 ; \ + else \ + ls -l $@ ; \ + fi + +sources: $(SOURCEFILES) +.PHONY: sources + +PWD=$(shell pwd) +PREPARCH ?= noarch +RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)" +trees: sources + rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE) + +srpm: sources + rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE) + +TARGET ?= $(shell uname -m) +rpm: sources + rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE) + +clean: + rm -f *.rpm *.tgz *.bz2 *.gz + +++%: varname=$(subst +,,$@) +++%: + @echo "$(varname)=$($(varname))" ++%: varname=$(subst +,,$@) ++%: + @echo "$($(varname))" diff --git a/spectools.spec b/spectools.spec new file mode 100644 index 0000000..59af8d1 --- /dev/null +++ b/spectools.spec @@ -0,0 +1,73 @@ +# SPEC file for spectools +# +# +# Source: http://www.kismetwireless.net/code/spectools-2009-06-R1.tar.gz +# Version 2009-06-R1 is not compatible with RPM, so rename the tar +# with version 2009_06_R1 +# +%define name spectools +%define version 2009_06_R1 +%define release 1.0 +%define actual_name %{name}-%{version} + +Name: %{name} +Summary: Spectools utilities for Wi-Spy +Version: %{version} +Release: %{release} +License: GPL +URL: http://www.kismetwireless.net/spectools/ +Group: Kismet +Source: %{actual_name}.tar.gz +BuildRoot: %{_tmppath}/%{actual_name} + + +BuildRequires: libusb-devel gtk2-devel ncurses-devel gcc make + +Requires: libusb gtk2 ncurses + +%description +Spectrum-Tools is a set of utilities for using the +Wi-Spy USB spectrum analyzer hardware from Metageek LLC. + +%prep +%setup -q -n %{actual_name} + + +%build +./configure --prefix=/usr +make + +%install +rm -rf $RPM_BUILD_ROOT +mkdir $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + + +%post + +%postun + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files -n %{name} +%defattr(-,root,root,0755) +%{_bindir}/spectool_curses +%{_bindir}/spectool_gtk +%{_bindir}/spectool_net +%{_bindir}/spectool_raw +%doc README GPL 99-wispy.rules + + + + + +%changelog -n spectools +* Fri Oct 2 2009 Thierry Turletti - 1.0 +- first version + + + + -- 2.43.0