Date: Friday, February 17, 2023 @ 20:56:06
  Author: dvzrv
Revision: 469228

upgpkg: mutt 2.2.9-3: Rebuild to move system-wide config to /etc/mutt/.

Move system-wide config to /etc/mutt/ and remove duplicate .dist files.
Create symlink to /etc/mime.types provided by mailcap.
https://bugs.archlinux.org/task/77553

Added:
  mutt/trunk/mutt.install
Modified:
  mutt/trunk/PKGBUILD

--------------+
 PKGBUILD     |   16 +++++++++-------
 mutt.install |   11 +++++++++++
 2 files changed, 20 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-17 20:55:34 UTC (rev 469227)
+++ PKGBUILD    2023-02-17 20:56:06 UTC (rev 469228)
@@ -4,7 +4,7 @@
 
 pkgname=mutt
 pkgver=2.2.9
-pkgrel=2
+pkgrel=3
 pkgdesc="Small but very powerful text-based mail client"
 arch=(x86_64)
 url="http://www.mutt.org/";
@@ -17,7 +17,8 @@
   'python: for experimental mutt_oath2.py'
   'smtp-forwarder: to send mail'
 )
-backup=(etc/Muttrc)
+backup=(etc/$pkgname/Muttrc)
+install=$pkgname.install
 
source=(https://bitbucket.org/$pkgname/$pkgname/downloads/$pkgname-$pkgver.tar.gz{,.asc})
 
sha512sums=('d4d308ba573ba6e43b6dd2c131d0dc345163bd375f19a9038c9eeaf271f9da88043951f6c74658ff1a9d7a8fdcce28809aba50ab3f5aa0d34b77cf4989bc054f'
             'SKIP')
@@ -33,7 +34,7 @@
 build() {
   local configure_options=(
     --prefix=/usr
-    --sysconfdir=/etc
+    --sysconfdir=/etc/$pkgname
     --enable-autocrypt
     --enable-compressed
     --enable-debug
@@ -68,8 +69,9 @@
   )
 
   make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
-  install -vDm 644 $pkgname-$pkgver/contrib/gpg.rc 
"$pkgdir/etc/Muttrc.gpg.dist"
-
-  # /etc/mime.types is provided by mailcap
-  rm "$pkgdir/etc/mime.types"{,.dist}
+  # we backup /etc/mutt/Muttrc and don't need another copy
+  rm -v "$pkgdir/etc/$pkgname/Muttrc.dist"
+  # a more comprehensive list of mime types is provided by mailcap in 
/etc/mime.types
+  rm -v "$pkgdir/etc/$pkgname/mime.types"{,.dist}
+  ln -sv ../mime.types "$pkgdir/etc/$pkgname/mime.types"
 }

Added: mutt.install
===================================================================
--- mutt.install                                (rev 0)
+++ mutt.install        2023-02-17 20:56:06 UTC (rev 469228)
@@ -0,0 +1,11 @@
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+  if (( $(vercmp "$2" '2.2.9-3') <= 0)); then
+    cat <<MSG
+>>> The system-wide configuration location has moved to /etc/mutt/Muttrc.
+    Samples can be found below /usr/share/doc/mutt/samples/.
+MSG
+  fi
+}
+

Reply via email to