Commit 3e625d2e authored by chris's avatar chris

Add debian packaging

parent 8ca0cdd7
<VirtualHost *:80>
ServerName nuages.localdomain
Redirect permanent / https://nuages.localdomain/
</VirtualHost>
<VirtualHost *:443>
ServerName nuages.localdomain
CustomLog ${APACHE_LOG_DIR}/nuages-access.log combined
ErrorLog ${APACHE_LOG_DIR}/nuages-error.log
Alias /doc/ /usr/share/doc/nuages/html/
Alias /media/ /var/lib/nuages/www/media/
Alias /static/ /var/lib/nuages/www/staticroot/
WSGIScriptAlias / /var/lib/nuages/www/wsgi.py
<Directory /var/lib/nuages/www>
Order allow,deny
Allow from all
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/nuages.localdomain.crt
SSLCertificateKeyFile /etc/ssl/private-key.localdomain.key
SSLCertificateChainFile /etc/ssl/startSSL/sub.class1.server.ca.pem
SSLCACertificateFile /etc/ssl/startSSL/ca.pem
</VirtualHost>
<VirtualHost *:80>
ServerName nuages.localdomain
CustomLog ${APACHE_LOG_DIR}/nuages-access.log combined
ErrorLog ${APACHE_LOG_DIR}/nuages-error.log
Alias /doc/ /usr/share/doc/nuages/html/
Alias /media/ /var/lib/nuages/www/media/
Alias /static/ /var/lib/nuages/www/staticroot/
WSGIScriptAlias / /var/lib/nuages/www/wsgi.py
<Directory /var/lib/nuages/www>
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
nuages (0.20140711) UNRELEASED; urgency=low
* Initial release.
-- Christophe Siraut <d@tobald.eu.org> Mon, 14 Jul 2014 17:18:01 +0200
Source: nuages
Section: web
Priority: optional
Maintainer: Christophe Siraut <d@tobald.eu.org>
Build-Depends: debhelper (>= 9),
dh-python,
python-all (>= 2.6.6-3~),
python-sphinx,
python-django (>= 1.6)
Homepage: https://nuages.domainepublic.net
Vcs-Git: http://git.domainepublic.net/git/nuages.git/
Vcs-Browser: http://git.domainepublic.net/?p=nuages.git
Package: nuages
Architecture: all
Depends: python,
python-nuages (= ${source:Version}),
nginx | apache2 | httpd,
gunicorn | libapache2-mod-wsgi,
python-django-registration,
${python:Depends},
${misc:Depends}
Description: publish online polls
Nuages aims to provide a collaborative meeting poll system.
.
This package provides all the services to run a Nuage instance.
Package: python-nuages
Section: python
Architecture: all
Depends: ${python:Depends},
${misc:Depends}
Recommends: python-ldap
Description: Python libraries of Nuages
Nuages aims to provide a collaborative meeting poll system.
.
This package provides all the libraries developed as part of the
project. Some of them might be useful outside of this project.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Nuages
Source: http://git.domainepublic.net/?p=nuages.git
Files: *
Copyright: 2013 Christophe Siraut <d@tobald.eu.org>
License: GPL-2.0+
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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 <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
/var/lib/nuages
/var/lib/nuages/www
/var/lib/nuages/www/media
/var/lib/nuages/www/staticroot
docs/_build/html
debian/apache/nuages.conf etc/apache2/sites-available
debian/apache/nuages-ssl.conf etc/apache2/sites-available
#!/bin/sh
set -e
case "$1" in
configure)
# Create the secret key
if [ ! -f /var/lib/nuages/key ]; then
pwgen -s -y 50 > /var/lib/nuages/key
chmod 640 /var/lib/nuages/key
fi
# Sync dthe database and collect the static files
nuages syncdb -v 0 --noinput
nuages collectstatic -v 0 --noinput
chown -R www-data /var/lib/nuages
# Adapt apache virtual host
export DOMAIN=`hostname -d`
sed "s/localdomain/${DOMAIN}/g" -i /etc/apache2/sites-available/nuages.conf
sed "s/localdomain/${DOMAIN}/g" -i /etc/apache2/sites-available/nuages-ssl.conf
[ -z "`grep -r nuages /etc/apache2/sites-enabled`" ] && ln -sf /etc/apache2/sites-available/nuages.conf /etc/apache2/sites-enabled/nuages.conf
echo "You may need to configure apache."
;;
esac
#DEBHELPER#
exit 0
usr/lib/python2*/dist-packages/nuages
usr/lib/python2*/dist-packages/Nuages*
usr/lib/python2*/dist-packages/meetingpoll
usr/lib/python2*/dist-packages/DjangoMeetingPoll*
usr/lib/python2*/dist-packages/nuages_templates
usr/lib/python2*/dist-packages/registration_templates
etc/nuages
#!/usr/bin/make -f
NAME=nuages
#export PYBUILD_NAME=$(NAME)
#export DH_VERBOSE=1
%:
dh $@ --with python2,sphinxdoc --buildsystem=pybuild
override_dh_auto_install:
dh_auto_install
install -m 755 -D manage.py debian/$(NAME)/usr/bin/nuages
install -m 644 -D nuages/wsgi.py debian/$(NAME)/var/lib/nuages/www
# Move settings in /etc/
if [ ! -e debian/tmp/etc/$(NAME)/settings ]; then \
mkdir -p debian/tmp/etc/$(NAME)/; \
fi
for f in `find debian/tmp -name 'settings.py'`; do \
mv -v $$f debian/tmp/etc/$(NAME); \
ln -sf /etc/$(NAME)/settings.py $$f; \
done
for f in `find debian/tmp -name 'local_settings.py'`; do \
touch debian/tmp/etc/$(NAME)/local_settings.py; \
rm $$f; \
ln -sf /etc/$(NAME)/local_settings.py $$f; \
done
override_dh_auto_test:
./manage.py test nuages meetingpoll
<VirtualHost *:443>
ServerName nuages.localdomain
CustomLog ${APACHE_LOG_DIR}/nuages-access.log combined
ErrorLog ${APACHE_LOG_DIR}/nuages-error.log
Alias /static/ /var/lib/nuages/www/staticroot/
WSGIScriptAlias / /var/lib/nuages/www/wsgi.py
<Directory /var/lib/nuages/www>
Order allow,deny
Allow from all
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/nuages.localdomain.crt
SSLCertificateKeyFile /etc/ssl/private-key.localdomain.key
SSLCertificateChainFile /etc/ssl/startSSL/sub.class1.server.ca.pem
SSLCACertificateFile /etc/ssl/startSSL/ca.pem
</VirtualHost>
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
......@@ -24,6 +24,8 @@ DATABASES = {
'PORT': '',
},
}
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
INSTALLED_APPS += (
'debug_toolbar',
)
......@@ -7,12 +7,10 @@ import socket
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
ALLOWED_HOSTS = [socket.getfqdn()]
ALLOWED_HOSTS = ['.%s' % ''.join(socket.getfqdn().split('.')[1:])]
ADMINS = (
('Nuages', 'nuages@lists.domainepublic.net'),
('Nuages', 'nuages@domainepublic.net'),
)
MANAGERS = ADMINS
DEFAULT_FROM_EMAIL = 'nuages@domainepublic.net'
......@@ -58,18 +56,18 @@ USE_I18N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
MEDIA_ROOT = '/var/lib/nuages/www/media'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
MEDIA_URL = '/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
STATIC_ROOT = '/var/lib/nuages/www/staticroot'
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
......
#!/usr/bin/environ python
#!/usr/bin/env python
from django.core.urlresolvers import reverse
from django_webtest import WebTest
from meetingpoll.models import createId
......
......@@ -4,6 +4,16 @@ import os
import re
def find_packages(dirs):
p = []
for d in dirs:
p.extend([
'.'.join(directory.split(os.sep))
for directory, _, files in os.walk(d)
if '__init__.py' in files
])
return p
def find_package_data(basedir):
pkgdata = {}
pkgdir = {}
......@@ -42,13 +52,15 @@ setup(
author='Christophe Siraut',
author_email='d@tobald.eu.org',
url='http://nuages.domainepublic.net/',
packages=[
packages=find_packages([
'nuages',
'nuages_templates',
'meetingpoll',
'registration_templates'
],
package_data=find_package_data('nuages'),
]),
package_data=dict(
find_package_data('nuages_templates').items() +
find_package_data('registration_templates').items()
),
install_requires=[
'django',
'django-jquery',
......@@ -72,15 +84,15 @@ setup(
)
setup(
name='MeetingPoll',
name='DjangoMeetingPoll',
version=version,
description='Meeting poll Django Application',
author='Christophe Siraut',
author_email='d@tobald.eu.org',
url='http://nuages.domainepublic.net/',
packages=[
packages=find_packages([
'meetingpoll',
],
]),
package_data=find_package_data('meetingpoll'),
install_requires=[
'django',
......
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