diff options
author | zoorat | 2023-11-11 22:21:03 +0600 |
---|---|---|
committer | zoorat | 2023-11-11 22:21:03 +0600 |
commit | 5ec6b35367006a9369c8b47c36451a86faaa3a69 (patch) | |
tree | 64967d57c0e6fb1880b39eca914faf435403160b | |
parent | f500cc37004565f36aea0c1079eea45be2f7c7ae (diff) | |
download | aur-5ec6b35367006a9369c8b47c36451a86faaa3a69.tar.gz |
adding better tooling
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile | 75 | ||||
-rw-r--r-- | PKGBUILD | 19 |
4 files changed, 95 insertions, 17 deletions
@@ -1,17 +1,19 @@ pkgbase = faq-bin pkgdesc = More flexible jq. Supports BSON, Bencode, JSON, TOML, XML, YAML pkgver = 0.0.7 - pkgrel = 1 + pkgrel = 2 url = https://github.com/jzelinskie/faq arch = x86_64 license = APACHE depends = jq provides = faq conflicts = faq - source = faq-0.0.7-readme::https://github.com/jzelinskie/faq/raw/0.0.7/README.md - b2sums = 08f8cc9acb54bd713b87f0df0444266f1a33473663dd32b088818cf54cc2f03e5b3fcaa65f22b58c699cecb6a28000992f148ca264b3d797eceaf8b72e91d24f - source_x86_64 = faq-0.0.7-x86_64::https://github.com/jzelinskie/faq/releases/download/0.0.7/faq-linux-amd64 - b2sums_x86_64 = 9f949db01d8864599353f96ad000690db212ff568c754b2a706f97d830a56ed22f8b00a68547791160e952616425e7fc72b0e12e2533e84eb9d623a431849fb4 + options = strip + options = emptydirs + options = zipman + source = https://raw.githubusercontent.com/jzelinskie/faq/main/README.md + source = faq::https://github.com/jzelinskie/faq/releases/download/0.0.7/faq-linux-amd64 + b2sums = 23f5d3292034ec771c0864ea295e2e9b3eb66ea7eb3290a985da004171f9ba4fc9ba86454d97c96b6a24be31a22c3bbeb41758752c010130354218a8267ead78 + b2sums = 9f949db01d8864599353f96ad000690db212ff568c754b2a706f97d830a56ed22f8b00a68547791160e952616425e7fc72b0e12e2533e84eb9d623a431849fb4 pkgname = faq-bin - diff --git a/.gitignore b/.gitignore index 623d0e70ff3e..f8b77578b1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ * !.gitignore -!.SRCINFO +!Makefile !PKGBUILD - +!.SRCINFO diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..9d1ea8c6e960 --- /dev/null +++ b/Makefile @@ -0,0 +1,75 @@ +MAKEFLAGS += --warn-undefined-variables +SHELL=/bin/bash + +VERSION = $(shell grep pkgver .SRCINFO | cut -d '=' -f 2 | tr -d '[:space:]') +TRASH = $(shell git check-ignore * | tr '\n' ' ') + +# DEFAULT +all: clean sum build check pre clean + +# just build the package +build: + makepkg -sfr + +# build and install the package +install: + makepkg --install + +# update checksums +sum: + updpkgsums + +# check/lint +check: + @echo "shellcheck: " + shellcheck -e SC2148 -e SC2034 PKGBUILD || exit 0 + + @echo "shell formate: " + shfmt -d PKGBUILD || exit 0 + + @echo "checking PKGBUILD: " + namcap -i PKGBUILD + + @echo "checking build: " + namcap -i *.pkg.* + +# clean up the mess +clean: +ifeq ($(strip $(TRASH)),) + @echo "nothing to clear" +else + file $(TRASH) + @echo -n "Are you sure? [Y/n] " && read ans && if [ $${ans:-'Y'} = 'Y' ]; then \ + trash-put -v $(TRASH) ; \ + exit 0 ; \ + fi +endif + +# prepare for commit +pre: + shfmt -w PKGBUILD + makepkg --printsrcinfo > .SRCINFO + + git diff + + git add PKGBUILD + git add .SRCINFO + git add .gitignore + git add Makefile + +# commit with version bump message +commit: + $(eval VERSION := $(shell read -p "enter version (pkgver=$(VERSION)): " enter ; echo $${enter})) + @echo "commit message: \"updating to v$(VERSION)\"" + + @echo -n "Are you sure? [Y/n] " && read ans && if [ $${ans:-'Y'} = 'Y' ]; then \ + git diff --cached ; \ + exit 0 ; \ + fi + + @echo -n "Are you sure? [Y/n] " && read ans && if [ $${ans:-'Y'} = 'Y' ]; then \ + git commit -m "updating to v$(VERSION)" ; \ + exit 0 ; \ + fi + + @echo "recheck everything before pushing to AUR" @@ -3,24 +3,25 @@ pkgname="faq-bin" pkgver=0.0.7 -pkgrel=1 +pkgrel=2 + pkgdesc='More flexible jq. Supports BSON, Bencode, JSON, TOML, XML, YAML' arch=('x86_64') url='https://github.com/jzelinskie/faq' license=('APACHE') + depends=('jq') provides=("faq") conflicts=("faq") +options=(strip emptydirs zipman) -source=("faq-${pkgver}-readme::https://github.com/jzelinskie/faq/raw/${pkgver}/README.md") -source_x86_64=("faq-${pkgver}-x86_64::https://github.com/jzelinskie/faq/releases/download/${pkgver}/faq-linux-amd64") +source=("https://raw.githubusercontent.com/jzelinskie/faq/main/README.md" + "faq::https://github.com/jzelinskie/faq/releases/download/${pkgver}/faq-linux-amd64") -b2sums=('08f8cc9acb54bd713b87f0df0444266f1a33473663dd32b088818cf54cc2f03e5b3fcaa65f22b58c699cecb6a28000992f148ca264b3d797eceaf8b72e91d24f') -b2sums_x86_64=('9f949db01d8864599353f96ad000690db212ff568c754b2a706f97d830a56ed22f8b00a68547791160e952616425e7fc72b0e12e2533e84eb9d623a431849fb4') +b2sums=('23f5d3292034ec771c0864ea295e2e9b3eb66ea7eb3290a985da004171f9ba4fc9ba86454d97c96b6a24be31a22c3bbeb41758752c010130354218a8267ead78' + '9f949db01d8864599353f96ad000690db212ff568c754b2a706f97d830a56ed22f8b00a68547791160e952616425e7fc72b0e12e2533e84eb9d623a431849fb4') package() { - install -Dvm755 "faq-${pkgver}-${CARCH}" "${pkgdir}/usr/bin/faq" - install -Dvm644 "faq-${pkgver}-readme" "${pkgdir}/usr/share/doc/faq/README.md" + install -Dm755 "faq" "${pkgdir}/usr/bin/faq" + install -Dm644 "README.md" "${pkgdir}/usr/share/doc/faq/README.md" } - -# vim: ts=2 sw=2 et: |