summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 24a40cafae1e6376db5bd4d9ad03eaf99d5387a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Mike Swanson <mikeonthecomputer@gmail.com>

pkgname=swapspace
pkgver=1.17
pkgrel=1
pkgdesc="A dynamic swap manager"
arch=('i686' 'x86_64')
url="https://github.com/Tookmund/Swapspace"
license=('GPL')
backup=(etc/swapspace.conf)
source=("$url/archive/v$pkgver.tar.gz"
        swapspace.service)
b2sums=('76a609f898aa6e41c9805498e3ad9a83cd8ab21d66a4df08e4df719cf581ae568f26ea8c023209cc2b6fbd7a8d3b92ad2264269bc610f54e4a1ed689c4ae5f67'
        '42690e95a18851248453542ed9d5612a786efd7803a50ef4893d2034727d5e62be7e3d945a63031de5fcaf54bceab89525de464cc5c4a137f23eb713545acfc1')

prepare() {
  cd "$srcdir/${pkgname^}-$pkgver"

  for patch in ../*.patch; do
    if [ ! -f "$patch" ]; then
      break;
    else
      patch -p1 -i "$patch"
    fi
  done

  autoreconf
}

build() {
  cd "$srcdir/${pkgname^}-$pkgver"
  ./configure \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --sbindir=/usr/bin \
    --prefix=/usr
  make
}

package() {
  cd "$srcdir/${pkgname^}-$pkgver"
  make DESTDIR="$pkgdir" install

  install -d "$pkgdir/usr/lib/systemd/system"
  install -m644 ../swapspace.service "$pkgdir/usr/lib/systemd/system"
}