summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am15
-rw-r--r--jq.spec37
2 files changed, 32 insertions, 20 deletions
diff --git a/Makefile.am b/Makefile.am
index 18acb864..bdac3558 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@
# setup is only used by distribution developers, not package developers.
# Still, as a matter of allowing patching, its not a bad idea to distribute
# the developer setup script in the tarball.
-EXTRA_DIST = setup.sh config.h.in ChangeLog VERSION lexer.l lexer.h gen_utf8_tables.py
+EXTRA_DIST = setup.sh config.h.in ChangeLog VERSION lexer.l lexer.h gen_utf8_tables.py jq.spec
# README.md is expected in Github projects, good stuff in it, so we'll
# distribute it and install it with the package in the doc directory.
@@ -56,7 +56,7 @@ jv_utf8_tables.gen.h: gen_utf8_tables.py
jv_unicode.c: jv_utf8_tables.gen.h
ChangeLog:
- git log --name-status > $@
+ git log --name-status > $@ || echo "no changelog" > $@
main.c: config.h
@@ -67,12 +67,11 @@ releasetag:
RELEASE ?= 1
rpmbuild: jq
@echo "Packaging jq as an RPM ..."
- mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS
- rm -rf jq-$$(cat VERSION)
- mkdir -p jq-$$(cat VERSION)/bin
- cp jq jq-$$(cat VERSION)/bin
- tar -zcf rpm/SOURCES/jq-$$(cat VERSION).tgz jq-$$(cat VERSION)/bin/jq
- rpmbuild --target $$(uname -m) --buildroot ${PWD}/rpm/BUILDROOT/jq-$$(cat VERSION)-${RELEASE}.noarch --define "_topdir ${PWD}/rpm" --define "version $$(cat VERSION)" --define "release ${RELEASE}" -bb --clean rpm/SPECS/jq.spec
+ mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SPECS
+ cp jq-$$(cat VERSION).tar.gz rpm/SOURCES/
+ rpmbuild -tb --define "_topdir ${PWD}/rpm" --define "_prefix ${HOME}" --define "version $$(cat VERSION)" --define "release ${RELEASE}" rpm/SOURCES/jq-$$(cat VERSION).tar.gz
+ mv rpm/RPMS/* ./
+ rm -rf rpm
dist-clean-local:
rm -f $(BUILT_SOURCES)
diff --git a/jq.spec b/jq.spec
index 71b3e792..ca63aa93 100644
--- a/jq.spec
+++ b/jq.spec
@@ -1,11 +1,15 @@
+# This is spec file maintained by developers of JQ, not by a OS distro.
+# Your OS of choice will likely ignore this RPM spec file.
Summary: Command-line JSON processor
Name: jq
Version: %{version}
Release: %{release}
-Source0: jq-%{version}.tgz
+Source0: jq-%{version}.tar.gz
URL: https://github.com/stedolan/jq
-
-License: Copyright (C) 2012 Stephen Dolan
+License: BSD
+AutoReqProv: no
+BuildPrereq: autoconf, libtool, automake, flex, bison, python
+
Group: Applications/System
# Requires:
@@ -13,28 +17,37 @@ Group: Applications/System
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post %{nil}
-
+
%description
jq is a command-line JSON processor
-
+
%prep
%setup
%build
-
+echo "Building in: \"$(pwd)\""
+./configure --prefix=%{_prefix}
+make
+
%install
-echo "Building in: \"%{buildroot}\""
-rm -rf %{buildroot}
-install -d -m 755 %{buildroot}/usr/bin
-mv %{_builddir}/jq-%{version}/bin/jq %{buildroot}/usr/bin
+echo "Installing to: \"${RPM_BUILD_ROOT}\""
+make install DESTDIR=${RPM_BUILD_ROOT}
%clean
+rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
-/usr/bin/jq
-
+%{_bindir}/jq
+%{_bindir}/jq_test
+%{_datadir}/doc/jq/AUTHORS
+%{_datadir}/doc/jq/COPYING
+%{_datadir}/doc/jq/INSTALL
+%{_datadir}/doc/jq/NEWS
+%{_datadir}/doc/jq/README
+%{_datadir}/doc/jq/README.md
+
%changelog
%pre