Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snap packaging support #1201

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ tests/*.trs
cscope.in.out
cscope.out
cscope.po.out

snapcraft.yaml
jq_*.snap
prime
setup
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Kim De Mey <kim.demey@gmail.com> - build
Kim Toms <kim.toms@bplglobal.net>
LCD 47 <lcd047@gmail.com>
Lee Thompson <stagr.lee@gmail.com> - autoconf stuff, rpm
Lee Trager <lee.trager@canonical.com> - Snap packaging
Marc Abramowitz <marc@marc-abramowitz.com>
Marc Bruggmann <marcbr@spotify.com>
Markus Lanthaler <mark_lanthaler@gmx.net> - doc fixes
Expand Down
9 changes: 9 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ rpm: dist jq.spec
find rpm/RPMS/ -name "*.rpm" -exec mv {} ./ \;
rm -rf rpm

snap: snapcraft.yaml.template
@echo "Packaging jq as a snap..."
mkdir -p setup/gui
cp docs/public/jq.png setup/gui/icon.png
cp COPYING setup/license.txt
rm -f snapcraft.yaml
sed 's/@JQ_VERSION@/1.5/g' snapcraft.yaml.template > snapcraft.yaml
snapcraft snap

dist-clean-local:
rm -f ${BUILT_SOURCES}

Expand Down
22 changes: 22 additions & 0 deletions snapcraft.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: jq
version: @JQ_VERSION@
summary: jq is a lightweight and flexible command-line JSON processor.
description: jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The long line can be avoided with YAML syntax:

description: |
  jq is like sed for JSON data - you can use it to slice and filter and map
  and transform structured data with the same ease that sed, awk, grep and
  friends let you play with text.

confinement: strict

apps:
jq:
command: bin/jq

parts:
jq:
plugin: autotools
source: .
Copy link

@cprov cprov Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be adjusted to match the suggested building setup:

configflags:
  - --disable-maintainer-mode

filesets:
binaries:
- bin/jq
- lib/libjq.so*
stage:
- $binaries
snap:
- $binaries