From: Anthony Shortland Date: Tue, 30 Oct 2012 17:26:08 +0000 (-0700) Subject: Added initial support for packaging jq as an RPM X-Git-Tag: jq-1.3~22^2~21^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04640aeaebb71a14b943563e240659274393567f;p=jq Added initial support for packaging jq as an RPM --- diff --git a/Makefile b/Makefile index 9c5e163..85f1c2f 100644 --- a/Makefile +++ b/Makefile @@ -54,3 +54,10 @@ uninstall: cd $(prefix)/bin && \ rm -f jq +RELEASE ?= 1 + +rpmbuild: jq + @echo "Packaging jq as an RPM ..." + mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS + tar --transform="s+^+jq-$$(cat VERSION)/bin/+" -zcf rpm/SOURCES/jq-$$(cat VERSION).tgz 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 diff --git a/rpm/SPECS/jq.spec b/rpm/SPECS/jq.spec new file mode 100644 index 0000000..71b3e79 --- /dev/null +++ b/rpm/SPECS/jq.spec @@ -0,0 +1,42 @@ +Summary: Command-line JSON processor +Name: jq +Version: %{version} +Release: %{release} +Source0: jq-%{version}.tgz +URL: https://github.com/stedolan/jq + +License: Copyright (C) 2012 Stephen Dolan +Group: Applications/System +# Requires: + +# Disables debug packages and stripping of binaries: +%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 + +%install +echo "Building in: \"%{buildroot}\"" +rm -rf %{buildroot} +install -d -m 755 %{buildroot}/usr/bin +mv %{_builddir}/jq-%{version}/bin/jq %{buildroot}/usr/bin + +%clean + +%files +%defattr(-,root,root) +/usr/bin/jq + +%changelog + +%pre + +%post