summaryrefslogtreecommitdiff
path: root/~lukeshu/parabolaweb-git/parabolaweb.install
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-12-04 15:31:43 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-12-04 15:31:43 -0500
commit4d46859230b7c42ca37c8b0975c7504b85930cf0 (patch)
tree8ab834d2ba4aa772b7b6eacf7c2544161144f475 /~lukeshu/parabolaweb-git/parabolaweb.install
parente75f7bfbce80e1b1900a6ed434fa0dec788f03d9 (diff)
downloadabslibre-4d46859230b7c42ca37c8b0975c7504b85930cf0.tar.gz
abslibre-4d46859230b7c42ca37c8b0975c7504b85930cf0.tar.bz2
abslibre-4d46859230b7c42ca37c8b0975c7504b85930cf0.zip
Create a PKGBUILD to take care of maintaining parabolaweb.
Diffstat (limited to '~lukeshu/parabolaweb-git/parabolaweb.install')
-rw-r--r--~lukeshu/parabolaweb-git/parabolaweb.install59
1 files changed, 59 insertions, 0 deletions
diff --git a/~lukeshu/parabolaweb-git/parabolaweb.install b/~lukeshu/parabolaweb-git/parabolaweb.install
new file mode 100644
index 000000000..1cff0417f
--- /dev/null
+++ b/~lukeshu/parabolaweb-git/parabolaweb.install
@@ -0,0 +1,59 @@
+# These will make it install into /http/srv/web
+_install_dir='/srv/http'
+_gitname='web'
+
+_gitroot='https://projects.parabolagnulinux.org/parabolaweb.git'
+_gitbranch='master'
+
+msg() {
+ echo $@
+}
+
+_main() {
+ set -e
+ if [ ! -d "$_install_dir" ]; then
+ mkdir "$_install_dir"
+ fi
+ cd "$_install_dir"
+
+ msg "Connecting to GIT server...."
+
+ if [ -d ${_gitname} ] ; then
+ cd ${_gitname}
+ git pull ${_gitroot}
+ msg "The local files are updated."
+ else
+ git clone ${_gitroot} ${_gitname}
+ cd ${_gitname}
+ fi
+ git checkout ${_gitbranch}
+
+ msg "GIT checkout done or server timeout"
+
+ msg "Checking configuration...."
+
+ if [ ! -f local_settings.py ]; then
+ cp local_settings.py.example local_settings.py.tmp
+ $EDITOR local_settings.py.tmp || return 0
+ mv local_settings.py.tmp local_settings.py
+ msg "Creating database...."
+ ./manage.py syncdb
+ fi
+
+ find . -name '*.pyc' -delete
+ ./manage.py migrate
+ ./manage.py loaddata */fixtures/*.json
+}
+
+# arg 1: the new package version
+post_install() {
+ _main
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ _main
+}
+
+# vim:set ts=2 sw=2 et: