summaryrefslogtreecommitdiffstats
path: root/setup
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-01-14 22:32:09 +0100
committerJustin Davis <jrcd83@gmail.com>2012-01-14 22:32:09 +0100
commitdb69999c8cc9c5d8943603311dd64c0096af049f (patch)
treed01194ae2e8ce0cfc93ac2f5ad60f6fb1a817dbe /setup
parentf4e6d12be63deea86cf0c064362850182f3f1d71 (diff)
downloadgenpkg-db69999c8cc9c5d8943603311dd64c0096af049f.tar.gz
genpkg-db69999c8cc9c5d8943603311dd64c0096af049f.tar.xz
Use a script instead of Makefile to install.
Diffstat (limited to 'setup')
-rwxr-xr-xsetup71
1 files changed, 71 insertions, 0 deletions
diff --git a/setup b/setup
new file mode 100755
index 0000000..2cb9735
--- /dev/null
+++ b/setup
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+set -e
+umask 022
+prog=install
+binfiles=(makepkgbuild makepkgmeta genpkg tweakmeta)
+metas=(perl perl.d/ perl.d/fetchcpan perl.d/perl-dist perl.d/scrapecore)
+templs=(pbfields perl-pkg)
+
+md()
+{
+ d="$1"
+ case "$d" in
+ '') return 1 ;;
+ */) ;;
+ *) d="$d/" # mostly for pretty printing
+ esac
+ [ -d "$d" ] || mkdir -p "$d"
+ echo "$d"
+}
+
+ins()
+{
+ case "$1" in
+ */) md "$2/$1" ;;
+ *) install -m 755 "$1" "$2/$1"
+ echo "$2/$1"
+ esac
+}
+
+case "$1" in
+'') cat <<EOF
+Run "$prog genpkg" to install genpkg & friends into ~/genpkg and ~/bin.
+Run "$prog tweaks" to install tweaks into ~/pkg/tweaks.
+EOF
+ ;;
+genpkg) md ~/bin
+ for pkg in ${binfiles[@]}
+ do
+ ins "bin/$pkg" ~
+ done
+
+ md ~/.genpkg
+ md ~/.genpkg/lib
+ md ~/.genpkg/lib/metas
+ for m in ${metas[@]}
+ do
+ ins "lib/metas/$m" ~/.genpkg
+ done
+
+ md ~/.genpkg/lib/templ/
+ for t in ${templs[@]}
+ do
+ ins "lib/templ/$t" ~/.genpkg
+ done
+
+ md ~/.genpkg/var
+ ;;
+tweaks) md ~/pkg/tweaks/
+ for t in tweaks/*
+ do
+ echo "$t" | grep -q '~$' && continue
+ echo ~/pkg/"$t"
+ cp "$t" ~/pkg/"$t"
+ done
+ ;;
+*) echo "$prog: unrecognized argument: $1"
+ exit 1
+esac
+
+exit 0