Skip to content

Commit

Permalink
Add standard packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerysong committed Jan 26, 2024
1 parent a95313d commit 2312ca8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.deps/
Makefile
Makefile.in
VERSION
aclocal.m4
autom4te.cache/
compile
Expand All @@ -15,3 +16,4 @@ depcomp
ejq
install-sh
missing
packaging/rpm/ejq.spec
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Paul Arthur MacIain
Copyright (c) 2023-2024 Paul Arthur MacIain

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ AM_CFLAGS = -Wall
bin_PROGRAMS = ejq

ejq_SOURCES = json.c json.h json-selector.c json-selector.h ejq.c

EXTRA_DIST = VERSION packaging/rpm/ejq.spec

rpm: dist-xz
rpmbuild -ta $(distdir).tar.xz
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
AC_INIT([easy-json-q], [0.1], [[email protected]])
AC_INIT([ejq], m4_esyscmd([bash version.sh]), [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz])

AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_INSTALL

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile packaging/rpm/ejq.spec])
AC_OUTPUT
31 changes: 31 additions & 0 deletions packaging/rpm/ejq.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Summary: A more performant jq alternative for simple cases
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
License: MIT AND BSD-2-Clause
URL: https://flowerysong.com/
Source0: %{name}-%{version}.tar.xz
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: make

%description
A simple CLI wrapper around James Barford's easy-json library.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%configure
%make_build

%install
%make_install

%files
%{_bindir}/ejq

%changelog
* %(date "+%a %b %d %Y") (Automated RPM build) - %{version}-%{release}
- See git log for actual changes.
9 changes: 9 additions & 0 deletions version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ -d .git ]; then
git describe --tags | perl -pe 'chomp; s/-/./; s/-.*//' | tee VERSION
elif [ -s VERSION ]; then
cat VERSION
else
echo -n UNKNOWN
fi

0 comments on commit 2312ca8

Please sign in to comment.