debian: first release

This commit is contained in:
Jérôme Schneider 2013-10-23 14:49:52 +02:00
parent b7ed4c754a
commit 330fb9d86f
6 changed files with 98 additions and 20 deletions

View File

@ -4,6 +4,7 @@ Section: python
Priority: optional
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7.4.3)
Standards-Version: 3.9.1
X-Python-Version: current
Package: mandaye-cam
Architecture: all

1
files
View File

@ -1 +0,0 @@
python-mandaye-cam_0.1.0.g9ebbd69-1_all.deb python optional

3
init.d Normal file → Executable file
View File

@ -12,8 +12,7 @@
# Author: Jérôme Schneider <jschneider@entrouvert.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=compte-meyzieu
NAME=compte-meyzieu
NAME=mandaye-cam
DAEMON=/usr/bin/gunicorn
PIDFILE=/var/run/mandaye-cam/$NAME.pid
LOG_DIR=/var/log/mandaye-cam

View File

@ -1,22 +1,6 @@
import os
import logging
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
db_url = 'sqlite:///' + os.path.join(_PROJECT_PATH, 'data/test.db')
debug = False
log_file = os.path.join('/var/log/mandaye-cam/mandaye.log')
log_level = logging.INFO
# Encrypt service provider passwords with a secret
# You should install pycypto to use this feature
encrypt_sp_password = True
# Must be a 16, 24, or 32 bytes long
encrypt_secret = 'CHANGE_ME'
static_root = os.path.join(_PROJECT_PATH, 'cam/static')
## Virtual hosts configuration
hosts = {
'archimed.montpellier.entrouvert.org': [
{'path': r'/',
@ -28,3 +12,39 @@ hosts = {
}
],
}
## Database configuration
db_url = 'sqlite:///var/lib/mandaye-cam/cam.db'
## Logging configuration
debug = False
log_file = '/var/log/mandaye-cam/mandaye.log'
log_level = logging.INFO
## PATH
# Data directory
data_dir = '/var/lib/mandaye-cam/data'
## Email notification configuration
email_notification = True
smtp_host = 'localhost'
smtp_port = 25
email_from = 'traceback+mandaye-cam@entrouvert.com'
email_to = ['admin+mandaye-cam@entrouvert.com']
## Session configuration
# http://beaker.readthedocs.org/en/latest/configuration.html#options-for-sessions-and-caching
session_opts = {
'session.type': 'file',
'session.cookie_expires': True,
'session.timeout': 3600,
'session.data_dir': '/var/lib/mandaye-cam/sessions'
}
## Encrypt service provider passwords with a secret
# You should install pycypto to use this feature
encrypt_sp_password = True
# Must be a 16, 24, or 32 bytes long
encrypt_secret = 'CHANGEME'

54
postinst Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
#
# Postinst script for mandaye-cam
#
set -e
USER=mandaye-cam
G0ROUP=mandaye-cam
NAME=mandaye-cam
case "$1" in
configure)
if ! getent group $GROUP > /dev/null 2>&1; then
echo -n "Adding group $GROUP.."
addgroup --quiet --system $GROUP
echo "..done"
fi
if ! getent passwd $USER > /dev/null 2>&1; then
echo -n "Adding user $USER.."
adduser --quiet --system --gecos "Mandaye CAM daemon" \
--ingroup $GROUP \
--no-create-home --home $HOME \
$USER
echo "..done"
fi
chown -R $USER:$GROUP /var/lib/$NAME /var/run/$NAME /var/log/$NAME
if [ -z "$2" ]; then
echo -n "Creating database.."
su $USER -p -c "/usr/bin/cam_mandaye_manager --createdb"
echo "..done"
fi
;;
reconfigure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

5
rules
View File

@ -1,5 +1,7 @@
#!/usr/bin/make -f
BUILD_DIR := 'debian/mandaye-cam'
%:
dh $@ --with python2
@ -8,3 +10,6 @@ override_dh_install:
for ver in $(shell pyversions -vr); do \
ln -s /etc/mandaye-cam/local_config.py $(BUILD_DIR)/usr/lib/python$$ver/dist-packages/cam/; \
done
install -d -m 0755 $(BUILD_DIR)/var/lib/mandaye-cam
install -d -m 0755 $(BUILD_DIR)/var/run/mandaye-cam
install -d -m 0755 $(BUILD_DIR)/var/log/mandaye-cam