summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9cff64a974dd22a75fba957009418e2c90ef59ae (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
47
# Maintainer: Qirui Wang <wqr.prg@gmail.com>

_name=openrsync
pkgname="$_name-git"
pkgver=0.5.0.r111.g8b61216
pkgrel=1
pkgdesc="BSD-licensed implementation of rsync"
arch=('x86_64')
url="https://github.com/kristapsdz/openrsync"
license=('ISC')
depends=('glibc')
makedepends=('git')
provides=("$_name")
conflicts=("$_name")
source=("git+https://github.com/kristapsdz/$_name.git")
sha256sums=('SKIP')

prepare() {
  cd "$_name"

  # Remove forced debug
  sed -i 's/CFLAGS="${CFLAGS} -g /CFLAGS="${CFLAGS} /' configure

  # LDFLAGS
  sed -i 's/$(CC) -o $@ /$(CC) $(LDFLAGS) -o $@ /' Makefile

  # Fix install permissions
  sed -i 's/"${INSTALL} -m 0555"/"${INSTALL} -m755"/' configure
  sed -i 's/"${INSTALL} -m 0444"/"${INSTALL} -m644"/' configure
}

pkgver() {
  cd "$_name"
  git describe --long --tags | sed 's/^VERSION_//;s/\([^-]*-g\)/r\1/;s/[_-]/./g'
}

build() {
  cd "$_name"
  ./configure LDFLAGS="$LDFLAGS" MANDIR=/usr/share/man PREFIX=/usr
  make
}

package() {
  cd "$_name"
  make DESTDIR="$pkgdir" install
  install -Dm644 "LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/licence"
}