[pacman-dev] [PATCH] Touch up proto files

Daniel M. Capella polyzen at archlinux.org
Sun Apr 12 21:01:29 UTC 2020


- split: Fix erroneous $pkgname calls to use $pkgbase

- VCS:

  - Add missing fields
  - Remove unnecessary $srcdir's
  - Move ./autogen.sh to prepare()

- 80 char line length for comments and make license note stand out

- Add ./autogen.sh to the other proto's

Signed-off-by: Daniel M. Capella <polyzen at archlinux.org>
---
 proto/PKGBUILD-split.proto | 18 ++++++++++--------
 proto/PKGBUILD-vcs.proto   | 21 +++++++++++++--------
 proto/PKGBUILD.proto       |  1 +
 3 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/proto/PKGBUILD-split.proto b/proto/PKGBUILD-split.proto
index 9898ef81..6fc91a56 100644
--- a/proto/PKGBUILD-split.proto
+++ b/proto/PKGBUILD-split.proto
@@ -1,7 +1,8 @@
-# This is an example of a PKGBUILD for splitting packages. Use this as a
-# start to creating your own, and remove these comments. For more information,
-# see 'man PKGBUILD'. NOTE: Please fill out the license field for your package!
-# If it is unknown, then please put 'unknown'.
+# This is an example of a PKGBUILD for splitting packages. Use this as a start
+# to creating your own, and remove these comments. For more information, see
+# 'man PKGBUILD'.
+# NOTE: Please fill out the license field for your package! If it is unknown,
+# then please put 'unknown'.
 
 # Maintainer: Your Name <youremail at domain.com>
 pkgname=('pkg1' 'pkg2')
@@ -26,14 +27,15 @@ options=()
 install=
 changelog=
 source=("$pkgbase-$pkgver.tar.gz"
-        "$pkgname-$pkgver.patch")
+        "$pkgbase-$pkgver.patch")
 noextract=()
 md5sums=()
 validpgpkeys=()
 
 prepare() {
-	cd "$pkgname-$pkgver"
-	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
+	cd "$pkgbase-$pkgver"
+	patch -p1 -i "$srcdir/$pkgbase-$pkgver.patch"
+	./autogen.sh
 }
 
 build() {
@@ -43,7 +45,7 @@ build() {
 }
 
 check() {
-	cd "$pkgname-$pkgver"
+	cd "$pkgbase-$pkgver"
 	make -k check
 }
 
diff --git a/proto/PKGBUILD-vcs.proto b/proto/PKGBUILD-vcs.proto
index ae9956a9..01eddf98 100644
--- a/proto/PKGBUILD-vcs.proto
+++ b/proto/PKGBUILD-vcs.proto
@@ -1,5 +1,6 @@
-# This is an example PKGBUILD file. Use this as a start to creating your own,
-# and remove these comments. For more information, see 'man PKGBUILD'.
+# This is an example of a PKGBUILD for VCS packages. Use this as a start to
+# creating your own, and remove these comments. For more information, see 'man
+# PKGBUILD'.
 # NOTE: Please fill out the license field for your package! If it is unknown,
 # then please put 'unknown'.
 
@@ -10,6 +11,7 @@
 pkgname=NAME-VCS # '-bzr', '-git', '-hg' or '-svn'
 pkgver=VERSION
 pkgrel=1
+epoch=
 pkgdesc=""
 arch=()
 url=""
@@ -17,21 +19,24 @@ license=('GPL')
 groups=()
 depends=()
 makedepends=('VCS_PACKAGE') # 'bzr', 'git', 'mercurial' or 'subversion'
+checkdepends=()
 provides=("${pkgname%-VCS}")
 conflicts=("${pkgname%-VCS}")
 replaces=()
 backup=()
 options=()
 install=
+changelog=
 source=('FOLDER::VCS+URL#FRAGMENT')
 noextract=()
 md5sums=('SKIP')
+validpgpkeys=()
 
 # Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
 # a description of each element in the source array.
 
 pkgver() {
-	cd "$srcdir/${pkgname%-VCS}"
+	cd "${pkgname%-VCS}"
 
 # The examples below are not absolute and need to be adapted to each repo. The
 # primary goal is to generate version numbers that will increase according to
@@ -56,23 +61,23 @@ pkgver() {
 }
 
 prepare() {
-	cd "$srcdir/${pkgname%-VCS}"
+	cd "${pkgname%-VCS}"
 	patch -p1 -i "$srcdir/${pkgname%-VCS}.patch"
+	./autogen.sh
 }
 
 build() {
-	cd "$srcdir/${pkgname%-VCS}"
-	./autogen.sh
+	cd "${pkgname%-VCS}"
 	./configure --prefix=/usr
 	make
 }
 
 check() {
-	cd "$srcdir/${pkgname%-VCS}"
+	cd "${pkgname%-VCS}"
 	make -k check
 }
 
 package() {
-	cd "$srcdir/${pkgname%-VCS}"
+	cd "${pkgname%-VCS}"
 	make DESTDIR="$pkgdir/" install
 }
diff --git a/proto/PKGBUILD.proto b/proto/PKGBUILD.proto
index a2c600d5..e72b1aa8 100644
--- a/proto/PKGBUILD.proto
+++ b/proto/PKGBUILD.proto
@@ -33,6 +33,7 @@ validpgpkeys=()
 prepare() {
 	cd "$pkgname-$pkgver"
 	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
+	./autogen.sh
 }
 
 build() {
-- 
2.26.0


More information about the pacman-dev mailing list