Commit cfbad63a authored by Melissa Draper's avatar Melissa Draper

Initial commit

maharadocs (1.5-1) unstable; urgency=low
* Initial release
-- Melissa Draper <> Thu, 03 May 2012 00:52:22 +1200
Source: maharadocs
Section: unknown
Priority: extra
Maintainer: Melissa Draper <>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
#Vcs-Git: git://
Package: maharadocs
Architecture: any
Pre-depends: debconf (>= 0.2.17)
Depends: ${misc:Depends}, apache2, gettext, git-core, bzr, make, ttf-wqy-microhei, ttf-freefont, mendexk, texlive-latex-extra, texlive-fonts-recommended, texlive-latex-recommended, texlive-xetex, ttf-indic-fonts-core, texlive-lang-all, python-pybabel
Description: localised automated sphinx docs for Mahara
This package installs the automated localised sphinx docs for Mahara to the webroot
Upstream-Name: maharadocs
Source: <url://>
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
<Including paragraphs>
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2012 Melissa Draper <>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <>
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
set -e
. /usr/share/debconf/confmodule
db_input high maharadocs/installdir || true
db_input high maharadocs/giturl || true
db_input high maharadocs/overwrite || true
set -e
. /usr/share/debconf/confmodule
PACKAGE=`basename $0 .postinst`
db_get maharadocs/installdir
cd /var/www/$RET
git pull
make -C /var/www/$RET update html epub latexpdf MAHARA=1.4
make -C /var/www/$RET update html epub latexpdf MAHARA=1.5
make -C /var/www/$RET update html epub latexpdf MAHARA=1.6
set -e
. /usr/share/debconf/confmodule
PACKAGE=`basename $0 .postinst`
bold=`tput bold`
normal=`tput sgr0`
# Get the user input
case "$1" in
db_get maharadocs/installdir
db_get maharadocs/giturl
db_get maharadocs/overwrite
echo "postinst called with unknown argument \`$1'" >&2
exit 1
# Check if we seem to have the correct git contents, not very trustworthy
# but better than no check :D
if [ -d /var/www/$DIRNAME ]
if grep -Fxq /var/www/$DIRNAME/.git/config $GITURL
# If we have what appears to be the correct git contents,
# just quit the script cleanly and let the rest of the
# packaging do its thing.
echo "Data already exists pulling from the correct source."
echo "Not doing any alteration of /var/www/$DIRNAME."
# However if it looks wrong, check if its a-ok to overwrite
if [ $OVERWRITEDIR eq 'ok' ]
# Buhbye!
rm -rf /var/www/$DIRNAME
# Throw an error stating that we don't feel right about
# nuking the data we can see.
echo "${bold}The directory '/var/www/$DIRNAME' already exists."
echo "We were not told to overwrite, so we will not."
echo "Exiting now. Retry with the overwrite option.${normal}"
exit -1
# Make our lovely new install from the git address.
# Despite all our checking, this can fail horribly after a long wait;
# there's not really much we can do about that now.
cd /var/www/
echo "Downloading the manual into /var/www/$DIRNAME from"
echo "$GITURL"
echo "This may take a while..."
git clone $GITURL $DIRNAME
# Did we succeed?
if [ -d /var/www/$DIRNAME ]
# Yay!
echo "Manual successfully downloaded into '/var/www/$DIRNAME'."
# In theory, we should not be here. Throw an error if we did, guessing what might
# have happened. Git _should_ have reported all failures to download, but if the
# directory is missing, then _something_ went wrong.
echo "${bold}The installation failed; the manual directory could not be found.${normal}"
echo "Please check that:"
echo "* The directory is indeed missing. If not, it is a packaging error."
echo "* $GITURL is accessible and downloadable on your network. Find a friendly sysadmin."
echo "If this appears to be a packaging error, report it to with all"
echo "the text output since you tried to install this. "
exit -1
Template: maharadocs/installdir
Type: string
Default: maharadocs
Description: Installation directory:
What directory should the mahara documentation be
put in? This directory should not exist when installing
for the first time.
Template: maharadocs/giturl
Type: string
Description: Git URL:
This is the URL where we will clone the git contents from.
Template: maharadocs/overwrite
Type: select
Default: no
Choices: ok, no
Description: Overwrite the specified directory if it exists?:
If this directory exists, may we overwrite it DESTROYING all data inside it.
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
dh $@
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