updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / go-pkg-mpd-git / PKGBUILD
blobae9c61c9d8247d6f30bbb15e1720524f1aff8f46
1 pkgname=go-pkg-mpd-git
2 _goname=go-pkg-mpd
3 pkgver=20110809
4 pkgrel=1
5 pkgdesc="MPD API wrapper for Go (git version)"
6 url="https://github.com/jteeuwen/go-pkg-mpd"
7 license=('CC0')
8 depends=('go')
9 makedepends=('git')
10 options=("!strip")
11 arch=('i686' 'x86_64')
12 _gitroot="git://github.com/jteeuwen/go-pkg-mpd.git"
13 _gitname="go-pkg-mpd"
15 build() {
16     cd $srcdir
18     if [ -d $_gitname ] ; then
19         cd $_gitname && git pull origin
20         msg "The local files are updated."
21     else
22         git clone $_gitroot
23     fi
25     cd $srcdir
27     rm -rf $_gitname-build
28     git clone $_gitname{,-build}
30     msg "GIT checkout done or server timeout"
31     msg "Starting make..."
33     cd ${_gitname}-build
35     source /etc/profile.d/go.sh
36     gomake
39 package() {
40         cd ${srcdir}/${_gitname}-build
41         source /etc/profile.d/go.sh
42         mkdir -p "${pkgdir}/${GOROOT}/src/pkg/${_goname}"
43         # copy source files
44         cp -Rv ${srcdir}/${_gitname}/* "${pkgdir}/${GOROOT}/src/pkg/${_goname}"
45         # copy licence
46         install -D "${srcdir}/${_gitname}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
47         # install libraries
48         cp -v ${GOROOT}/src/Make.* "${pkgdir}/${GOROOT}/src/"
49         GOROOT=${pkgdir}/${GOROOT} gomake install
50         rm -f ${pkgdir}/${GOROOT}/src/Make.*