--- /dev/null
+# $Id$
+WEBFETCH := wget
+SHA1SUM = sha1sum
+
+# default - overridden by the build
+SPECFILE = crunchxml.spec
+
+main.URL := http://mirror.onelab.eu/third-party/crunchxml-1.1.tar.gz
+main.SHA1SUM := 88be1b8780feb078bda0968aea61596f209c2462
+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))"
--- /dev/null
+# SPEC file for CrunchXML
+#
+#
+# Source: mercuria site to come...
+# Version: 1.0
+#
+%define name crunchxml
+%define version 1.1
+%define release 1.0
+%define actual_name %{name}-%{version}
+
+Name: %{name}
+Summary: Construct MySQL database from XML traces
+Version: %{version}
+Release: %{release}
+License: GPLv2
+URL: https://twiki-sop.inria.fr/twiki/bin/view/Projets/Planete/CrunchXML
+Group: Planete, INRIA
+Source: %{actual_name}.tar.gz
+BuildRoot: %{_tmppath}/%{actual_name}
+
+
+BuildRequires: gsl-devel glib2-devel libxml-devel libxml2-devel mysql-devel
+BuildRequires: scons gcc
+
+Requires: gsl glib2 libxml libxml2 mysql
+
+
+%description
+CrunchXML implements an efficient synchronization and
+merging algorithm, which takes XML (or PDML) input trace
+files generated by multiple probes, and stores only the
+packets fields that have been marked as relevant by the
+user in a MySQL database.
+
+%prep
+
+%setup -q -n %{actual_name}
+
+
+%build
+scons
+
+
+%install
+
+rm -rf $RPM_BUILD_ROOT
+mkdir $RPM_BUILD_ROOT
+scons --prefix=$RPM_BUILD_ROOT/usr install
+
+
+%post
+ldconfig
+
+%postun
+ldconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files -n %{name}
+%defattr(-,root,root,0755)
+/usr/bin/CrunchXML
+%doc
+
+
+
+
+
+%changelog -n crunchXML
+* Thu Oct 8 2009 Thierry Turletti <turletti@sophia.inria.fr> 1.0-1.0
+- first version
+
+
+
+