get rpm building from tarball with autoconf
This commit is contained in:
1 parent
26bbed29f7
commit
00e4feba81
2 files changed
+27
-15
No files matched your search
+7
-8
@@ -3,7 +3,7 @@
|
|||||||
# setup is only used by distribution developers, not package developers.
|
# setup is only used by distribution developers, not package developers.
|
||||||
# Still, as a matter of allowing patching, its not a bad idea to distribute
|
# Still, as a matter of allowing patching, its not a bad idea to distribute
|
||||||
# the developer setup script in the tarball.
|
# 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
|
# 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.
|
# 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
|
jv_unicode.c: jv_utf8_tables.gen.h
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
git log --name-status > $@
|
git log --name-status > $@ || echo "no changelog" > $@
|
||||||
|
|
||||||
main.c: config.h
|
main.c: config.h
|
||||||
|
|
||||||
@@ -67,12 +67,11 @@ releasetag:
|
|||||||
RELEASE ?= 1
|
RELEASE ?= 1
|
||||||
rpmbuild: jq
|
rpmbuild: jq
|
||||||
@echo "Packaging jq as an RPM ..."
|
@echo "Packaging jq as an RPM ..."
|
||||||
mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS
|
mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SPECS
|
||||||
rm -rf jq-$$(cat VERSION)
|
cp jq-$$(cat VERSION).tar.gz rpm/SOURCES/
|
||||||
mkdir -p jq-$$(cat VERSION)/bin
|
rpmbuild -tb --define "_topdir ${PWD}/rpm" --define "_prefix ${HOME}" --define "version $$(cat VERSION)" --define "release ${RELEASE}" rpm/SOURCES/jq-$$(cat VERSION).tar.gz
|
||||||
cp jq jq-$$(cat VERSION)/bin
|
mv rpm/RPMS/* ./
|
||||||
tar -zcf rpm/SOURCES/jq-$$(cat VERSION).tgz jq-$$(cat VERSION)/bin/jq
|
rm -rf rpm
|
||||||
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
|
|
||||||
|
|
||||||
dist-clean-local:
|
dist-clean-local:
|
||||||
rm -f $(BUILT_SOURCES)
|
rm -f $(BUILT_SOURCES)
|
||||||
@@ -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
|
Summary: Command-line JSON processor
|
||||||
Name: jq
|
Name: jq
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}
|
Release: %{release}
|
||||||
Source0: jq-%{version}.tgz
|
Source0: jq-%{version}.tar.gz
|
||||||
URL: https://github.com/stedolan/jq
|
URL: https://github.com/stedolan/jq
|
||||||
|
License: BSD
|
||||||
|
AutoReqProv: no
|
||||||
|
BuildPrereq: autoconf, libtool, automake, flex, bison, python
|
||||||
|
|
||||||
License: Copyright (C) 2012 Stephen Dolan
|
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
# Requires:
|
# Requires:
|
||||||
|
|
||||||
@@ -22,18 +26,27 @@ jq is a command-line JSON processor
|
|||||||
%setup
|
%setup
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
echo "Building in: \"$(pwd)\""
|
||||||
|
./configure --prefix=%{_prefix}
|
||||||
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
echo "Building in: \"%{buildroot}\""
|
echo "Installing to: \"${RPM_BUILD_ROOT}\""
|
||||||
rm -rf %{buildroot}
|
make install DESTDIR=${RPM_BUILD_ROOT}
|
||||||
install -d -m 755 %{buildroot}/usr/bin
|
|
||||||
mv %{_builddir}/jq-%{version}/bin/jq %{buildroot}/usr/bin
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%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
|
%changelog
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user