summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@risingtidesystems.com>2011-05-04 21:14:18 +0000
committerNicholas Bellinger <nab@risingtidesystems.com>2011-05-04 21:14:18 +0000
commitdb0c7fd76abc5fcc929b039f2d49f1a38f947968 (patch)
treee2d8b8535610d8e6d2c9d1b305230be376d15887 /bin
downloadtargetcli-db0c7fd76abc5fcc929b039f2d49f1a38f947968.tar.gz
initial rtsadmin commit1.99
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/clean30
-rwxr-xr-xbin/gen_changelog45
-rwxr-xr-xbin/gen_changelog_cleanup20
-rwxr-xr-xbin/gendoc101
-rwxr-xr-xbin/gendoc.py80
5 files changed, 276 insertions, 0 deletions
diff --git a/bin/clean b/bin/clean
new file mode 100755
index 0000000..371d0f3
--- /dev/null
+++ b/bin/clean
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# This file is part of RTSAdmin Community Edition.
+# Copyright (c) 2011 by RisingTide Systems LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, version 3 (AGPLv3).
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+rm -v rtsadmin/*.pyc rtsadmin/*.html 2>/dev/null
+rm -rvf doc 2>/dev/null
+rm -rfv rtsadmin.egg-info MANIFEST build dist 2>/dev/null
+rm -rvf pdf html 2>/dev/null
+rm -rvf debian/tmp 2>/dev/null
+rm -v build-stamp 2>/dev/null
+rm -v dpkg-buildpackage.log dpkg-buildpackage.version 2>/dev/null
+rm -rfv *.rpm warnrtsadmin.txt buildrtsadmin 2>/dev/null
+rm -v debian/*.debhelper.log debian/*.debhelper debian/*.substvars debian/files 2>/dev/null
+rm -vrf debian/rtsadmin-frozen/ debian/rtsadmin-python2.5/ debian/rtsadmin-python2.6/ debian/rtsadmin/ debian/rtsadmin-doc/ 2>/dev/null
+
+echo "Finished cleanup."
+
diff --git a/bin/gen_changelog b/bin/gen_changelog
new file mode 100755
index 0000000..8a25923
--- /dev/null
+++ b/bin/gen_changelog
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# This file is part of RTSAdmin Community Edition.
+# Copyright (c) 2011 by RisingTide Systems LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, version 3 (AGPLv3).
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+NAME=$(git config --get user.name)
+EMAIL=$(git config --get user.email)
+DATE=$(date +'%a, %d %b %Y %H:%M:%S %z')
+
+SRCPKG=$(cat debian/control | grep ^Source | awk '{print $2}')
+
+LAST_TAG=$(git tag | tail -1)
+if [ -z $LAST_TAG ]; then
+ LAST_TAG='0.0'
+fi
+
+COMMIT=$(git log ${LAST_TAG}..HEAD | head -1 | colrm 1 7 | colrm 8)
+TS=$(date +%Y%m%d%H%M%S)
+
+if [ -z $COMMIT ]; then
+ VERSION="${LAST_TAG}"
+else
+ VERSION="${LAST_TAG}-${TS}.${COMMIT}"
+fi
+
+sed -i "s/__version__ = .*/__version__ = '${VERSION}'/g" ${SRCPKG}/__init__.py
+
+echo "${SRCPKG} (${VERSION}) unstable; urgency=low" > debian/changelog
+echo >> debian/changelog
+echo " * Generated package." >> debian/changelog
+echo >> debian/changelog
+echo " -- ${NAME} <${EMAIL}> ${DATE}" >> debian/changelog
+
diff --git a/bin/gen_changelog_cleanup b/bin/gen_changelog_cleanup
new file mode 100755
index 0000000..3d11deb
--- /dev/null
+++ b/bin/gen_changelog_cleanup
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# This file is part of RTSAdmin Community Edition.
+# Copyright (c) 2011 by RisingTide Systems LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, version 3 (AGPLv3).
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+SRCPKG=$(cat debian/control | grep ^Source | awk '{print $2}')
+rm -f debian/changelog
+sed -i "s/__version__ = .*/__version__ = 'GIT_VERSION'/g" ${SRCPKG}/__init__.py
diff --git a/bin/gendoc b/bin/gendoc
new file mode 100755
index 0000000..6b50f9c
--- /dev/null
+++ b/bin/gendoc
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+# This file is part of RTSAdmin Community Edition.
+# Copyright (c) 2011 by RisingTide Systems LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, version 3 (AGPLv3).
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+path=$PWD
+
+rm -rf doc &>/dev/null
+mkdir doc
+cp README COPYING doc/
+cp rtsadmin-doc/rtslogo.* doc/
+
+CSS=../rtsadmin-doc/html4css1.css
+#CSS=../rtsadmin-doc/voidspace.css
+RSTTITLE="rtsadmin_reference"
+TITLE=$RSTTITLE
+#MARK="% generated by Docutils"
+MARK="\documentclass.*"
+./bin/gendoc.py > doc/$TITLE.rst
+
+cd doc
+rst2html $TITLE.rst --stylesheet-path $CSS --embed-stylesheet --no-xml-declaration $TITLE.html
+cat $TITLE.rst | grep -v ".. sectnum::" | grep -v "header::" > $TITLE.rst2
+mv $TITLE.rst2 $TITLE.rst
+
+rst2latex $RSTTITLE.rst --toc-entry-backlinks --compound-enumerators --use-verbatim-when-possible --use-latex-toc --section-numbering --documentclass article --documentoptions "10pt,a4paper" --use-latex-toc --use-latex-docinfo --hyperlink-color black $TITLE.tex
+
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{fancyhdr}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{lastpage}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{color}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{titlesec}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\pagestyle{fancy}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\definecolor{rtsblue}{RGB}{79,130,189}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\rhead{\\\includegraphics[height=13pt]{rtslogo.eps}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\chead{}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\lhead{\\\leftmark}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\cfoot{}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\lfoot{Copyright \\\copyright2009-2010 by RisingTide Systems LLC}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\rfoot{Page \\\thepage\\\ of\\\ \\\pageref{LastPage}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrulewidth}{0.4pt}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrulewidth}{0.4pt}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\chapter}\[display\]{\\\color{rtsblue}\\\normalfont\\\huge\\\bfseries}{\\\chaptertitlename\\\thechapter}{20pt}{\\\Huge}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\section}{\\\color{rtsblue}\\\normalfont\\\Large\\\bfseries}{\\\thesection}{1em}{}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\subsection}{\\\color{rtsblue}\\\normalfont\\\large\\\bfseries}{\\\thesubsection}{1em}{}/g" $TITLE.tex
+
+# once for generating the formatting
+latex $TITLE.tex $TITLE.dvi
+# once more for the TOC
+latex $TITLE.tex $TITLE.dvi
+# And now get the labels right
+latex $TITLE.tex $TITLE.dvi
+dvipdf $TITLE.dvi $TITLE.pdf
+
+TITLE="rtsadmin_reference_for_print"
+
+rst2latex $RSTTITLE.rst --toc-entry-backlinks --compound-enumerators --use-verbatim-when-possible --use-latex-toc --section-numbering --documentclass book --documentoptions "10pt,a4paper" --use-latex-toc --use-latex-docinfo --hyperlink-color black $TITLE.tex
+
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{fancyhdr}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{lastpage}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{color}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{titlesec}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\definecolor{rtsblue}{RGB}{79,130,189}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\pagestyle{fancy}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\rhead{\\\includegraphics[height=13pt]{rtslogo.eps}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\chead{}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\lhead{\\\leftmark}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\cfoot{}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\lfoot{Copyright \\\copyright2009-2010 by RisingTide Systems LLC}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\rfoot{Page \\\thepage\\\ of\\\ \\\pageref{LastPage}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrulewidth}{0.4pt}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrulewidth}{0.4pt}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\chapter}\[display\]{\\\color{rtsblue}\\\normalfont\\\huge\\\bfseries}{\\\chaptertitlename\\\thechapter}{20pt}{\\\Huge}/g" $TITLE.tex
+perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\section}{\\\color{rtsblue}\\\normalfont\\\Large\\\bfseries}{\\\thesection}{1em}{}/g" $TITLE.tex
+
+# once for generating the formatting
+latex $TITLE.tex $TITLE.dvi
+# once more for the TOC
+latex $TITLE.tex $TITLE.dvi
+# And now get the labels right
+latex $TITLE.tex $TITLE.dvi
+dvipdf $TITLE.dvi $TITLE.pdf
+
+
+cd ..
+
diff --git a/bin/gendoc.py b/bin/gendoc.py
new file mode 100755
index 0000000..680555a
--- /dev/null
+++ b/bin/gendoc.py
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+# This file is part of RTSAdmin Community Edition.
+# Copyright (c) 2011 by RisingTide Systems LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, version 3 (AGPLv3).
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import re
+import sys
+import inspect
+import textwrap
+import datetime
+sys.path.insert(0, os.path.realpath("."))
+import rtsadmin
+
+def doctitle(txt):
+ return "%s\n%s\n%s\n\n" \
+ % ("".ljust(len(txt), "="), txt, "".ljust(len(txt), "="))
+
+def docsubtitle(txt):
+ return "%s\n%s\n%s\n\n" \
+ % ("".ljust(len(txt), "-"), txt, "".ljust(len(txt), "-"))
+
+def title(txt):
+ return "%s\n%s\n\n" % (txt, "".ljust(len(txt), "="))
+
+def subtitle(txt):
+ return "%s\n%s\n\n" % (txt, "".ljust(len(txt), "-"))
+
+def gen_context_reference():
+ string = ""
+ string += "Documentation extract not implemented yet"
+ return string
+
+def gen_help_misc():
+ string = ""
+ string += "Documentation extract not implemented yet"
+ return string
+
+def gen_help_cmd():
+ string = title("Globally Available Commands")
+ string += "Documentation extract not implemented yet"
+ return string
+
+def gen_title():
+ string = ""
+ string += doctitle("The rtsadmin Reference Guide")
+ string += docsubtitle(rtsadmin.__description__)
+ string += ":Date: version %s built on %s\n" \
+ % (str(rtsadmin.__version__),
+ str(datetime.datetime.now().date()))
+ license_fields = rtsadmin.__license__.split(".")
+ string += ":Author: %s. %s.\n" % (license_fields[0], license_fields[1])
+ string += "\n"
+ return string
+
+def gen_toc():
+ return ".. contents:: **Table of Contents**\n\n"
+
+def gen_options():
+ return ".. sectnum::\n\n.. header:: .. image:: rtslogo.png\n\n"
+
+if __name__ == "__main__":
+ print gen_title()
+ print gen_options()
+ print gen_toc()
+ print gen_help_misc()
+ print gen_help_cmd()
+ print gen_context_reference()