Revize 1380
Přidáno uživatelem Ondřej Fibich před více než 12 roky(ů)
freenetis/branches/testing/license.txt | ||
---|---|---|
|
||
Freenetis - open source information system for managing community
|
||
based networks. It provides features like payment management, user
|
||
and device management, services management etc.
|
||
Copyright (C) 2008-2011 Tomas Dulik, Michal Kliment, Jiri Svitak,
|
||
Roman Sevcik, Ondrej Fibich, Petr Danek, Marek Rozehnal
|
||
|
||
This program 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 3 of the License, or
|
||
(at your option) any later version.
|
||
|
||
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 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/>.
|
freenetis/branches/testing/application/vendors/deb/control | ||
---|---|---|
Priority: optional
|
||
Section: web
|
||
Depends: apache2, php5, php5-curl, libapache2-mod-php5, php5-mysql | php5-mysqli
|
||
Suggests: mysql-server (>= 5.0.0), mysql-client
|
||
Architecture: all
|
||
Maintainer: Ondrej Fibich <ondrej.fibich@gmail.com>
|
||
Homepage: http://www.freenetis.org
|
||
Description: FreenetIS - information system for managing non-profit networks
|
||
FreenetIS is multilanguage information system for managing non-profit networks
|
||
which is capable to:
|
||
- manage groups and their users;
|
||
- double-entry accounting system (payments, double-entry transfers, bank transfers, accounts, bank accounts, cash flow);
|
||
- network infrastructure (devices, segments, interfaces, IP addresses, subnets, VLANs, VLAN interfaces, ports);
|
||
- monitoring (devices);
|
||
- QoS;
|
||
- notifications (unknown devices page, page for debtors or just information page using SMS, email or redirection);
|
||
- work reporting of active users and work approval;
|
||
- lists of calls and billing of VoIP;
|
||
- etc.
|
freenetis/branches/testing/application/vendors/deb/postinst | ||
---|---|---|
#!/bin/bash
|
||
# FreenetIS DEB: actions after installing of package
|
||
|
||
set -e
|
||
. /usr/share/debconf/confmodule
|
||
|
||
SERVER=apache2
|
||
CONFIGFILE=/etc/freenetis/freenetis.conf
|
||
|
||
# Generate config file, if it doesn’t exist.
|
||
# An alternative is to copy in a template
|
||
# file from elsewhere.
|
||
|
||
if [ ! -e $CONFIGFILE ]; then
|
||
mkdir /etc/freenetis/
|
||
echo "# Config file for FreenetIS" > $CONFIGFILE
|
||
echo "SERVERNAME=\"localhost/freenetis\"" >> $CONFIGFILE
|
||
echo "PROTOCOL=\"http\"" >> $CONFIGFILE
|
||
fi
|
||
|
||
# Substitute in the values from the debconf db.
|
||
# There are obvious optimizations possible here.
|
||
# The cp before the sed ensures we do not mess up
|
||
# the config file’s ownership and permissions.
|
||
|
||
db_get freenetis/servername
|
||
SERVERNAME="$RET"
|
||
|
||
db_get freenetis/protocol
|
||
PROTOCOL="$RET"
|
||
|
||
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
|
||
|
||
# If the admin deleted or commented some variables but then set
|
||
# them via debconf, (re-)add them to the conffile.
|
||
|
||
test -z "$SERVERNAME" || grep -Eq '^ *SERVERNAME=' $CONFIGFILE || echo "SERVERNAME=" >> $CONFIGFILE
|
||
SERVERNAME_ESCAPED="${SERVERNAME//\//\\/}"
|
||
sed -e "s/^ *SERVERNAME=.*/SERVERNAME=\"$SERVERNAME_ESCAPED\"/" < $CONFIGFILE > $CONFIGFILE.tmp
|
||
|
||
test -z "$PROTOCOL" || grep -Eq '^ *PROTOCOL=' $CONFIGFILE || echo "PROTOCOL=" >> $CONFIGFILE
|
||
sed -e "s/^ *PROTOCOL=.*/PROTOCOL=\"$PROTOCOL\"/" < $CONFIGFILE > $CONFIGFILE.tmp
|
||
|
||
mv -f $CONFIGFILE.tmp $CONFIGFILE
|
||
|
||
# check server name
|
||
if [ -z "$SERVERNAME" ]; then
|
||
echo "Wrong server name, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
# check protocol
|
||
if [ -z "$PROTOCOL" ]; then
|
||
echo "Wrong protocol, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
# Make post install things
|
||
|
||
# 1) Apache config
|
||
|
||
A2CF=/etc/$SERVER/conf.d/freenetis.conf
|
||
|
||
# activate redirection
|
||
a2enmod rewrite > /dev/null
|
||
|
||
# make config
|
||
if [[ "$SERVERNAME" == localhost* ]]; then
|
||
|
||
echo "<Directory /var/www/freenetis>" >> $A2CF
|
||
echo " Options Indexes FollowSymLinks MultiViews" >> $A2CF
|
||
echo " AllowOverride All" >> $A2CF
|
||
echo " Order allow,deny" >> $A2CF
|
||
echo " allow from all" >> $A2CF
|
||
echo "</Directory>" >> $A2CF
|
||
|
||
else
|
||
|
||
if [ "$PROTOCOL" = "https" ]; then
|
||
echo "NameVirtualHost *:443" > $A2CF
|
||
echo "<VirtualHost *:443>" >> $A2CF
|
||
else
|
||
echo "NameVirtualHost *:80" > $A2CF
|
||
echo "<VirtualHost *:80>" >> $A2CF
|
||
fi
|
||
|
||
echo " ServerName ${SERVERNAME}" >> $A2CF
|
||
echo " DocumentRoot /var/www/freenetis" >> $A2CF
|
||
echo " <Directory /var/www/freenetis>" >> $A2CF
|
||
echo " Options Indexes FollowSymLinks MultiViews" >> $A2CF
|
||
echo " AllowOverride All" >> $A2CF
|
||
echo " Order allow,deny" >> $A2CF
|
||
echo " allow from all" >> $A2CF
|
||
echo " </Directory>" >> $A2CF
|
||
echo " ErrorLog /var/log/apache2/freenetis.error.log" >> $A2CF
|
||
echo " CustomLog /var/log/apache2/freenetis.log common" >> $A2CF
|
||
|
||
if [ "$PROTOCOL" = "https" ]; then
|
||
echo " SSLEngine on" >> $A2CF
|
||
echo " SSLProtocol all -SSLv2" >> $A2CF
|
||
echo " SSLCipherSuite ALLADHEXPORTSSLv2:RC4+RSA:+HIGH:+MEDIUM" >> $A2CF
|
||
echo " SSLCertificateFile /etc/freenetis/ssl.crt" >> $A2CF
|
||
echo " SSLCertificateKeyFile /etc/freenetis/ssl.key" >> $A2CF
|
||
echo " SSLCertificateChainFile /etc/freenetis/sub.class1.server.ca.pem" >> $A2CF
|
||
echo " SSLCACertificateFile /etc/freenetis/ca.pem" >> $A2CF
|
||
echo " SetEnvIf User-Agent \".*MSIE.*\" nokeepalive ssl-unclean-shutdown" >> $A2CF
|
||
fi
|
||
|
||
echo "</VirtualHost>" >> $A2CF
|
||
|
||
fi
|
||
|
||
# restart
|
||
set +e
|
||
apache2ctl restart
|
||
set -e
|
||
|
||
# 2) CRON
|
||
|
||
CRON_LINE="* * * * * root wget -O /dev/null ${PROTOCOL}://${SERVERNAME}/cs/scheduler/run"
|
||
CRON_TABLE_TMP=/tmp/fn_cron_tab
|
||
|
||
set +e
|
||
crontab -u root -l > $CRON_TABLE_TMP
|
||
set -e
|
||
|
||
echo "$CRON_LINE" >> $CRON_TABLE_TMP
|
||
crontab -u root $CRON_TABLE_TMP
|
||
|
||
#DEBHELPER#
|
freenetis/branches/testing/application/vendors/deb/postrm | ||
---|---|---|
#!/bin/sh
|
||
# FreenetIS DEB: actions before uninstalling of package
|
||
|
||
set -e
|
||
. /usr/share/debconf/confmodule
|
||
|
||
# get config
|
||
db_get freenetis/servername
|
||
SERVERNAME="$RET"
|
||
|
||
db_get freenetis/protocol
|
||
PROTOCOL="$RET"
|
||
|
||
# remove from Apache config
|
||
SERVER=apache2
|
||
rm -rf /etc/$SERVER/conf.d/freenetis.conf
|
||
|
||
# remove from CRON
|
||
CRON_TABLE_TMP=/tmp/fn_cron_tab
|
||
CRON_TABLE_TMP2=/tmp/fn_cron_tab2
|
||
CRON_LINE="* * * * * root wget -O /dev/null ${PROTOCOL}://${SERVERNAME}/cs/scheduler/run"
|
||
|
||
set +e
|
||
crontab -l > $CRON_TABLE_TMP
|
||
if [ $? -ne 0 ]; then
|
||
echo "" > $CRON_TABLE_TMP
|
||
fi
|
||
set -e
|
||
|
||
sed --silent '/$CRON_LINE/d' $CRON_TABLE_TMP
|
||
|
||
while read line; do
|
||
if [ "$CRON_LINE" != "$line" ]; then
|
||
echo "$line"
|
||
fi
|
||
done < $CRON_TABLE_TMP > $CRON_TABLE_TMP2
|
||
|
||
crontab $CRON_TABLE_TMP2
|
||
|
||
# remove all configuration if purge
|
||
if [ "$1" = purge ]; then
|
||
# remove defconf values
|
||
if [ -e /usr/share/debconf/confmodule ]; then
|
||
db_purge
|
||
fi
|
||
# remove config files
|
||
rm -rf /etc/freenetis
|
||
# remove all files
|
||
rm -rf /var/www/freenetis
|
||
fi
|
||
|
||
# restart apache
|
||
#/etc/init.d/apache2 restart
|
||
|
||
#DEBHELPER#
|
freenetis/branches/testing/application/vendors/deb/config | ||
---|---|---|
#!/bin/sh
|
||
|
||
set -e
|
||
. /usr/share/debconf/confmodule
|
||
|
||
CONFIGFILE=/etc/freenetis.conf
|
||
|
||
# Load config file, if it exists.
|
||
if [ -e $CONFIGFILE ]; then
|
||
. $CONFIGFILE || true
|
||
db_set freenetis/servername "$SERVERNAME"
|
||
db_set freenetis/protocol "$PROTOCOL"
|
||
fi
|
||
|
||
# Ask questions.
|
||
db_input critical freenetis/servername || true
|
||
db_input critical freenetis/protocol || true
|
||
db_go || true
|
freenetis/branches/testing/application/vendors/deb/debianization.sh | ||
---|---|---|
#!/bin/sh
|
||
################################################################################
|
||
# Script for debianization of FreenetIS
|
||
# (c) Ondrej Fibich, 2012
|
||
#
|
||
# Takes one argument (version of package - FreenetIS). Example:
|
||
#
|
||
# $ freenetis_debianization 1.1
|
||
#
|
||
################################################################################
|
||
|
||
if [ $# -ne 1 ]; then
|
||
echo "Wrong arg count.. Terminating"
|
||
exit 1
|
||
fi
|
||
|
||
NAME=freenetis
|
||
VERSION=$1
|
||
|
||
# create dirs ##################################################################
|
||
rm -rf deb_packages
|
||
mkdir deb_packages
|
||
mkdir deb_packages/tmp
|
||
cd deb_packages/tmp
|
||
|
||
mkdir DEBIAN
|
||
mkdir var
|
||
mkdir var/www
|
||
mkdir var/www/${NAME}
|
||
|
||
# copy content of package ######################################################
|
||
|
||
cd ..
|
||
tar -zcvf /tmp/freenetis_packaging.tar.gz ../../../../ 1>/dev/null
|
||
|
||
if [ $? -ne 0 ]; then
|
||
echo "error during packaging"
|
||
exit 2
|
||
fi
|
||
|
||
cd tmp/var/www/${NAME}
|
||
|
||
tar -xvf /tmp/freenetis_packaging.tar.gz 1>/dev/null
|
||
|
||
if [ $? -ne 0 ]; then
|
||
echo "error during unpackaging"
|
||
exit 3
|
||
fi
|
||
|
||
rm /tmp/freenetis_packaging.tar.gz
|
||
|
||
cd ../../../
|
||
|
||
# remove dev parts of FN
|
||
rm -rf var/www/${NAME}/application/vendor/deb
|
||
rm -rf var/www/${NAME}/application/vendor/unit_tester
|
||
rm -rf var/www/${NAME}/application/controllers/unit_tester.php
|
||
rm -rf var/www/${NAME}/application/views/unit_tester
|
||
# remove hidden
|
||
rm -rf var/www/${NAME}/.htaccess
|
||
rm -rf var/www/${NAME}/config.php
|
||
rm -rf var/www/${NAME}/upload/*
|
||
rm -rf var/www/${NAME}/logs
|
||
rm -rf var/www/${NAME}/doc
|
||
# remove .svn
|
||
rm -rf `find var/www/${NAME} -type d -name .svn`
|
||
|
||
# count size
|
||
SIZE=`du -s var | cut -f1`
|
||
|
||
# calculate checksum ###########################################################
|
||
|
||
find * -type f ! -regex '^DEBIAN/.*' -exec md5sum {} \; >> DEBIAN/md5sums
|
||
|
||
# create info files ############################################################
|
||
|
||
# create package info
|
||
|
||
echo "Package: ${NAME}" >> DEBIAN/control
|
||
echo "Version: ${VERSION}" >> DEBIAN/control
|
||
echo "Installed-Size: ${SIZE}" >> DEBIAN/control
|
||
cat ../../control >> DEBIAN/control
|
||
|
||
# change log
|
||
|
||
cat ../../changelog >> DEBIAN/changelog
|
||
|
||
# copywriting
|
||
|
||
echo "This package was debianized by Ondrej Fibich <ondrej.fibich@gmail.com> on" >> DEBIAN/copyright
|
||
date -R >> DEBIAN/copyright
|
||
echo "" >> DEBIAN/copyright
|
||
echo "It was downloaded from <http://freenetis.org/>" >> DEBIAN/copyright
|
||
echo "" >> DEBIAN/copyright
|
||
echo "Upstream Author:" >> DEBIAN/copyright
|
||
cat var/www/${NAME}/AUTHORS >> DEBIAN/copyright
|
||
echo "" >> DEBIAN/copyright
|
||
echo "License:" >> DEBIAN/copyright
|
||
cat var/www/${NAME}/COPYING >> DEBIAN/copyright
|
||
|
||
# scripts ######################################################################
|
||
|
||
cat ../../postinst >> DEBIAN/postinst
|
||
cat ../../postrm >> DEBIAN/postrm
|
||
cat ../../templates >> DEBIAN/templates
|
||
cat ../../config >> DEBIAN/config
|
||
|
||
chmod +x DEBIAN/postinst DEBIAN/postrm DEBIAN/config
|
||
|
||
# create deb ###################################################################
|
||
|
||
# change owner of files to root (security)
|
||
cd ..
|
||
sudo chown -hR root:root *
|
||
cd tmp
|
||
sudo chmod ugo+w var/www/${NAME} var/www/${NAME}/upload
|
||
sudo mkdir -m 0777 var/www/${NAME}/logs
|
||
|
||
# make package
|
||
cd ..
|
||
sudo dpkg-deb -b tmp ${NAME}_${VERSION}_all.deb
|
||
|
||
# clean-up mess ################################################################
|
||
|
||
# clean
|
||
sudo rm -rf tmp
|
||
freenetis/branches/testing/application/vendors/deb/templates | ||
---|---|---|
Template: freenetis/servername
|
||
Type: string
|
||
Default: localhost/freenetis
|
||
Description: Server Name:
|
||
Server Name on which the FreenetIS will be hosted.
|
||
|
||
Template: freenetis/protocol
|
||
Type: select
|
||
Choices: http, https
|
||
Default: http
|
||
Description: Protocol:
|
||
Protocol for accessing of FreenetIS.
|
freenetis/branches/testing/AUTHORS | ||
---|---|---|
|
||
Tomáš Dulík <dulik@unart.cz>
|
||
Ondřej Fibich <ondrej.fibich@gmail.com>
|
||
Michal Kliment <kliment@freenetis.org>
|
||
David Raška <jeffraska@gmail.com>
|
||
Jiří Sviták <j.svitak@unart.cz>
|
||
Roman Ševčík <sevcik.roman@mail.unart.cz>
|
freenetis/branches/testing/COPYING | ||
---|---|---|
|
||
This program 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 3 of the License, or
|
||
(at your option) any later version.
|
||
|
||
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 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/>.
|
Také k dispozici: Unified diff
Novinky:
- generovani DEB balicku ze zdrojovych souboru (#147)
- pridan seznam autoru FN
Upravy:
- upraven licencni soubor