summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzoorat2023-11-13 14:34:54 +0600
committerzoorat2023-11-13 14:34:54 +0600
commit415a33a0de0405a41668ffcccc03cc08e3080f21 (patch)
tree18077a008648649226b4d0ad7025aa4ff16f9203
parentf9c66bffc362c2edd61026136b53e8785765d457 (diff)
downloadaur-libsvg.tar.gz
linting
-rw-r--r--.SRCINFO11
-rw-r--r--.gitignore6
-rw-r--r--Makefile76
-rw-r--r--PKGBUILD34
4 files changed, 107 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ae3b0622f74d..5551749a6bb4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,18 @@
pkgbase = libsvg
pkgdesc = A library for rendering SVG documents
pkgver = 0.1.4
- pkgrel = 6
- url = http://cairographics.org/
+ pkgrel = 7
+ url = https://cairographics.org/
arch = i686
arch = x86_64
license = LGPL
+ depends = glibc
depends = libxml2
+ options = strip
options = !libtool
source = https://cairographics.org/snapshots/libsvg-0.1.4.tar.gz
source = libpng14.patch
- md5sums = ce0715e3013f78506795fba16e8455d3
- md5sums = 76eee76d69e79dddbe6de8c75ed0ac1c
+ b2sums = c000eb3ddfce3ec134ae614676fe42b0ae5bc4206928c69ca846cf758a0862c29c0e1c2ebe346c6b60781d4f35c5840ee0c18344da5e2e57e3f9b60b6bb9c5dd
+ b2sums = f0f98d0ddd2b43ee798c8f0616aa877d2512cfef0e82609e09f118f1fac7553569184760ab42069b46d9fecbf99836642004e1436f9024d0dc816b5353e40c56
pkgname = libsvg
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..2abbcad09f94
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!.gitignore
+!Makefile
+!PKGBUILD
+!.SRCINFO
+!libpng14.patch
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..70ae217ad523
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,76 @@
+MAKEFLAGS += --warn-undefined-variables
+SHELL=/bin/bash
+
+REPO = $(shell grep url .SRCINFO | cut -d '=' -f 2 | tr -d '[:space:]')
+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"
diff --git a/PKGBUILD b/PKGBUILD
index e1b2df5f9511..1354432135d8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,27 +1,31 @@
-# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
+# Maintainer: zoorat <zoorat [at] protonmail [dot] com>
+# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Jan de Groot <jgc@archlinux.org>
pkgname=libsvg
pkgver=0.1.4
-pkgrel=6
+pkgrel=7
+
pkgdesc="A library for rendering SVG documents"
arch=('i686' 'x86_64')
+url="https://cairographics.org/"
license=('LGPL')
-url="http://cairographics.org/"
-depends=('libxml2')
-source=(https://cairographics.org/snapshots/$pkgname-$pkgver.tar.gz \
- libpng14.patch)
-md5sums=('ce0715e3013f78506795fba16e8455d3'
- '76eee76d69e79dddbe6de8c75ed0ac1c')
-options=('!libtool')
+
+depends=('glibc' 'libxml2')
+options=(strip !libtool)
+
+source=(https://cairographics.org/snapshots/$pkgname-$pkgver.tar.gz
+ libpng14.patch)
+b2sums=('c000eb3ddfce3ec134ae614676fe42b0ae5bc4206928c69ca846cf758a0862c29c0e1c2ebe346c6b60781d4f35c5840ee0c18344da5e2e57e3f9b60b6bb9c5dd'
+ 'f0f98d0ddd2b43ee798c8f0616aa877d2512cfef0e82609e09f118f1fac7553569184760ab42069b46d9fecbf99836642004e1436f9024d0dc816b5353e40c56')
build() {
- cd $pkgname-$pkgver
- ./configure --prefix=/usr
- patch -p1 < "$srcdir"/libpng14.patch
- make
+ cd $pkgname-$pkgver
+ ./configure --prefix=/usr
+ patch -p1 <"$srcdir"/libpng14.patch
+ make
}
package() {
- cd $pkgname-$pkgver
- make DESTDIR="$pkgdir" install
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
}