[arch-commits] Commit in tcsh/trunk (PKGBUILD tcsh.install)

George Rawlinson grawlinson at gemini.archlinux.org
Wed Mar 23 01:17:42 UTC 2022


    Date: Wednesday, March 23, 2022 @ 01:17:42
  Author: grawlinson
Revision: 1171191

upgpkg: tcsh 6.24.00-2

* Switch source to git commit from upstream tarball.
* Modernise PKGBUILD & install file.

Modified:
  tcsh/trunk/PKGBUILD
  tcsh/trunk/tcsh.install

--------------+
 PKGBUILD     |   56 +++++++++++++++++++++++++++++++++++++++-----------------
 tcsh.install |   26 +++++++++++++++++---------
 2 files changed, 56 insertions(+), 26 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-03-23 00:56:02 UTC (rev 1171190)
+++ PKGBUILD	2022-03-23 01:17:42 UTC (rev 1171191)
@@ -1,40 +1,62 @@
 # Maintainer: Lukas Fleischer <lfleischer at archlinux.org>
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
 # Contributor: Eric Belanger <eric at archlinux.org>
 # Contributor: Judd Vinet <jvinet at zeroflux.org>
 
 pkgname=tcsh
 pkgver=6.24.00
-pkgrel=1
-pkgdesc='Enhanced version of the Berkeley C shell.'
+pkgrel=2
+pkgdesc='Enhanced version of the Berkeley C shell'
 arch=('x86_64')
 url='https://www.tcsh.org/'
 license=('BSD')
 depends=('ncurses' 'libxcrypt')
+makedepends=('git')
 backup=('etc/csh.cshrc'
         'etc/csh.login')
 install='tcsh.install'
-source=("https://astron.com/pub/tcsh/tcsh-${pkgver}.tar.gz"
-        'csh.cshrc'
-        'csh.login')
-md5sums=('6078b28439e2ee94c8df05c9d20f6159'
-         '7ca0fe6d1a1b9a0093f632499d4fb112'
-         '4869b9da87c79854e2cc97241f125853')
+_commit='9710f1315e2a927dcce7c005e903622659caa4ae'
+source=(
+  "$pkgname::git+https://github.com/tcsh-org/tcsh.git#commit=$_commit"
+  'csh.cshrc'
+  'csh.login'
+)
+sha512sums=('SKIP'
+            '0710c014b7b42ba8c69beb20ec2b8da44c9318013e83e8a38b2c94da1b11beb50a62cc9d82b7db1b3ee79bb0acf5f2a199e2ee2d745d541ea787e3c6a0069844'
+            '97f9f3e376517bd47aee67b48456b4892e0cb2c6f9c3e4b49d7b75cc23f52e69b06f024fbca1e72442d443720753b93fd9714160e551eab54d3de3757268d2d7')
+b2sums=('SKIP'
+        '016e65a672aba6d9b7283d63435a8ebd01818d56f11fb3c1203b1fd51fb1a67760c8f53b22be409319b3db18b0f81df09103de673579a5a5e1b6e07109069f94'
+        'da0fa27875507d646e869c5a8cdfecb793cd848c38e626704cdf5adb8ec2eef7fd98e3bab6eceea7d99fda25093364c48a8c44417575574a5ad0753b87cef2e3')
 
+pkgver() {
+  cd "$pkgname"
+
+  git describe --tags | sed -e 's/^TCSH//' -e 's/_/./g'
+}
+
 build() {
-  cd "${srcdir}/${pkgname}-${pkgver}"
+  cd "$pkgname"
 
-  ./configure --prefix=/usr --sysconfdir=/etc --bindir=/usr/bin
+  ./configure \
+    --prefix=/usr \
+    --sysconfdir=/etc \
+    --bindir=/usr/bin
+
   make
 }
 
 package() {
-  cd "${srcdir}/${pkgname}-${pkgver}"
+  cd "$pkgname"
 
-  make DESTDIR="${pkgdir}" mandir=/usr/share/man install install.man
+  make DESTDIR="$pkgdir" mandir=/usr/share/man install install.man
 
-  install -Dm0644 "${srcdir}/csh.cshrc" "${pkgdir}/etc/csh.cshrc"
-  install -Dm0644 "${srcdir}/csh.login" "${pkgdir}/etc/csh.login"
-  install -Dm0644 Copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-  ln -s tcsh "${pkgdir}/usr/bin/csh"
-  ln -s tcsh.1 "${pkgdir}/usr/share/man/man1/csh.1"
+  # shell configuration
+  install -vDm644 -t "$pkgdir/etc" ../csh.{cshrc,login}
+
+  # symlinks for tcsh -> csh
+  ln -s tcsh "$pkgdir/usr/bin/csh"
+  ln -s tcsh.1 "$pkgdir/usr/share/man/man1/csh.1"
+
+  # license
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" Copyright
 }

Modified: tcsh.install
===================================================================
--- tcsh.install	2022-03-23 00:56:02 UTC (rev 1171190)
+++ tcsh.install	2022-03-23 01:17:42 UTC (rev 1171191)
@@ -1,13 +1,21 @@
 post_install() {
-  if ! grep -qe '^/bin/tcsh$' etc/shells; then
-    echo /bin/tcsh >>etc/shells
-    echo /bin/csh >>etc/shells
-    echo 'Added tcsh and csh to /etc/shells.'
-  fi
+  # tcsh
+  grep -Fqx /bin/tcsh /etc/shells || echo /bin/tcsh >>/etc/shells
+  grep -Fqx /usr/bin/tcsh /etc/shells || echo /usr/bin/tcsh >>/etc/shells
+
+  # csh
+  grep -Fqx /bin/csh /etc/shells || echo /bin/csh >>/etc/shells
+  grep -Fqx /usr/bin/csh /etc/shells || echo /usr/bin/csh >>/etc/shells
 }
 
-pre_remove() {
-  sed -i -r '/^(\/usr)?\/bin\/tcsh$/d' /etc/shells
-  sed -i -r '/^(\/usr)?\/bin\/csh$/d' /etc/shells
-  echo 'Removed tcsh and csh from /etc/shells.'
+post_upgrade() {
+  post_install
 }
+
+post_remove() {
+  # tcsh
+  sed -i -r '/^(\/usr)?\/bin\/tcsh$/d' etc/shells
+
+  # csh
+  sed -i -r '/^(\/usr)?\/bin\/csh$/d' etc/shells
+}



More information about the arch-commits mailing list