1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Added initial support for packaging jq as an RPM

This commit is contained in:
Anthony Shortland
2012-10-30 10:26:08 -07:00
parent 0923c79fee
commit 04640aeaeb
2 changed files with 49 additions and 0 deletions

View File

@ -54,3 +54,10 @@ uninstall:
cd $(prefix)/bin && \ cd $(prefix)/bin && \
rm -f jq 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

42
rpm/SPECS/jq.spec Normal file
View File

@ -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