summaryrefslogtreecommitdiff
path: root/multilib/lib32-bzip2/PKGBUILD
blob: e077d8a45eb2911acff217202353a59e8e48c04a (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
#$Id: PKGBUILD 53422 2011-08-03 14:41:13Z ibiru $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: TryA <tryagainprod {at} gmail.com>

_pkgbasename=bzip2
pkgname=lib32-bzip2
pkgver=1.0.6
pkgrel=1
pkgdesc="A high-quality data compression program (32-bit)"
arch=('x86_64' 'mips64el')
license=('custom')
url="http://sources.redhat.com/bzip2"
depends=('lib32-glibc' $_pkgbasename)
makedepends=('gcc-multilib')
source=(http://www.bzip.org/$pkgver/bzip2-$pkgver.tar.gz)
md5sums=('00b516f4704d4a7cb50a1d97e6e8e15b')

build() {
  cd "${srcdir}/${_pkgbasename}-${pkgver}"

  sed -i "s|CC=gcc|CC=gcc -m32|" Makefile
  sed -i "s|CC=gcc|CC=gcc -m32|" Makefile-libbz2_so

  # add large-file support
  sed -e 's/^CFLAGS=\(.*\)$/CFLAGS=\1 \$(BIGFILES)/' -i ./Makefile-libbz2_so

  # use our optimization
  sed -i "s|-O2|${CFLAGS}|g" Makefile
  sed -i "s|-O2|${CFLAGS}|g" Makefile-libbz2_so

  make -f Makefile-libbz2_so
  make libbz2.a
}

package(){
  cd "${srcdir}/${_pkgbasename}-${pkgver}"
  install -Dm755 libbz2.so.1.0.6 "${pkgdir}"/usr/lib32/libbz2.so.1.0.6
  ln -s libbz2.so.1.0.6 "${pkgdir}"/usr/lib32/libbz2.so
  ln -s libbz2.so.1.0.6 "${pkgdir}"/usr/lib32/libbz2.so.1
  ln -s libbz2.so.1.0.6 "${pkgdir}"/usr/lib32/libbz2.so.1.0

  install -Dm644 libbz2.a ${pkgdir}/usr/lib32/libbz2.a
}