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

Felix Yan felixonmars at archlinux.org
Thu Oct 27 07:16:52 UTC 2016


    Date: Thursday, October 27, 2016 @ 07:16:51
  Author: felixonmars
Revision: 193773

upgpkg: systemd-swap 3.1.1-1

Modified:
  systemd-swap/trunk/PKGBUILD
  systemd-swap/trunk/systemd-swap.install

----------------------+
 PKGBUILD             |   17 +++++++++--------
 systemd-swap.install |    6 ++++--
 2 files changed, 13 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-10-27 05:42:10 UTC (rev 193772)
+++ PKGBUILD	2016-10-27 07:16:51 UTC (rev 193773)
@@ -3,7 +3,7 @@
 # Contributor: Timofey Titovets <Nefelim4ag at gmail.com>
 
 pkgname=systemd-swap
-pkgver=2.27.2
+pkgver=3.1.1
 pkgrel=1
 pkgdesc="Script for creating hybrid swap space from zram swaps, swap files and swap partitions."
 arch=('any')
@@ -12,16 +12,17 @@
 conflicts=(systemd-loop-swapfile zramswap zram)
 depends=('systemd' 'bash')
 makedepends=('git')
-backup=(etc/systemd-swap.conf)
+backup=(etc/systemd/swap.conf)
 install=$pkgname.install
 source=("git://github.com/Nefelim4ag/systemd-swap.git#tag=$pkgver")
 md5sums=('SKIP')
 
+prepare() {
+  # Upstream approach doesn't seem to work :/
+  sed -i 's_^PREFIX="/"$_PREFIX="$1"_' systemd-swap/install.sh
+}
+
 package() {
-  install -Dm644 "$srcdir"/$pkgname/systemd-swap.service "$pkgdir"/usr/lib/systemd/system/systemd-swap.service
-  install -Dm755 "$srcdir"/$pkgname/systemd-swap.sh      "$pkgdir"/usr/lib/systemd/scripts/systemd-swap.sh
-  install -Dm644 "$srcdir"/$pkgname/systemd-swap.conf    "$pkgdir"/etc/systemd-swap.conf
-
-  install -dm755 "$pkgdir"/etc/systemd
-  ln -svf "../systemd-swap.conf"                         "$pkgdir"/etc/systemd/swap.conf
+  cd systemd-swap
+  ./install.sh "$pkgdir"
 }

Modified: systemd-swap.install
===================================================================
--- systemd-swap.install	2016-10-27 05:42:10 UTC (rev 193772)
+++ systemd-swap.install	2016-10-27 07:16:51 UTC (rev 193773)
@@ -1,3 +1,5 @@
-post_install() {
-  echo "To enable: sudo systemctl enable systemd-swap. Config in /etc/systemd-swap.conf"
+post_upgrade() {
+  if [[ $(vercmp "$2" 3) < 0 ]]; then
+    echo "Since 3.0, the config file was moved to /etc/systemd/swap.conf, and incompatible with the old syntax. Please adjust your settings accordingly."
+  fi
 }



More information about the arch-commits mailing list