Created
March 21, 2015 20:08
-
-
Save InfernoZeus/24e201605ffa67aafc5f to your computer and use it in GitHub Desktop.
AUR swapspace package fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- swapspace-1.10/Makefile.orig 2006-01-03 20:19:35.000000000 -0800 | |
+++ swapspace-1.10/Makefile 2011-10-13 11:22:23.950648477 -0700 | |
@@ -3,7 +3,7 @@ | |
SWAPPARENT=/var/lib | |
SWAPDIR=$(SWAPPARENT)/swapspace | |
-all: VERSION DATE | |
+all: | |
+$(MAKE) -C src VERSION="`cat VERSION`" DATE="`cat DATE`" | |
+$(MAKE) -C doc VERSION="`cat VERSION`" DATE="`cat DATE`" | |
@@ -16,18 +16,17 @@ | |
install: all | |
install -d $(DESTDIR)/$(SWAPPARENT) | |
install -d -m700 $(DESTDIR)/$(SWAPDIR) | |
- install -d $(DESTDIR)/usr/sbin $(DESTDIR)/etc $(DESTDIR)/etc/init.d | |
+ install -d $(DESTDIR)/usr/bin $(DESTDIR)/etc | |
install -d $(DESTDIR)/usr/share/man/man8 | |
strip src/swapspace || true | |
- install -m755 src/swapspace $(DESTDIR)/usr/sbin | |
+ install -m755 src/swapspace $(DESTDIR)/usr/bin | |
install -m644 swapspace.conf $(DESTDIR)/etc | |
- install -m744 debian/swapspace.init $(DESTDIR)/etc/init.d/swapspace | |
install -m644 doc/swapspace.8 $(DESTDIR)/usr/share/man/man8 | |
uninstall: | |
- /usr/sbin/swapspace -e | |
+ /usr/bin/swapspace -e | |
$(RM) -r $(SWAPDIR) | |
- $(RM) /usr/sbin/swapspace /etc/swapspace.conf /etc/init.d/swapspace | |
+ $(RM) /usr/bin/swapspace /etc/swapspace.conf | |
$(RM) /usr/share/man/man8/swapspace.8 | |
dist : distclean VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Mike Swanson <[email protected]> | |
pkgname=swapspace | |
pkgver=1.10 | |
pkgrel=4 | |
pkgdesc="A dynamic swap manager" | |
arch=('i686' 'x86_64') | |
url="http://pqxx.org/development/swapspace" | |
license=('GPL') | |
backup=(etc/swapspace.conf) | |
source=(http://pqxx.org/download/software/swapspace/$pkgname-$pkgver.tar.gz | |
Makefile.patch | |
swapspace.confd | |
systemd.scripts.swapspace | |
systemd.system.swapspace) | |
sha256sums=('37256d6759be5cefbb50afbeba8bb0f159b3488aecd972898fcc6f4d5e6a3573' | |
'1b6821b96b6ffac4c132cf86ec94b950fcae635073525229b5206fdb9f629216' | |
'233fec29540b5cf7ae3d49d34deac9a9a044665bd942e817d6b98ae3a91b9857' | |
'21315ea862c72d8a535710830f2647d6842944166342943025aaa9a2b6e5c664' | |
'ba2bfba29da4e6423dadff438b57831f75e8a362c2f9526fa1387e9bab6ddc77') | |
options=(!buildflags) | |
build() { | |
cd "$srcdir/$pkgname-$pkgver" | |
patch -Np1 -i ${srcdir}/Makefile.patch | |
make | |
} | |
package() { | |
cd "$srcdir/$pkgname-$pkgver" | |
make DESTDIR="$pkgdir/" install | |
install -Dm644 ../swapspace.confd "${pkgdir}"/etc/conf.d/swapspace | |
install -Dm755 ../systemd.scripts.swapspace \ | |
"${pkgdir}"/usr/lib/systemd/scripts/swapspace | |
install -Dm644 ../systemd.system.swapspace \ | |
"${pkgdir}"/usr/lib/systemd/system/swapspace.service | |
} | |
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PIDFILE=/var/run/swapspace.pid | |
PID=$(cat $PIDFILE 2> /dev/null) | |
start() { | |
SWAPSPACE_ARGS="-q -d -p /var/run/swapspace.pid" | |
[ -r /etc/conf.d/swapspace ] && . /etc/conf.d/swapspace | |
if ! readlink -q /proc/$PID/exe | grep -q \^/usr/bin/swapspace; then | |
unset PID | |
rm -f $PIDFILE | |
fi | |
[[ -z $PID ]] && /usr/bin/swapspace $SWAPSPACE_ARGS | |
} | |
stop() { | |
/usr/bin/swapspace -e | |
[[ ! -z $PID ]] && kill $PID &> /dev/null | |
} | |
case $1 in | |
start|stop) | |
"$1" | |
;; | |
*) | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment