summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3ad8af14faf0aa718a2a15aeaa82b4ae5764382f (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: ValdikSS <iam@valdikss.org.ru>

pkgname=libusb0
pkgver=0.1.12
pkgrel=6
pkgdesc="Library to enable user space application programs to communicate with USB devices. 0.x branch. Debian's binary."
arch=('i686' 'x86_64')
url="http://libusb.sourceforge.net/"
license=('LGPL')
depends=('sh')
provides=('libusb-compat')
#replaces=('libusb-compat')
conflicts=('libusb-compat')
_debianver_="0.1.12-25"
_debianver="0.1-4_$_debianver_"
source_i686=("http://ftp.debian.org/debian/pool/main/libu/libusb/libusb-${_debianver}_i386.deb"
             "http://ftp.debian.org/debian/pool/main/libu/libusb/libusb-dev_${_debianver_}_i386.deb")
md5sums_i686=('316254e4ae2ff97f520948ffbb4af1ad'
              '9f3e584547a8643a3efd6d3901f846cb')

source_x86_64=("http://ftp.debian.org/debian/pool/main/libu/libusb/libusb-${_debianver}_amd64.deb"
              "http://ftp.debian.org/debian/pool/main/libu/libusb/libusb-dev_${_debianver_}_amd64.deb")
md5sums_x86_64=('582aee4738aecee1ad2d4c725510b419'
                'a1f65ae086a6085ff4f99e26195ce102')

noextract=("${source[@]%%::*}")

prepare() {
  ar x ${srcdir}/libusb-dev_${_debianver_}*.deb
  mv ${srcdir}/data.tar.xz ${srcdir}/data-dev.tar.xz
  ar x libusb-${_debianver}*.deb
}

package() {
  tar axvf ${srcdir}/data.tar.xz -C ${pkgdir}/
  tar axvf ${srcdir}/data-dev.tar.xz -C ${pkgdir}/
  mkdir -p ${pkgdir}/usr/lib
  mv ${pkgdir}/usr/lib/x86_64-linux-gnu/* ${pkgdir}/usr/lib || true
  mv ${pkgdir}/usr/lib/i386-linux-gnu/* ${pkgdir}/usr/lib || true
  mv ${pkgdir}/lib/x86_64-linux-gnu/* ${pkgdir}/usr/lib || true
  mv ${pkgdir}/lib/i386-linux-gnu/* ${pkgdir}/usr/lib || true
  rm ${pkgdir}/usr/lib/libusb.so
  ln -s libusb-0.1.so.4 ${pkgdir}/usr/lib/libusb.so
  rm -r ${pkgdir}/lib/i386-linux-gnu ${pkgdir}/lib/x86_64-linux-gnu \
        ${pkgdir}/usr/lib/i386-linux-gnu ${pkgdir}/usr/lib/x86_64-linux-gnu || true
  rm -rf ${pkgdir}/lib/
}