Commit bd5be0e6 authored by matt mooney's avatar matt mooney Committed by Allan McRae
Browse files

prototypes: cleanup



Quote all variables; change to the extended test keyword; and a few
other minor changes for consistency across PKGBUILDs.
Signed-off-by: default avatarmatt mooney <mfm@muteddisk.com>
Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
parent a02cc4e4
......@@ -27,22 +27,22 @@ source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_bzrtrunk="BZRURL"
_bzrmod="MODENAME"
_bzrtrunk=BZRURL
_bzrmod=MODNAME
build() {
cd "$srcdir"
msg "Connecting to Bazaar server...."
if [ -d $_bzrmod ] ; then
cd ${_bzrmod} && bzr --no-plugins pull ${_bzrtrunk} -r ${pkgver}
if [[ -d "$_bzrmod" ]]; then
cd "$_bzrmod" && bzr --no-plugins pull "$_bzrtrunk" -r "$pkgver"
msg "The local files are updated."
else
bzr --no-plugins branch ${_bzrtrunk} ${_bzrmod} -q -r ${pkgver}
bzr --no-plugins branch "$_bzrtrunk" "$_bzrmod" -q -r "$pkgver"
fi
msg "Bazaar checkout done or server timeout"
msg "Starting make..."
msg "Starting build..."
rm -rf "$srcdir/$_bzrmod-build"
cp -r "$srcdir/$_bzrmod" "$srcdir/$_bzrmod-build"
......@@ -51,7 +51,6 @@ build() {
#
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
make
......@@ -61,3 +60,5 @@ package() {
cd "$srcdir/$_bzrmod-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
......@@ -27,32 +27,31 @@ source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_cvsroot="CVSROOT"
_cvsmod="MODNAME"
_cvsroot=CVSROOT
_cvsmod=MODNAME
build() {
cd "$srcdir"
msg "Connecting to $_cvsmod.sourceforge.net CVS server...."
if [ -d $_cvsmod/CVS ]; then
cd $_cvsmod
if [[ -d "$_cvsmod/CVS" ]]; then
cd "$_cvsmod"
cvs -z3 update -d
else
cvs -z3 -d $_cvsroot co -D $pkgver -f $_cvsmod
cd $_cvsmod
cvs -z3 -d "$_cvsroot" co -D "$pkgver" -f "$_cvsmod"
cd "$_cvsmod"
fi
msg "CVS checkout done or server timeout"
msg "Starting make..."
msg "Starting build..."
rm -rf "$srcdir/$_cvsmod-build"
cp -r "$srcdir/$_cvsmod" "$srcdir/$_cvsmod-build"
cd "$srcdir/$_cvsmod-build"
#
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
make
......@@ -62,3 +61,5 @@ package() {
cd "$srcdir/$_cvsmod-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
......@@ -27,35 +27,32 @@ source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_darcstrunk="DARCSURL"
_darcsmod="MODNAME"
_darcstrunk=DARCSURL
_darcsmod=MODNAME
build() {
cd "$srcdir"
msg "Checking for previous build...."
msg "Checking for previous build"
if [[ -d $_darcsmod/_darcs ]]
then
if [[ -d "$_darcsmod/_darcs" ]]; then
msg "Retrieving missing patches"
cd $_darcsmod
darcs pull -a $_darcstrunk/$_darcsmod
cd "$_darcsmod"
darcs pull -a "$_darcstrunk/$_darcsmod"
else
msg "Retrieving complete sources"
darcs get --partial --set-scripts-executable $_darcstrunk/$_darcsmod
cd $_darcsmod
darcs get --partial --set-scripts-executable "$_darcstrunk/$_darcsmod"
cd "$_darcsmod"
fi
rm -rf "$srcdir/$_darcsmod-build"
cp -r "$srcdir/$_darcsmod" "$srcdir/$_darcsmod-build"
cd "$srcdir/$_darcsmod-build"
msg "Starting build"
msg "Starting build..."
#
# BUILD
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
make
......@@ -65,3 +62,5 @@ package() {
cd "$srcdir/$_darcsmod-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
......@@ -27,22 +27,22 @@ source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_gitroot="GITURL"
_gitname="MODENAME"
_gitroot=GITURL
_gitname=MODENAME
build() {
cd "$srcdir"
msg "Connecting to GIT server...."
if [ -d $_gitname ] ; then
cd $_gitname && git pull origin
if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone $_gitroot $_gitname
git clone "$_gitroot" "$_gitname"
fi
msg "GIT checkout done or server timeout"
msg "Starting make..."
msg "Starting build..."
rm -rf "$srcdir/$_gitname-build"
git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
......@@ -51,7 +51,6 @@ build() {
#
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
make
......@@ -61,3 +60,5 @@ package() {
cd "$srcdir/$_gitname-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
......@@ -38,8 +38,10 @@ package() {
cd "$srcdir/$pkgname-$pkgver"
make -j1 GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="$pkgdir/" install
install -m755 -d "$pkgdir"/usr/share/gconf/schemas
gconf-merge-schema "$pkgdir"/usr/share/gconf/schemas/${pkgname}.schemas \
install -m755 -d "$pkgdir/usr/share/gconf/schemas"
gconf-merge-schema "$pkgdir/usr/share/gconf/schemas/$pkgname.schemas" \
"$pkgdir"/etc/gconf/schemas/*.schemas
rm -f "$pkgdir"/etc/gconf/schemas/*.schemas
}
# vim:set ts=2 sw=2 et:
......@@ -32,8 +32,8 @@ build() {
runhaskell Setup build
#
# Setup registration phase for library packages
# Also requires an install script. See proto-haskell.install
# Setup registration phase for library packages. This also requires an install
# script; see proto-haskell.install.
#
runhaskell Setup register --gen-script
runhaskell Setup unregister --gen-script
......@@ -43,8 +43,8 @@ package() {
cd "$srcdir/***-$pkgver"
runhaskell Setup copy --destdir="$pkgdir/"
install -Dm744 register.sh "$pkgdir"/usr/share/haskell/$pkgname/register.sh
install -m744 unregister.sh "$pkgdir"/usr/share/haskell/$pkgname/unregister.sh
install -Dm744 register.sh "$pkgdir/usr/share/haskell/$pkgname/register.sh"
install -m744 unregister.sh "$pkgdir/usr/share/haskell/$pkgname/unregister.sh"
}
# vim:set ts=2 sw=2 et:
......@@ -27,23 +27,23 @@ source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_hgroot="HGURL"
_hgrepo="MODENAME"
_hgroot=HGURL
_hgrepo=REPONAME
build() {
cd "$srcdir"
msg "Connecting to Mercurial server...."
if [ -d $_hgrepo ] ; then
cd $_hgrepo
if [[ -d "$_hgrepo" ]]; then
cd "$_hgrepo"
hg pull -u
msg "The local files are updated."
else
hg clone $_hgroot $_hgrepo
hg clone "$_hgroot" "$_hgrepo"
fi
msg "Mercurial checkout done or server timeout"
msg "Starting make..."
msg "Starting build..."
rm -rf "$srcdir/$_hgrepo-build"
cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
......@@ -52,7 +52,6 @@ build() {
#
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
make
......@@ -62,3 +61,5 @@ package() {
cd "$srcdir/$_hgrepo-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
......@@ -7,13 +7,16 @@
# information on Perl packaging.
# Maintainer: Your Name <youremail@domain.com>
pkgname=perl-foo-bar
_author=AUTHOR_NAME
_perlmod=MODNAME
pkgname=perl-$_perlmod
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=()
url=""
license=('GPL' 'PerlArtistic')
groups=()
depends=('perl>=5.10.0')
makedepends=()
provides=()
......@@ -26,22 +29,22 @@ source=(http://search.cpan.org/CPAN/authors/id/***/***-$pkgver.tar.gz)
md5sums=()
build() {
cd "$srcdir/***-$pkgver"
cd "$srcdir/$_perlmod-$pkgver"
# install module in vendor directories.
# Install module in vendor directories.
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
make
## for packages with Build.PL, do this instead:
## For packages with Build.PL, do this instead:
# perl Build.PL installdirs=vendor destdir="$pkgdir/"
# perl Build
}
package() {
cd "$srcdir/***-$pkgver"
cd "$srcdir/$_perlmod-$pkgver"
make install DESTDIR="$pkgdir/"
## for packages with Build.PL, do this instead:
## For packages with Build.PL, do this instead:
# perl Build install
}
......
......@@ -7,13 +7,14 @@
# information on Python packaging.
# Maintainer: Your Name <youremail@domain.com>
pkgname=python-<modulename>
pkgname=python-NAME
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=('python')
makedepends=()
provides=()
......@@ -26,8 +27,8 @@ source=()
md5sums=()
package() {
cd "$srcdir/***-$pkgver"
python setup.py install --root=$pkgdir/ --optimize=1
cd "$srcdir/$pkgname-$pkgver"
python setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:
......@@ -21,12 +21,12 @@ noextract=(GEMNAME-$pkgver.gem)
md5sums=()
package() {
cd $srcdir
cd "$srcdir"
# _gemdir is defined inside package() because if ruby[gems] is not installed on the system
# makepkg will exit with an error when sourcing the PKGBUILD
local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"
gem install --ignore-dependencies -i "$pkgdir$_gemdir" GEMNAME-$pkgver.gem
gem install --ignore-dependencies -i "$pkgdir$_gemdir" "GEMNAME-$pkgver.gem"
}
# vim:set ts=2 sw=2 et:
......@@ -28,26 +28,27 @@ noextract=()
md5sums=() #generate with 'makepkg -g'
_svntrunk=SVNURL
_svnmod=MODENAME
_svnmod=MODNAME
build() {
cd "$srcdir"
msg "Connecting to SVN server...."
if [ -d $_svnmod/.svn ]; then
(cd $_svnmod && svn up -r $pkgver)
if [[ -d "$_svnmod/.svn" ]]; then
(cd "$_svnmod" && svn up -r "$pkgver")
else
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
svn co "$_svntrunk" --config-dir ./ -r "$pkgver" "$_svnmod"
fi
msg "SVN checkout done or server timeout"
msg "Starting make..."
msg "Starting build..."
rm -rf "$srcdir/$_svnmod-build"
cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
cd "$srcdir/$_svnmod-build"
#
# BUILD
# BUILD HERE
#
./autogen.sh
./configure --prefix=/usr
......@@ -58,3 +59,5 @@ package() {
cd "$srcdir/$_svnmod-build"
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:
pkgname=NAME
post_install() {
usr/sbin/gconfpkg --install ${pkgname}
usr/sbin/gconfpkg --install "$pkgname"
update-desktop-database -q
}
pre_upgrade() {
pre_remove $1
pre_remove "$1"
}
post_upgrade() {
post_install $1
post_install "$1"
}
pre_remove() {
usr/sbin/gconfpkg --uninstall ${pkgname}
usr/sbin/gconfpkg --uninstall "$pkgname"
}
post_remove() {
update-desktop-database -q
}
# vim:set ts=2 sw=2 et:
pkgname=NAME
HS_DIR=usr/share/haskell/$pkgname
HS_DIR="usr/share/haskell/$pkgname"
post_install() {
${HS_DIR}/register.sh
"$HS_DIR/register.sh"
}
pre_upgrade() {
${HS_DIR}/unregister.sh
"$HS_DIR/unregister.sh"
}
post_upgrade() {
${HS_DIR}/register.sh
"$HS_DIR/register.sh"
}
pre_remove() {
${HS_DIR}/unregister.sh
"$HS_DIR/unregister.sh"
}
# vim:set ts=2 sw=2 et:
......@@ -2,20 +2,20 @@ infodir=usr/share/info
filelist=(foo.info bar)
post_install() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
[[ -x usr/bin/install-info ]] || return 0
for file in "${filelist[@]}"; do
install-info "$infodir/$file.gz" "$infodir/dir" 2> /dev/null
done
}
post_upgrade() {
post_install $1
post_install "$1"
}
pre_remove() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
[[ -x usr/bin/install-info ]] || return 0
for file in "${filelist[@]}"; do
install-info --delete "$infodir/$file.gz" "$infodir/dir" 2> /dev/null
done
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment