updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / pacman-git / PKGBUILD
blob154a45da48dab4fc01ccff36ca34f40db12dcda5
1 # Maintainer: Dave Reisner <d@falconindy.com>
2 # Contributor: Thomas Dziedzic < gostrc at gmail >
3 # Contributor: godane <slaxemulator@gmail.com.com>
4 # Contributor: Andres Perera <aepd87@gmail.com>
6 pkgname=pacman-git
7 (( 42 )) && pkgname=(pacman-git pacman-contrib-git)
8 pkgver=20111228
9 pkgrel=1
10 arch=('i686' 'x86_64')
11 url="http://www.archlinux.org/pacman/"
12 license=('GPL')
13 makedepends=('git' 'asciidoc' 'curl>=7.19.4' 'gpgme' 'libarchive>=2.7.1')
14 checkdepends=('python2')
15 options=(!libtool !strip)
16 source=(pacman.conf
17         pacman.conf.x86_64
18         makepkg.conf)
19 md5sums=('e72cb52013729f893a5fd20b4c3be71d'
20          '89ecb8f589ae0fe86411ba049784fc7c'
21          '3c94d228b3d8611793a9b407fa87f3b9')
23 _gitroot="git://projects.archlinux.org/pacman.git"
24 _gitname="pacman"
26 build() {
27   msg 'Connecting to GIT server...'
29   if [[ -d $_gitname ]]; then
30     ( cd $_gitname && git pull origin )
31     msg 'The local files are updated.'
32   else
33     git clone $_gitroot
34   fi
36   msg 'GIT checkout done or server timeout'
37   msg 'Starting make...'
39   rm -rf $_gitname-build
40   git clone $_gitname{,-build}
41   cd $_gitname-build
43   ./autogen.sh
44   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-doc \
45     --enable-git-version --enable-debug
46   make
47   make -C contrib
50 check() {
51   cd "$srcdir/$_gitname-build"
53   make check
56 package_pacman-git() {
57   pkgdesc="A library-based package manager with dependency support. git version."
58   groups=('base')
59   depends=('bash' 'curl>=7.19.4' 'gpgme' 'libarchive>=2.7.1' 'pacman-mirrorlist')
60   optdepends=('fakeroot: for makepkg usage as normal user')
61   backup=(etc/pacman.conf etc/makepkg.conf)
62   conflicts=('pacman')
63   provides=('pacman')
65   cd "$srcdir/$_gitname-build"
67   make DESTDIR=$pkgdir install
69   # install Arch specific stuff
70   mkdir -p $pkgdir/etc
71   case "$CARCH" in
72     i686)
73       install -m644 $srcdir/pacman.conf $pkgdir/etc/pacman.conf
74       ;;
75     x86_64)
76       install -m644 $srcdir/pacman.conf.x86_64 $pkgdir/etc/pacman.conf
77       ;;
78   esac
79   install -m644 $srcdir/makepkg.conf $pkgdir/etc/
80   # set things correctly in the default conf file
81   case "$CARCH" in
82     i686)
83       mycarch="i686"
84       mychost="i686-pc-linux-gnu"
85       myflags="-march=i686 "
86       ;;
87     x86_64)
88       mycarch="x86_64"
89       mychost="x86_64-unknown-linux-gnu"
90       myflags="-march=x86-64 "
91       ;;
92   esac
93   sed -i $pkgdir/etc/makepkg.conf \
94     -e "s|@CARCH[@]|$mycarch|g" \
95     -e "s|@CHOST[@]|$mychost|g" \
96     -e "s|@CARCHFLAGS[@]|$myflags|g"
98   # install completion files
99   mkdir -p $pkgdir/etc/bash_completion.d/
100   install -m644 contrib/bash_completion $pkgdir/etc/bash_completion.d/pacman
101   mkdir -p $pkgdir/usr/share/zsh/site-functions/
102   install -m644 contrib/zsh_completion $pkgdir/usr/share/zsh/site-functions/_pacman
105 package_pacman-contrib-git() {
106   depends=('pacman')
107   provides=('pacman-contrib')
108   conflicts=('pacman-contrib')
109   pkgdesc="Utilities for use with the pacman package manager"
111   paccontrib=(
112     bacman
113     paccache
114     pacdiff
115     paclist
116     pacscripts
117     pacsearch
118     paclog-pkglist
119     pacsysclean
120   )
122   cd "$srcdir/$_gitname-build/contrib"
123   for script in "${paccontrib[@]}"; do
124     install -Dm755 ${script} ${pkgdir}/usr/bin/${script}
125   done
127   install -Dm644 PKGBUILD.vim ${pkgdir}/usr/share/vim/vimfiles/syntax/PKGBUILD.vim
128   install -dm755 ${pkgdir}/usr/share/vim/vimfiles/ftdetect
129   echo "au BufNewFile,BufRead PKGBUILD set filetype=PKGBUILD" \
130     > ${pkgdir}/usr/share/vim/vimfiles/ftdetect/PKGBUILD.vim
133 # vim: set ts=2 sw=2 et: