rockchipのツールrkutils PKGBUILDファイル

1663 ワード

DESTDIR ?= $(CURDIR)/usr/bin
bin_files := rkafpack rkcrc rkdump rkflash rkunpack
build:$(bin_files)
    mkdir -pv $(DESTDIR) ;\
    cp $(bin_files) $(DESTDIR)
rkafpack:rkafpack.c
    gcc -o $@ $^
rkcrc:rkcrc.c
    gcc -o $@ $^
rkdump:rkdump.c
    gcc -o $@ $^
rkflash:rkflash.c
    gcc -o $@ $^
rkunpack:rkunpack.c
    gcc -o $@ $^
install:$(bin_files)
    mkdir -pv $(DESTDIR)/usr/bin ;\
    cp $(bin_files) $(DESTDIR)/usr/bin/
# Contributor: GunsNRose <zlbgps AT gmail.com>>
_gitname=rkutils
_gitroot='https://github.com/naobsd/rkutils'
pkgname=${_gitname}-git
pkgver=20130929
pkgrel=1
pkgdesc="rockchip utils tool"
arch=('i686' 'x86_64')
url="http://linux-rockchip.info/mw/index.php?title=Building_Kernel_for_Linux_Distribution#Build_the_kernel_2"
license=('GPL')
#depends=('python')
makedepends=('git')
provides=(${_gitname})
source=("Makefile")
build() {
  cd "$srcdir"
  if [ ! -d "$srcdir/${_gitname}" ] ; then
      git clone --depth=1 ${_gitroot}
  else
      cd "$srcdir/${_gitname}" || return 1
      git pull
  fi
  if [  -d "$srcdir/${_gitname}-build" ] ; then
      rm -rf "$srcdir/${_gitname}-build"
  fi
  if [ ! -d "$srcdir/${_gitname}-build" ] ; then
      cp -a "$srcdir/${_gitname}" "$srcdir"/${_gitname}-build || return 1
  fi
  cd "$srcdir"/${_gitname}-build
  cp $srcdir/Makefile ./
  make build
}
package() {
  cd "$srcdir"/${_gitname}-build
  make DESTDIR=${pkgdir} install
}
md5sums=('175afc4b8d44a1ec2b8833ab86a5433b')