summaryrefslogtreecommitdiff
path: root/community/os-prober/PKGBUILD
blob: 7af48dcb79271dd701a28e2ee96f5899a7d2a857 (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
# $Id: PKGBUILD 73961 2012-07-17 15:25:25Z tredaelli $
# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: darkcoder <mario_vazq@hotmail.com>

pkgname=os-prober
pkgver=1.54
pkgrel=1
pkgdesc="Utility to detect other OSes on a set of drives"
url="http://joey.kitenet.net/code/os-prober/"
arch=('i686' 'x86_64')
license=('GPL3')
depends=('sh')
source=(ftp://ftp.debian.org/debian/pool/main/o/${pkgname}/${pkgname}_${pkgver}.tar.gz)
md5sums=('9a7e8e5adeeaff4913f727fa2c95490a')
sha512sums=('2f0541a3c31d1c23c02f1e9543ac33e269b83f75eccedd8e47eefc2364d7ded9624660f11b7fe80c71cda3cbfde89aee191ec0bd6f656b877e4241e212c7b740')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # adjust lib dir to allow detection of 64-bit distros
  sed -i -e "s:/lib/ld\*\.so\*:/lib*/ld*.so*:g" os-probes/mounted/common/90linux-distro

  rm -f Makefile
  make newns
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -Dm755 linux-boot-prober "$pkgdir"/usr/bin/linux-boot-prober
  install -Dm755 os-prober "$pkgdir"/usr/bin/os-prober
  install -Dm755 newns "$pkgdir"/usr/lib/os-prober/newns
  install -Dm755 common.sh $pkgdir/usr/share/os-prober/common.sh  

  for dir in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
    install -dm755 "$pkgdir/usr/lib/$dir"
    install -m755 -t "$pkgdir/usr/lib/$dir" "$dir"/common/*
    [[ -d "$dir"/x86 ]] && install -m755 -t "$pkgdir/usr/lib/$dir" "$dir"/x86/*
  done

  install -Dm755 os-probes/mounted/powerpc/20macosx $pkgdir/usr/lib/os-probes/mounted/20macosx
  
  # create a empty labels file, will be used by os-prober at execution
  mkdir -p $pkgdir/var/lib/os-prober
  touch $pkgdir/var/lib/os-prober/labels 
  chmod 644 $pkgdir/var/lib/os-prober/labels
}