create an Arch PKGBUILD

Summary:
Also including a little script that makes it easier to package your
local copy of the sources (instead of the default, cloning a new repo to
package).

Reviewers: sean

Reviewed By: sean

Differential Revision: https://phabricator.buildinspace.com/D126
This commit is contained in:
Jack O'Connor 2014-11-13 15:19:34 -08:00
parent c8c04232d6
commit fedbc308af
2 changed files with 44 additions and 0 deletions

27
packaging/arch/PKGBUILD Normal file
View File

@ -0,0 +1,27 @@
# Maintainer: Jack O'Connor <oconnor663@gmail.com>
pkgname=peru-git
pkgdesc='A tool for fetching code'
url='https://github.com/buildinspace/peru'
license=('MIT')
pkgver=0
pkgver() {
cd "$srcdir/peru"
echo $(git rev-list --count master).$(git rev-parse --short master)
}
pkgrel=1
arch=('any')
# Asyncio and pathlib are standard in Python 3.4, so they're not in the
# dependencies list.
depends=(python python-yaml python-docopt git)
optdepends=(
'mercurial: fetching from hg repos'
'subversion: fetching from svn repos'
)
source=('git://github.com/buildinspace/peru')
md5sums=('SKIP')
package() {
cd "$srcdir/peru"
python3 setup.py install --root="$pkgdir"
}

17
packaging/arch/makelocal.sh Executable file
View File

@ -0,0 +1,17 @@
#! /bin/bash
# By default, makepkg clones the source repo from github before building. To
# package your local copy of the sources (including any changes you've made),
# use this script.
#
# See `man makepkg` for relevant options, like -d to ignore missing
# dependencies. (The only dependency needed for packaging is python.)
set -e
cd $(dirname "$BASH_SOURCE")
rm -rf src
mkdir src
ln -s ../../../.. src/peru
makepkg -e "$@"