summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6dc7e5bc82a14f041514647dcbccfd2001b197a8 (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
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Paul Bredbury <brebs@sent.com>
# Contributor: Matt McDonald <metzen@gmail.com>

pkgname=libpar2
pkgver=0.2
pkgrel=10
pkgdesc='Parity checking library'
arch=('x86_64')
url='http://parchive.sourceforge.net'
license=('GPL')
depends=(
  'gcc-libs' # libgcc_s.so libstdc++.so
  'glibc' # libc.so libm.so
  'libsigc++' # libsigc-2.0.so
  )
provides=('libpar2.so')
source=(
  "http://downloads.sourceforge.net/sourceforge/parchive/${pkgname}-${pkgver}.tar.gz"
  'libpar2-0.2-bugfixes.patch'
  'libpar2-0.2-cancel.patch'
)
sha256sums=(
  '074fbf840f73b1e13e0405fce261078c81c8c0a4859e30a7bba10510f9199908'
  'bcdb0cf45b97b99bc2fb05074887bd73be15745d5d2ce94d65bd0e0c248fb341'
  'b05e08033dd2056b47c5610a5bd1d74b93dc283d2f798bfc0d3d9e3fd4f9da14'
)

prepare() {
  mkdir -p build

  patch -d "${pkgname}-${pkgver}" -p2 -i "${srcdir}/libpar2-0.2-bugfixes.patch"
  patch -d "${pkgname}-${pkgver}" -p2 -i "${srcdir}/libpar2-0.2-cancel.patch"
}

build() {
  cd build

  export CXXFLAGS="$CXXFLAGS -std=gnu++11"
  "../${pkgname}-${pkgver}/configure" \
    --prefix=/usr

  make
}

package() {
  make -C build DESTDIR="${pkgdir}" install

  cd "${pkgname}-${pkgver}"

  # Missing headers (?)
  for _i in *.h; do
    install -Dm644 "${_i}" "${pkgdir}/usr/include/libpar2/${_i}"
  done

  # Docs
  install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}/" AUTHORS PORTING README ROADMAP
}