From 65ce510ffac1d090483c5c171a3f288eee22b132 Mon Sep 17 00:00:00 2001
From: Michele Baldessari <michele(a)acksyn.org>
Date: Sun, 31 Jan 2016 22:44:01 +0100
Subject: Cleanups
---
.gitignore | 1 +
q-text-as-data.spec | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
3 files changed, 87 insertions(+)
create mode 100644 q-text-as-data.spec
diff --git a/.gitignore b/.gitignore
index e69de29..0004d7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/q-1.5.0.tar.gz
diff --git a/q-text-as-data.spec b/q-text-as-data.spec
new file mode 100644
index 0000000..84089f4
--- /dev/null
+++ b/q-text-as-data.spec
@@ -0,0 +1,85 @@
+# Currently does not work with python3. As soon as python3 support
+# lands via
https://github.com/harelba/q/issues/109 we can default to
+# to using it below
+%if 0%{?fedora} > 12 || 0%{?rhel} > 7
+%global with_python3 0
+%endif
+
+Name: q-text-as-data
+Version: 1.5.0
+Release: 2%{?dist}
+Summary: Direct execution of SQL-like queries on tabular text files
+
+Group: Applications/Text
+License: GPLv3
+URL:
https://github.com/harelba/q
+Source:
https://github.com/harelba/q/archive/%{version}.tar.gz#/q-%{version}.tar.gz
+BuildArch: noarch
+
+BuildRequires: rubygem-ronn
+
+%if %{?with_python3}
+BuildRequires: python3-devel
+Requires: python3
+%else
+BuildRequires: python2-devel
+Requires: python2
+%endif
+
+
+%description
+q-text-as-data is a command line tool that allows direct execution of SQL-like
+queries on CSVs/TSVs (and any other tabular text files).
+
+q-text-as-data treats ordinary files as database tables, and supports all SQL
+constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column
+name and column type detection, and provides full support for multiple
+encodings.
+
+%prep
+%setup -qn q-%{version}
+
+%build
+ronn doc/USAGE.markdown
+%if 0%{?with_python3}
+sed -i '1s,#!.*,#!%{__python3},' bin/q
+%else
+sed -i '1s,#!.*,#!%{__python2},' bin/q
+%endif
+
+%install
+# NB: I am not 100% comfortable in using 'q' as the command name as
+# hijacking the single-letter namespace seems a bit too much.
+# Happy to be convinced otherwise
+%{__install} -Dm 0755 bin/q ${RPM_BUILD_ROOT}%{_bindir}/q-text-as-data
+%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mandir}/man1/
+%{__install} -m 0644 doc/USAGE ${RPM_BUILD_ROOT}%{_mandir}/man1/q-text-as-data.1
+
+%check
+# Small smoketest
+TMPFILE=$(mktemp)
+cat > $TMPFILE <<EOF
+"ID","Region","Service Name","Service
Type","PublicURL","AdminURL","InternalURL"
+"6b397af6a4ff4ac4b4b78cfb8d76d570","regionOne","nova","computev3","http://192.0.2.1:8774/v3","http://192.0.2.1:8774/v3","http://192.0.2.1:8774/v3"
+"3c890b11cd8948e8b059ac46d77c1ce9","regionOne","keystone","identity","http://192.0.2.1:5000/v2.0","http://192.0.2.1:35357/v2.0","http://192.0.2.1:5000/v2.0"
+"669015a773ba4f6191f7c71670af0eba","regionOne","ironic","baremetal","http://192.0.2.1:6385/","http://192.0.2.1:6385/","http://192.0.2.1:6385/"
+"80de1938d3884f3197b6dc5525b2160e","regionOne","ceilometer","metering","http://192.0.2.1:8777/","http://192.0.2.1:8777/","http://192.0.2.1:8777/"
+"50d58d82b16d4077854c4d7d6a963bff","regionOne","tuskar","management","http://192.0.2.1:8585/v2","http://192.0.2.1:8585/v2","http://192.0.2.1:8585/v2"
+"1d113cd9848647eaa1b47f67af8db84b","regionOne","glance","image","http://192.0.2.1:9292/","http://192.0.2.1:9292/","http://192.0.2.1:9292/"
+"735cbf3b583849c397a9eb8c3f1d0095","regionOne","neutron","network","http://192.0.2.1:9696/","http://192.0.2.1:9696/","http://192.0.2.1:9696/"
+EOF
+cat $TMPFILE | ./bin/q -d, -H "SELECT ID FROM - WHERE 'Service
Name'='nova'"
+rm $TMPFILE
+
+%files
+%license doc/LICENSE
+%doc %_mandir/man1/q-text-as-data.1.*
+%doc README.markdown doc/AUTHORS doc/IMPLEMENTATION.markdown doc/RATIONALE.markdown
doc/THANKS doc/USAGE.markdown
+%{_bindir}/q-text-as-data
+
+%changelog
+* Sun Jan 31 2016 Michele Baldessari <michele(a)acksyn.org> - 1.5.0-2
+- Cleanups
+
+* Tue Oct 13 2015 Michele Baldessari <michele(a)acksyn.org> - 1.5.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..f591986 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+16c7afeb972e4c91572115624314b395 q-1.5.0.tar.gz
--
cgit v0.11.2
http://pkgs.fedoraproject.org/cgit/q-text-as-data.git/commit/?h=f23&i...