first packaging for liboml oml-2.5.1-0
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 1 Feb 2011 12:42:05 +0000 (13:42 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 1 Feb 2011 12:42:05 +0000 (13:42 +0100)
Makefile [new file with mode: 0644]
liboml.spec [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..30daba3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+#
+WEBFETCH               := curl -H Pragma: -O -R -S --fail --show-error
+SHA1SUM                        := sha1sum
+
+# initial from http://oml.mytestbed.net/attachments/download/496/oml2-2.5.1.tar.gz
+REPO :=        http://mirror.onelab.eu/third-party/
+
+ALL += oml
+oml-URL                        := $(REPO)/oml2-2.5.1.tar.gz
+oml-SHA1SUM            := 9d75d99d799a14f74024cc9de33bc7cb6696afdd
+oml                    := $(notdir $(oml-URL))
+ALL += oml
+
+all: $(ALL)
+.PHONY: all
+
+##############################
+define download_target
+$(1): $($(1))
+.PHONY: $($(1))
+$($(1)): 
+       @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
+       @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
+       @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
+           echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
+           echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
+           echo "In Makefile: $($(1)-SHA1SUM)" ; \
+           false ; \
+       else \
+           ls -l $($(1)) ; \
+       fi
+CLEAN += $($(1))
+endef
+
+$(eval $(call download_target,oml))
+
+clean:
+       rm -f $(CLEAN)
+.PHONY: clean
+
+#################### convenience, for debugging only
+# make +foo : prints the value of $(foo)
+# make ++foo : idem but verbose, i.e. foo=$(foo)
+++%: varname=$(subst +,,$@)
+++%:
+       @echo "$(varname)=$($(varname))"
++%: varname=$(subst +,,$@)
++%:
+       @echo "$($(varname))"
diff --git a/liboml.spec b/liboml.spec
new file mode 100644 (file)
index 0000000..f3bd45f
--- /dev/null
@@ -0,0 +1,91 @@
+# Thierry Parmentelat - INRIA
+# Copyright (C) 2010 INRIA
+# License is GPL.
+
+%define name liboml
+%define version 2.5.1
+%define taglevel 0
+
+%define oml_actual_name oml2-%{version}
+
+Summary: OMF Measurement Library
+Name: %{name}
+Version: %{version}
+Release: %{taglevel}
+License: GPL
+Group: System Environment/Base
+Source0: %{oml_actual_name}.tar.gz
+BuildRoot: %{_tmppath}/%{oml_actual_name}-buildroot
+
+Vendor: NICTA
+Packager: OneLab <devel@planet-lab.org>
+Distribution: %{pldistro} %{plrelease}
+URL: %{SCMURL}
+
+%description 
+The OML (Orbit Measurement Library) provides utilities to capture measurements...
+
+# buildrequires 
+BuildRequires: libxml2-devel
+BuildRequires: sqlite-devel
+BuildRequires: libpcap-devel
+BuildRequires: popt-devel
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: check
+#BuildRequires: libtrace3-dev
+#BuildRequires: libsigar-dev
+
+# requires (build or runtime ?)
+Requires: libxml2
+Requires: libsqlite3
+Requires: libpcap
+Requires: libpthread
+Requires: libpopt
+#Requires: libtrace3
+#Requires: libsigar
+
+# don't create the debuginfo package
+%define _enable_debug_packages 0
+%global __debug_package 0
+####################
+
+%prep
+%setup -n %{oml_actual_name}
+
+%build
+rm -rf $RPM_BUILD_ROOT
+
+# retrieve tarball
+make oml
+# extract it
+tar -xzf %{oml_actual_name}.tar.gz
+
+pushd %{oml_actual_name}
+./configure --prefix=/usr
+make
+# skip this optional step
+# make check
+popd
+
+%install
+rm -fr $RPM_BUILD_ROOT
+pushd %{oml_actual_name}
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+####################
+%files
+%defattr(-,root,root)
+/usr/bin
+/usr/include
+/usr/lib/lib*
+/usr/share
+
+####################
+%changelog
+