updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / par2cmdline-git / PKGBUILD
blobcbd2717dd7878cea838374e59010b0680f6eecd0
1 # Maintainer: BlackEagle < ike DOT devolder AT gmail DOT com >
2 pkgname=par2cmdline-git
3 pkgver=20120123
4 pkgrel=1
5 pkgdesc="A file verification and repair tool"
6 url="https://github.com/BlackIkeEagle/par2cmdline"
7 license="GPL"
8 makedepends=('git')
9 depends=('gcc-libs')
10 arch=('i686' 'x86_64')
11 source=()
13 if [ -e .githash_${CARCH} ] ; then
14         _gitphash=$(cat .githash_${CARCH})
15 else
16         _gitphash=""
19 _gitname='par2cmdline'
20 _gitroot='git://github.com/BlackIkeEagle/par2cmdline.git'
22 build() {
23         if [ -d ${srcdir}/${_gitname}/.git ] ; then
24                 ( cd ${srcdir}/${_gitname} && git pull origin )
25                 msg "The local files are updated."
26         else
27                 ( git clone --depth 1 ${_gitroot} ${_gitname} )
28         fi
29         msg "GIT checkout done or server timeout"
31         cd ${_gitname}
32         if [ "${_gitphash}" == $(git show | grep -m 1 commit | sed 's/commit //') ]; then
33                 msg "Git hash is the same as previous build"
34                 return 1
35         fi
37         msg "creating build directory"
38         cd ${srcdir}
39         [ -d ${_gitname}-build ] && rm -rf ${_gitname}-build
40         cp -a ${_gitname} ${_gitname}-build
42         msg "Starting make..."
43         cd ${_gitname}-build
45         # automake
46         aclocal
47         automake --add-missing
48         autoconf
49         # configure
50         ./configure --prefix=/usr
51         # make
52         make
55 check() {
56         cd ${_gitname}-build
57         make check
60 package() {
61         cd ${_gitname}-build
62         make DESTDIR=$startdir/pkg install
64         git show | grep -m 1 commit | sed 's/commit //' > ${startdir}/.githash_${CARCH}