summaryrefslogtreecommitdiffstats
path: root/abs/extra/unrar/PKGBUILD
blob: 68bd852a22346f7aaca9adc18b9c61a67f6e310a (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
# $Id$
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: dorphell <dorphell@gmx.net>

pkgbase=unrar
pkgname=('unrar' 'libunrar')
pkgver=5.2.2
pkgrel=1
epoch=1
arch=('i686' 'x86_64')
url="http://www.rarlab.com/rar_add.htm"
license=('custom')
makedepends=('gcc-libs')
source=("http://www.rarlab.com/rar/unrarsrc-${pkgver}.tar.gz"
        'unrar-5.2.2-soname.patch')
md5sums=('69ef5af8442cbb7dfdebe298bfb9c61a'
         'cd9a5291db0379d73148872cf6e6d3ce')

prepare() {
  cd "${srcdir}/${pkgbase}"
  patch -Np1 -i "${srcdir}/unrar-5.2.2-soname.patch"
}

build() {
  cd "${srcdir}/${pkgbase}"
  cp -a ${srcdir}/unrar ${srcdir}/libunrar
  make -C "${srcdir}"/libunrar lib libversion=${pkgver} CXXFLAGS="-fPIC ${CXXFLAGS}"
  make CXXFLAGS="-fPIC ${CXXFLAGS}" STRIP="true"
}

package_unrar() {
  pkgdesc="The RAR uncompression program"
  depends=('gcc-libs')
  cd "${srcdir}/${pkgbase}"
  install -Dm755 unrar "${pkgdir}/usr/bin/unrar"
  # install license
  install -Dm644 license.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_libunrar() {
  pkgdesc="Library and header file for applications that use libunrar"
  depends=('gcc-libs')
  cd "${srcdir}/libunrar"
  install -Dm755 libunrar.so.${pkgver} "${pkgdir}/usr/lib/libunrar.so.${pkgver}"
  install -Dm644 dll.hpp "${pkgdir}/usr/include/unrar/dll.hpp"
  ln -s libunrar.so.${pkgver} "${pkgdir}/usr/lib/libunrar.so.5"
  ln -s libunrar.so.${pkgver} "${pkgdir}/usr/lib/libunrar.so"
  # install license
  install -Dm644 license.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}