summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6246us-u910.(none)>2010-03-28 22:28:19 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:19 -0600
commitc4ebb4d76b91c8e5e475c5b131306176fe909468 (patch)
tree36952c4abd05fb0dd8e5af06b9bd57fb0044f133
parente439bab381b77d19dfa5b908c4a9c24ecb59d1f2 (diff)
and installation works, now to work on uninstallation...
-rw-r--r--rvs/config5
-rw-r--r--rvs/main.mk.in13
-rw-r--r--rvs/plugins/main.mk.in10
-rw-r--r--rvs/plugins/plugin.mk.in30
-rw-r--r--rvs/wrapper/main.mk.in13
-rw-r--r--rvs/wrapper/rvs.sh9
6 files changed, 45 insertions, 35 deletions
diff --git a/rvs/config b/rvs/config
index 140c270..75aa6c5 100644
--- a/rvs/config
+++ b/rvs/config
@@ -1,9 +1,10 @@
_name='rvs'
+ _rvs='rvs'
_RVS='$(bindir)/$(rvs)'
- _sysconfdir='$(prefix)/etc/$(name)'
+ _sysconfdir='$(prefix)/etc/$(rvs)'
_BINDIR='$(sysconfdir)/bin'
_TMPDIR='$(sysconfdir)/tmp'
_LIBDIR='$(sysconfdir)/lib'
_ETCDIR='$(sysconfdir)/etc'
-vars="$vars name RVS sysconfdir BINDIR TMPDIR LIBDIR ETCDIR"
+vars="$vars name rvs RVS sysconfdir BINDIR TMPDIR LIBDIR ETCDIR"
diff --git a/rvs/main.mk.in b/rvs/main.mk.in
index 33be1e9..b698651 100644
--- a/rvs/main.mk.in
+++ b/rvs/main.mk.in
@@ -17,13 +17,16 @@ ver = 0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-sysconfdir ?= @sysconfdir@
-BINDIR ?= @BINDIR@
-TMPDIR ?= @TMPDIR@
-LIBDIR ?= @LIBDIR@
-ETCDIR ?= @ETCDIR@
+sysconfdir = @sysconfdir@
+BINDIR = @BINDIR@
+TMPDIR = @TMPDIR@
+LIBDIR = @LIBDIR@
+ETCDIR = @ETCDIR@
dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
+rvs = @rvs@
+RVS = @RVS@
+
# phony targets ######################################################
.PHONY: all
all : wrapper plugins
diff --git a/rvs/plugins/main.mk.in b/rvs/plugins/main.mk.in
index 3039c1f..01ec205 100644
--- a/rvs/plugins/main.mk.in
+++ b/rvs/plugins/main.mk.in
@@ -17,11 +17,11 @@
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-sysconfdir ?= @sysconfdir@
-BINDIR ?= @BINDIR@
-TMPDIR ?= @TMPDIR@
-LIBDIR ?= @LIBDIR@
-ETCDIR ?= @ETCDIR@
+sysconfdir = @sysconfdir@
+BINDIR = @BINDIR@
+TMPDIR = @TMPDIR@
+LIBDIR = @LIBDIR@
+ETCDIR = @ETCDIR@
dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
mods = $(patsubst ./%,%,$(shell find ./* -maxdepth 0 -type d))
diff --git a/rvs/plugins/plugin.mk.in b/rvs/plugins/plugin.mk.in
index 59b6b2d..1f1995c 100644
--- a/rvs/plugins/plugin.mk.in
+++ b/rvs/plugins/plugin.mk.in
@@ -18,14 +18,16 @@ include info.mk # this contains the actuall name/version for the plugin
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-sysconfdir ?= @sysconfdir@
-BINDIR ?= @BINDIR@
-TMPDIR ?= @TMPDIR@
-LIBDIR ?= @LIBDIR@
-ETCDIR ?= @ETCDIR@
+sysconfdir = @sysconfdir@
+BINDIR = @BINDIR@
+TMPDIR = @TMPDIR@
+LIBDIR = @LIBDIR@
+ETCDIR = @ETCDIR@
dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
-rvs = @name@
+rvs = @rvs@
+RVS = @RVS@
+
id = $(name)-$(ver)
# phony targets ####################################################
@@ -40,9 +42,9 @@ shSrcFiles = $(filter %.sh,$(srcFiles))
shOutFiles = $(patsubst $(srcdir)/%,%,$(basename $(shSrcFiles)))
outFiles = $(shOutFiles)
-outBin = $(addprefix bin-,$(notdir $(filter bin/%,$(outFiles))))
-outEtc = $(addprefix $(ETCDIR)/$(name),$(notdir $(filter etc/%,$(outFiles))))
-outLib = $(addprefix $(LIBDIR)/$(name),$(notdir $(filter lib/%,$(outFiles))))
+outBin = $(addprefix bin-,$(notdir $(filter bin/%,$(outFiles))))
+outEtc = $(addprefix $(ETCDIR)/$(name)/,$(notdir $(filter etc/%,$(outFiles))))
+outLib = $(addprefix $(LIBDIR)/$(name)/,$(notdir $(filter lib/%,$(outFiles))))
$(name) : $(myoutdir) $(shOutFiles)
@@ -56,11 +58,13 @@ unbin-% : bin/%
bin-% : bin/%
$(RVS) install $< $(notdir $<) $(name) $(priority)
-$(ECTDIR)/$(name)/% : etc/%
- $(CP) $< $@
+$(outEtc) : $(ETCDIR)/$(name)/% : etc/%
+ $(MKDIR) $(dir $@)
+ $(INSTALL_PROGRAM) $< $@
-$(LIBDIR)/$(name)/% : lib/%
- $(CP) $< $@
+$(outLib) : $(LIBDIR)/$(name)/% : lib/%
+ $(MKDIR) $(dir $@)
+ $(INSTALL_DATA) $< $@
uninstall :
$(RVS) uninstall $(name)
diff --git a/rvs/wrapper/main.mk.in b/rvs/wrapper/main.mk.in
index 4de7eb8..0ba00d7 100644
--- a/rvs/wrapper/main.mk.in
+++ b/rvs/wrapper/main.mk.in
@@ -17,13 +17,16 @@ ver = 0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-sysconfdir ?= @sysconfdir@
-BINDIR ?= @BINDIR@
-TMPDIR ?= @TMPDIR@
-LIBDIR ?= @LIBDIR@
-ETCDIR ?= @ETCDIR@
+sysconfdir = @sysconfdir@
+BINDIR = @BINDIR@
+TMPDIR = @TMPDIR@
+LIBDIR = @LIBDIR@
+ETCDIR = @ETCDIR@
dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
+rvs = @rvs@
+RVS = @RVS@
+
# phony targets ####################################################
.PHONY : all
all : Makefiles rvs
diff --git a/rvs/wrapper/rvs.sh b/rvs/wrapper/rvs.sh
index 85586ea..d8b1b40 100644
--- a/rvs/wrapper/rvs.sh
+++ b/rvs/wrapper/rvs.sh
@@ -67,7 +67,7 @@ _runcom() {
else
if [ -f "$BINDIR/$command" ]; then
exec "$BINDIR/$command" $@ | tee "$TMPDIR/$command"
- elif [ -d "$BINDIR/$command" ]
+ elif [ -d "$BINDIR/$command" ]; then
for file in "$BINDIR/$command"/*; do
id=$(echo $file | sed 's/^[0-9]*-//')
exec "$file" $@ | tee "TMPDIR/$command/$id"
@@ -105,16 +105,15 @@ _init() {
################################################################################
_install() {
- file= ${1?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
- command= ${2?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
- id= ${3?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
+ file=${1?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
+ command=${2?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
+ id=${3?"usage: $RVS install FILE COMMAND ID [PRIORITY]"}
priority=${4-"`_nextpriority "$command"`"}
install -d "$BINDIR/$command"
install "$file" "$BINDIR/$command/$priority-$id"
}
-
_uninstall() {
command=${1?"usage: $RVS uninstall COMMAND [ID]"}
id=$2