summary refs log tree commit diff
path: root/def/bzip2
blob: 00c66db0441dcd1ef1bc57186cf364c758953204 (plain) (blame)
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
pkgname=bzip2
version=1.0.8
distfiles="https://sourceware.org/pub/${pkgname}/${pkgname}-${version}.tar.gz"

do_build() {
  make ${makejobs} CFLAGS="$CFLAGS -fPIC $LDFLAGS" LDFLAGS="$LDFLAGS" -f Makefile-libbz2_so
  make ${makejobs} CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" bzip2recover libbz2.a
}

do_install() {
  # XXX ugly

  install -Dm755 bzip2-shared $DESTDIR/usr/bin/bzip2
  install -Dm755 bzip2recover $DESTDIR/usr/bin/
  ln -sf bzip2 ${DESTDIR}/usr/bin/bunzip2
  ln -sf bzip2 ${DESTDIR}/usr/bin/bzcat
  install -m755 bzdiff bzgrep bzmore ${DESTDIR}/usr/bin

  install -Dm644 libbz2.so.${version} ${DESTDIR}/usr/lib/libbz2.so.${version}
  ln -s libbz2.so.${version} ${DESTDIR}/usr/lib/libbz2.so
  ln -s libbz2.so.${version} ${DESTDIR}/usr/lib/libbz2.so.1
  ln -s libbz2.so.${version} ${DESTDIR}/usr/lib/libbz2.so.1.0

  install -Dm644 libbz2.a ${DESTDIR}/usr/lib/libbz2.a
  install -Dm644 bzlib.h ${DESTDIR}/usr/include/bzlib.h

  install -Dm644 bzip2.1 ${DESTDIR}/usr/share/man/man1/bzip2.1
  ln -sf bzip2.1 ${DESTDIR}/usr/share/man/man1/bunzip2.1
  ln -sf bzip2.1 ${DESTDIR}/usr/share/man/man1/bzcat.1
  ln -sf bzip2.1 ${DESTDIR}/usr/share/man/man1/bzip2recover.1
}