diff options
author | Julian Grinblat <julian@dotcore.co.il> | 2023-09-01 22:06:43 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-09-01 22:06:43 +0700 |
commit | 8683559dc820a86a5d3de707bdb5a8fbb2b1b4e6 (patch) | |
tree | f9d2b97d711ff3fc7fa44785a8b3d32fd4faafd1 /system/yq | |
parent | 49f07dcd735321412a12c60518caa37e735a1944 (diff) |
system/yq: Added (Portable command line processor).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/yq')
-rw-r--r-- | system/yq/README | 11 | ||||
-rw-r--r-- | system/yq/slack-desc | 19 | ||||
-rw-r--r-- | system/yq/yq.SlackBuild | 104 | ||||
-rw-r--r-- | system/yq/yq.info | 10 |
4 files changed, 144 insertions, 0 deletions
diff --git a/system/yq/README b/system/yq/README new file mode 100644 index 0000000000000..796b0188e3ec9 --- /dev/null +++ b/system/yq/README @@ -0,0 +1,11 @@ +a lightweight and portable command-line YAML, JSON and XML processor. +yq uses jq like syntax but works with yaml files as well as json, xml, +properties, csv and tsv. It doesn't yet support everything jq does - +but it does support the most common operations and functions, and more +is being added continuously. + +pandoc is required to build the docs + +Warning: This SlackBuild requires network access when it runs, meaning +it downloads files from the Internet with root access. You should +decide for yourself whether or not you think this is a good idea. diff --git a/system/yq/slack-desc b/system/yq/slack-desc new file mode 100644 index 0000000000000..3117089a7f032 --- /dev/null +++ b/system/yq/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +yq: yq (portable command-line YAML, JSON, XML, CSV, TOML processor) +yq: +yq: a lightweight and portable command-line YAML, JSON and XML processor. +yq: yq uses jq like syntax but works with yaml files as well as json, +yq: xml, properties, csv and tsv. It doesn't yet support everything jq +yq: does - but it does support the most common operations and functions, +yq: and more is being added continuously. +yq: +yq: Homepage: https://github.com/mikefarah/yq +yq: +yq: diff --git a/system/yq/yq.SlackBuild b/system/yq/yq.SlackBuild new file mode 100644 index 0000000000000..bfbf521b62266 --- /dev/null +++ b/system/yq/yq.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/bash + +# Slackware build script for terraform + +# Copyright 2022 Julian Grinblat <julian@dotcore.co.il> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=yq +VERSION=${VERSION:-4.35.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} +GOOS=linux + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +case "$ARCH" in + x86_64) GOARCH=amd64 ;; + i586) GOARCH=386 ;; + *) GOARCH=$ARCH ;; +esac + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +GOPATH=$TMP/go +mkdir -p $GOPATH + +GOPATH=$GOPATH \ +GOOS=$GOOS \ +GOARCH=$GOARCH \ +CGO_ENABLED=0 \ +go build \ + -mod=readonly \ + -ldflags='-w -s' # In release mode we don't want debug information in the binary + +install -D -m 0755 yq $PKG/usr/bin/yq + +./scripts/generate-man-page-md.sh + +# install pandoc and uncomment 5 lines below to generate man pages. +# ./scripts/generate-man-page.sh +# mkdir -p $PKG/usr/man/man1 +# install -D -m 644 yq.1 $PKG/usr/man/man1 +# find $PKG/usr/man -type f -exec gzip -9 {} \; +# for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + LICENSE README.md CODE_OF_CONDUCT.md CONTRIBUTING.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/yq/yq.info b/system/yq/yq.info new file mode 100644 index 0000000000000..ffdcb12c50b02 --- /dev/null +++ b/system/yq/yq.info @@ -0,0 +1,10 @@ +PRGNAM="yq" +VERSION="4.35.1" +HOMEPAGE="https://github.com/mikefarah/yq" +DOWNLOAD="https://github.com/mikefarah/yq/archive/refs/tags/v4.35.1/yq-4.35.1.tar.gz" +MD5SUM="c130deecba00c29d3e75be94bce98c98" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="google-go-lang" +MAINTAINER="Julian Grinblat" +EMAIL="julian@dotcore.co.il" |