Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 66 lines (53 sloc) 1.56 KB
#!/usr/bin/env bash
# Exit on errors
set -e
# Set sane umask
umask 022
# Set language (this helps sometimes)
export LANG=C
# Set a basic PATH
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Initial variables
PNAME=halrv # Package name
PVERSION=4_beta # Package version
ARCH=${ARCH:-noarch} # Package architecture
BUILD=${BUILD:-1rg} # Build number plus packager initials
CWD=$( pwd )
PKG=$TMP/package-$PNAME # Location to create package structure
# Clear sandbox directory
rm -rf $PKG
mkdir -p $PKG
# Copy files to sandbox
git archive --format=tar --prefix=$PNAME/ HEAD | ( cd $TMP && tar xf - )
python install --root "$PKG"
mkdir -p $PKG/usr/doc/$PNAME-$PVERSION
install -m 644 README $PKG/usr/doc/$PNAME-$PVERSION
install -m 644 COPYING $PKG/usr/doc/$PNAME-$PVERSION
install -m 644 FAQ $PKG/usr/doc/$PNAME-$PVERSION
install -m 644 INSTALL $PKG/usr/doc/$PNAME-$PVERSION
# gzip manpage
gzip -9 $PKG/usr/man/man1/halrv.1
# Add package description
mkdir -p $PKG/install
cat >$PKG/install/slack-desc <<EOF
$PNAME: $PNAME (Removable volumes manager)
$PNAME: $PNAME is a command line removable volumes manager. It lets the user
$PNAME: list removable volumes present in the system, mount them and
$PNAME: unmount/eject them using HAL.
# Create package
cd $PKG
makepkg -l y -c n $CWD/$PNAME-$PVERSION-$ARCH-$BUILD.tgz
# Clean up the sandbox directory
rm -rf $PKG
rm -rf $TMP/$PNAME