Commit 07791e57 authored by Vinicius Ruoso's avatar Vinicius Ruoso

autogen.sh: added support to standalone states and summaries

The generated Makefile by autogen.sh can now install standalone states and
summaries. This will allow sdi-plugins-prd to install states that doesn't
have a script associated, and install summaries too.

The summaries config file will be the autogen_summaries.conf.

To corectly use this feature, the user must have the "states" dir to install
standalone states, and the "summaries" dir to install standalone summaries.
Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
parent 3a1e73d2
......@@ -23,6 +23,8 @@ makeprint "install:"
for SCRIPT in $SCRIPTS; do
makeprint " $SCRIPT-install"
done
test -d "states" && makeprint " states-standalone-install"
test -d "summaries" && makeprint " summaries-standalone-install"
makeprint "\n"
makeprint "\t@echo \"All done.\"\n\n"
......@@ -31,6 +33,8 @@ makeprint "uninstall:"
for SCRIPT in $SCRIPTS; do
makeprint " $SCRIPT-uninstall"
done
test -d "states" && makeprint " states-standalone-uninstall"
test -d "summaries" && makeprint " summaries-standalone-uninstall"
makeprint "\n"
makeprint "\t@echo \"All uninstalled.\"\n\n"
......@@ -39,6 +43,8 @@ makeprint "purge: uninstall"
for SCRIPT in $SCRIPTS; do
makeprint " $SCRIPT-purge"
done
test -d "states" && makeprint " states-standalone-purge"
test -d "summaries" && makeprint " summaries-standalone-purge"
makeprint "\n"
makeprint "\t@echo \"All purged.\"\n\n"
......@@ -105,3 +111,74 @@ while read LINE; do
fi
done < autogen.conf
if test -d "states"; then
# the copy directive
makeprint "states-standalone: checkprefix\n"
makeprint "\t@cp states/* \$(PREFIX)/states-available\n\n"
# the install directive
makeprint "states-standalone-install: checkprefix-install"
makeprint " states-standalone\n"
STATES=$(ls states)
for STATE in $STATES; do
makeprint "\t@ln -fs \$(PREFIX)/states-available/$STATE \\\\\n"
makeprint "\t\t\t\$(PREFIX)/states-enabled/$STATE\n"
done
makeprint "\n"
# the unisntall directive
makeprint "states-standalone-uninstall: checkprefix-install\n"
for STATE in $STATES; do
makeprint "\t@rm -f \$(PREFIX)/states-enabled/$STATE\n"
done
makeprint "\n"
# the purge directive
makeprint "states-standalone-purge: states-standalone-uninstall"
makeprint " checkprefix-install\n"
for STATE in $STATES; do
makeprint "\t@rm -f \$(PREFIX)/states-available/$STATE\n"
done
makeprint "\n"
fi
if test -d "summaries"; then
while read LINE; do
grep -q "#" <<< $LINE && continue
SUMMARIES="$SUMMARIES $LINE"
done < autogen_summaries.conf
# the copy directive
makeprint "summaries-standalone: checkprefix\n"
makeprint "\t@cp summaries/* \$(PREFIX)/summaries-available\n\n"
# the install directive
makeprint "summaries-standalone-install: checkprefix-install"
makeprint " summaries-standalone\n"
for SUMMARY in $SUMMARIES; do
SUMMARYLINK=$(cut -d: -f2 <<< $SUMMARY)
SUMMARY=$(cut -d: -f1 <<< $SUMMARY)
makeprint "\t@ln -fs \$(PREFIX)/summaries-available/$SUMMARY \\\\\n"
makeprint "\t\t\t\$(PREFIX)/summaries-enabled/$SUMMARYLINK\n"
done
makeprint "\n"
# the unisntall directive
makeprint "summaries-standalone-uninstall: checkprefix-install\n"
for SUMMARY in $SUMMARIES; do
SUMMARYLINK=$(cut -d: -f2 <<< $SUMMARY)
makeprint "\t@rm -f \$(PREFIX)/summaries-enabled/$SUMMARYLINK\n"
done
makeprint "\n"
# the purge directive
makeprint "summaries-standalone-purge: summaries-standalone-uninstall"
makeprint " checkprefix-install\n"
for SUMMARY in $SUMMARIES; do
SUMMARY=$(cut -d: -f1 <<< $SUMMARY)
makeprint "\t@rm -f \$(PREFIX)/summaries-available/$SUMMARY\n"
done
makeprint "\n"
fi
Markdown is supported
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