From 6b49cfe907d8457460c952587d0d06ac9183cfce Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 1 Feb 2011 13:42:05 +0100 Subject: [PATCH 1/1] first packaging for liboml --- Makefile | 49 +++++++++++++++++++++++++++++ liboml.spec | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 Makefile create mode 100644 liboml.spec diff --git a/Makefile b/Makefile new file mode 100644 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 index 0000000..f3bd45f --- /dev/null +++ b/liboml.spec @@ -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 +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 + -- 2.43.0