summaryrefslogtreecommitdiffstats
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
parentf4e6d12be63deea86cf0c064362850182f3f1d71 (diff)
downloadgenpkg-db69999c8cc9c5d8943603311dd64c0096af049f.tar.gz
genpkg-db69999c8cc9c5d8943603311dd64c0096af049f.tar.xz
Use a script instead of Makefile to install.
-rw-r--r--Makefile15
-rwxr-xr-xsetup71
2 files changed, 71 insertions, 15 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 04de5e9..0000000
--- a/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-usage:
- @echo 'Run "make install" to install into your home directory.'
- @echo 'Run "make install_tweaks" to install tweak files, too.'
-
-install:
- mkdir -p $$HOME/bin
- install -m 755 bin/makepkgbuild bin/makepkgmeta bin/genpkg \
- bin/tweakmeta $$HOME/bin
- mkdir -p $$HOME/lib/genpkg/
- cp -R lib/* $$HOME/lib/genpkg/
- mkdir -p $$HOME/pkg/dest
-
-install_tweaks:
- -mkdir $$HOME/pkg
- cp -R tweaks $$HOME/pkg/
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