DEBIAN COMPLIANCE big commit : fixes almost all lintian issues + complete rewrite of debian/rules (now mostly in Makefile at the root of source code) + start using POD2MAN for man pages + remove some old unused and broken tools

This commit is contained in:
Benjamin Sonntag 2013-04-23 15:11:00 +00:00
parent d3958786e5
commit b3c19b3a9b
25 changed files with 196 additions and 389 deletions

9
.gitattributes vendored
View File

@ -4,6 +4,7 @@
/CODING_CONVENTION.php -text /CODING_CONVENTION.php -text
/COPYING -text /COPYING -text
/DEBIAN_COMPLIANCE -text /DEBIAN_COMPLIANCE -text
/Makefile -text
/README -text /README -text
awstats/Makefile -text awstats/Makefile -text
awstats/alternc-awstats -text awstats/alternc-awstats -text
@ -408,7 +409,6 @@ bureau/locales/pt_BR/LC_MESSAGES/alternc -text
bureau/locales/pt_BR/LC_MESSAGES/manual.po -text bureau/locales/pt_BR/LC_MESSAGES/manual.po -text
bureau/locales/pt_BR/LC_MESSAGES/messages.po -text bureau/locales/pt_BR/LC_MESSAGES/messages.po -text
debian/.svnignore -text debian/.svnignore -text
debian/README.Debian -text
debian/alternc-awstats.cron.d -text debian/alternc-awstats.cron.d -text
debian/alternc-awstats.dirs -text debian/alternc-awstats.dirs -text
debian/alternc-awstats.lintian-override -text debian/alternc-awstats.lintian-override -text
@ -420,7 +420,6 @@ debian/alternc-roundcube.dirs -text
debian/alternc-roundcube.postinst -text debian/alternc-roundcube.postinst -text
debian/alternc-slave.config -text debian/alternc-slave.config -text
debian/alternc-slave.dirs -text debian/alternc-slave.dirs -text
debian/alternc-slave.install -text
debian/alternc-slave.links -text debian/alternc-slave.links -text
debian/alternc-slave.lintian -text debian/alternc-slave.lintian -text
debian/alternc-slave.logrotate -text debian/alternc-slave.logrotate -text
@ -440,7 +439,6 @@ debian/alternc.logrotate -text
debian/alternc.postinst -text debian/alternc.postinst -text
debian/alternc.postrm -text debian/alternc.postrm -text
debian/alternc.preinst -text debian/alternc.preinst -text
debian/alternc.prerm -text
debian/alternc.templates -text debian/alternc.templates -text
debian/changelog -text debian/changelog -text
debian/compat -text debian/compat -text
@ -538,8 +536,7 @@ lang/en_US.po -text
lang/nl_NL.po -text lang/nl_NL.po -text
man/alternc-admintools.8 -text man/alternc-admintools.8 -text
man/alternc-admintools.fr.8 -text man/alternc-admintools.fr.8 -text
man/alternc.install.8 -text man/alternc.install.pod -text
man/alternc.install.fr.8 -text
man/get_account_by_domain.8 -text man/get_account_by_domain.8 -text
man/get_domains_by_account.8 -text man/get_domains_by_account.8 -text
man/top_ftp_users.8 -text man/top_ftp_users.8 -text
@ -580,7 +577,6 @@ squirrelmail/templates/squirrelmail/alternc-changepass.conf -text
squirrelmail/templates/squirrelmail/apache.conf -text squirrelmail/templates/squirrelmail/apache.conf -text
squirrelmail/templates/squirrelmail/avelsieve-config.php -text squirrelmail/templates/squirrelmail/avelsieve-config.php -text
squirrelmail/unavelsieve -text squirrelmail/unavelsieve -text
src/Makefile -text
src/alternc-check -text src/alternc-check -text
src/alternc-dboptimize -text src/alternc-dboptimize -text
src/alternc-passwd -text src/alternc-passwd -text
@ -623,7 +619,6 @@ tests/make_mail_dataset.sh -text
tests/mechdump.pm -text tests/mechdump.pm -text
tests/test_demo.pl -text tests/test_demo.pl -text
tests/whois_test.php -text tests/whois_test.php -text
tools/alternc_get_path -text
tools/get_account_by_domain -text tools/get_account_by_domain -text
tools/get_domains_by_account -text tools/get_domains_by_account -text
tools/top_ftp_users -text tools/top_ftp_users -text

93
Makefile Normal file
View File

@ -0,0 +1,93 @@
#!/usr/bin/make -f
# ----------------------------------------------------------------------
# AlternC - Web Hosting System
# Copyright (C) 2000-2013 by the AlternC Development Team.
# https://alternc.org/
# ----------------------------------------------------------------------
# LICENSE
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2
# 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.
#
# To read the license please visit http://www.gnu.org/copyleft/gpl.html
# ----------------------------------------------------------------------
# Purpose of file: Global Makefile
# ----------------------------------------------------------------------
MAJOR=$(shell sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog)
REV=$(shell env LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$2 }')
VERSION="${MAJOR}~svn${REV}"
export VERSION
build:
# gettext are built at runtime, to be able to MERGE them from CORE + MODULES before msgfmt
pod2man --center "" --date "" --release "AlternC" --section=8 man/alternc.install.pod >man/alternc.install.8
install:
#install-alternc install-squirrelmail install-roundcube install-upnp install-awstats
# install AlternC files common between ALTERNC and ALTERNC-SLAVE
install-common:
# Shell Scripts
test -d $(DESTDIR)/usr/lib/alternc || mkdir -p $(DESTDIR)/usr/lib/alternc
cp src/* $(DESTDIR)/usr/lib/alternc/
chown root:root $(DESTDIR)/usr/lib/alternc/*
chmod 755 $(DESTDIR)/usr/lib/alternc/*
# Configuration Files
test -d $(DESTDIR)/etc || mkdir -p $(DESTDIR)/etc
cp -r etc/alternc $(DESTDIR)/etc
find $(DESTDIR)/etc/alternc -depth -type d -name ".svn" -exec rm {} -rf \;
chmod 755 $(DESTDIR)/etc/alternc
# Installer and upgrade scripts
test -d $(DESTDIR)/usr/share/alternc/install || mkdir -p $(DESTDIR)/usr/share/alternc/install
cp -r install/* $(DESTDIR)/usr/share/alternc/install
find $(DESTDIR)/usr/share/alternc/install -depth -type d -name ".svn" -exec rm {} -rf \;
chmod a+x $(DESTDIR)/usr/share/alternc/install/alternc.install $(DESTDIR)/usr/share/alternc/install/dopo.sh $(DESTDIR)/usr/share/alternc/install/mysql.sh $(DESTDIR)/usr/share/alternc/install/newone.php $(DESTDIR)/usr/share/alternc/install/reset_root.php $(DESTDIR)/usr/share/alternc/install/upgrade_check.sh $(DESTDIR)/usr/share/alternc/install/upgrades/*.php $(DESTDIR)/usr/share/alternc/install/upgrades/*.sh
# install AlternC itself:
install-alternc: install-common
# Web Panel
test -d $(DESTDIR)/usr/share/alternc/panel || mkdir $(DESTDIR)/usr/share/alternc/panel
cp -r bureau/* $(DESTDIR)/usr/share/alternc/panel
find $(DESTDIR)/usr/share/alternc/panel -depth -type d -name ".svn" -exec rm {} -rf \;
sed -i -e "s/@@REPLACED_DURING_BUILD@@/${MAJOR}/" $(DESTDIR)/usr/share/alternc/panel/class/local.php
echo ${VERSION} > $(DESTDIR)/usr/share/alternc/panel/class/.svn-infos
chown -R root:root $(DESTDIR)/usr/share/alternc/panel
chmod -R 644 $(DESTDIR)/usr/share/alternc/panel
chmod -R a+X $(DESTDIR)/usr/share/alternc/panel
# Logs
test -d $(DESTDIR)/var/log/alternc || mkdir $(DESTDIR)/var/log/alternc
chown -R root:root $(DESTDIR)/var/log/alternc
# Ex old alternc-admintools
install -o root -g root -m 755 tools/* $(DESTDIR)/usr/bin
# Man pages
install -o root -g root -m 644 man/*.8 $(DESTDIR)/usr/share/man/man8/
install-slave: install-common
# Man pages
install -o root -g root -m 644 man/alternc.install.8 $(DESTDIR)/usr/share/man/man8/
# Then its modules :
install-awstats:
make -C awstats install DESTDIR=$(DESTDIR)
install-roundcube:
make -C roundcube install DESTDIR=$(DESTDIR)
install-squirrelmail:
make -C squirrelmail install DESTDIR=$(DESTDIR)
install-upnp:
make -C upnp install DESTDIR=$(DESTDIR)

View File

@ -1,9 +0,0 @@
alternc for Debian
------------------
This package is BETA version, and could be use for production purpose, but without any
warranty, as stated in the GPL
-- Benjamin Sonntag <benjamin@alternc.org>, Tue, 09 Sep 2002 19:31:26 +0200

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
# Check that AlternC is properly installed/configured # Check that AlternC is properly installed AND configured
if [ -f /etc/alternc/local.sh ] if [ -f /etc/alternc/local.sh ]
then then
exit 0 exit 0
@ -12,7 +12,6 @@ else
db_fset alternc-awstats/errorinstall seen false db_fset alternc-awstats/errorinstall seen false
db_input medium alternc-awstats/errorinstall db_input medium alternc-awstats/errorinstall
db_go db_go
# il FAUT qu'AlternC soit proprement configuré pour installer awstats
exit 1 exit 1
fi fi

View File

@ -9,7 +9,7 @@ usr/bin
usr/lib/alternc usr/lib/alternc
usr/sbin usr/sbin
usr/share/alternc/install usr/share/alternc/install
usr/share/man/man8/
usr/share/locale/fr/LC_MESSAGES usr/share/locale/fr/LC_MESSAGES
var/backups/alternc var/lib/alternc/backups
var/log/alternc var/log/alternc
var/run/alternc

View File

@ -1,8 +0,0 @@
etc/*
usr/bin/*
usr/lib/alternc/*
#usr/sbin/*
usr/share/alternc/install/*
usr/share/locale/fr/LC_MESSAGES/alternc-admintools.mo
usr/share/man/fr/man8/*
usr/share/man/man8/*

View File

@ -16,13 +16,13 @@ set -e
case "$1" in case "$1" in
purge) purge)
rm -f /etc/alternc/local.sh /etc/alternc/my.cnf /etc/alternc/bureau.conf rm -f /etc/alternc/local.sh /etc/alternc/my.cnf /etc/alternc/bureau.conf
rm -f /var/backups/alternc/etc-installed.tar.gz rm -f /var/lib/alternc/backups/etc-installed.tar.gz
db_input high alternc/postrm_remove_datafiles || true db_input high alternc/postrm_remove_datafiles || true
db_go db_go
db_get alternc/postrm_remove_datafiles || true db_get alternc/postrm_remove_datafiles || true
if [ "$RET" = "true" ]; then if [ "$RET" = "true" ]; then
rm -rf /var/backups/alternc rm -rf /var/lib/alternc/backups/
fi fi
rm -f /etc/apache/conf.d/override_php.conf /etc/apache/conf.d/alternc-ssl.conf /etc/apache/conf.d/alternc.conf rm -f /etc/apache/conf.d/override_php.conf /etc/apache/conf.d/alternc-ssl.conf /etc/apache/conf.d/alternc.conf

View File

@ -127,7 +127,7 @@ Template:alternc-slave/monitor_ip
Type: string Type: string
_Description: The monitoring server: _Description: The monitoring server:
The IP address (or ip/prefix) of the server(s) which must be authorized to The IP address (or ip/prefix) of the server(s) which must be authorized to
ping us and access apache status pages. Completely optional. ping the server and access apache status pages. Completely optional.
Template:alternc-slave/postrm_remove_databases Template:alternc-slave/postrm_remove_databases
Type: boolean Type: boolean

View File

@ -1,3 +1,7 @@
# Create /var/run/ folder : it may be a ramdrive
@reboot root mkdir -p /var/run/alternc && chown alterncpanel:alterncpanel /var/run/alternc
# Every 2 days compress log files # Every 2 days compress log files
0 4 * * * alterncpanel /usr/lib/alternc/compress_logs.sh 0 4 * * * alterncpanel /usr/lib/alternc/compress_logs.sh

10
debian/alternc.dirs vendored
View File

@ -17,11 +17,11 @@ usr/lib/alternc/install.d
usr/lib/alternc/reload.d usr/lib/alternc/reload.d
usr/lib/alternc/safe_mode_exec_dir usr/lib/alternc/safe_mode_exec_dir
usr/sbin usr/sbin
usr/share/man/man8/
usr/share/alternc/install usr/share/alternc/install
usr/share/locale/fr/LC_MESSAGES usr/share/locale/fr/LC_MESSAGES
var/backups/alternc var/lib/alternc/backups
/var/lib/alternc/apache-vhost var/lib/alternc/apache-vhost
/var/lib/alternc/bind var/lib/alternc/bind
/var/lib/alternc/bind/zones var/lib/alternc/bind/zones
var/log/alternc var/log/alternc
var/run/alternc

View File

@ -16,7 +16,7 @@ set -e
case "$1" in case "$1" in
purge) purge)
rm -f /etc/alternc/local.sh /etc/alternc/my_mail.cnf /etc/alternc/bureau.conf rm -f /etc/alternc/local.sh /etc/alternc/my_mail.cnf /etc/alternc/bureau.conf
rm -f /var/backups/alternc/etc-installed.tar.gz rm -f /var/lib/alternc/backups/etc-installed.tar.gz
rm -f /etc/incron.d/alternc rm -f /etc/incron.d/alternc
# FIXME : remove following commented lines if we are sure # FIXME : remove following commented lines if we are sure
@ -38,7 +38,7 @@ case "$1" in
#db_go #db_go
#db_get alternc/postrm_remove_datafiles || true #db_get alternc/postrm_remove_datafiles || true
#if [ "$RET" = "true" ]; then #if [ "$RET" = "true" ]; then
# rm -rf /var/backups/alternc /var/alternc/dns /var/alternc/html /var/alternc/redir # rm -rf /var/lib/alternc/backups /var/alternc/dns /var/alternc/html /var/alternc/redir
#fi #fi
# Purge bind zones # Purge bind zones
@ -63,7 +63,7 @@ case "$1" in
# Restore orignals conf files which have been replaced by Alternc # Restore orignals conf files which have been replaced by Alternc
# With the oldest tar found # With the oldest tar found
BACKUP=$(ls /var/backups/alternc/etc-original*.tar.gz | head -n 1) BACKUP=$(ls /var/lib/alternc/backups/etc-original*.tar.gz | head -n 1)
tar -C / -xf "$BACKUP" 2>/dev/null || true tar -C / -xf "$BACKUP" 2>/dev/null || true
# Reload services which use these files # Reload services which use these files

47
debian/alternc.prerm vendored
View File

@ -1,47 +0,0 @@
#!/bin/bash
# Debian alternc prerm
# Benjamin Sonntag <benjamin@alternc.org>
case "$1" in
remove)
# remove postfix from the sasl group (might not be user will though...)
deluser --quiet postfix sasl || true
#if [ -r "/etc/alternc/local.sh" ]
#then
# . /etc/alternc/local.sh
#else
# FQDN="`hostname --fqdn`"
#fi
FQDN_LETTER="`echo $FQDN | sed -e 's/.*\.\([^\.]\)[^\.]*\.[^\.]*$/\1/'`"
#rm -rf /var/alternc/bureau/locales || true
#rmdir -p /var/alternc/bureau 2> /dev/null || true
#rm -f /var/alternc/dns/bureau || true
#rm -f /var/alternc/dns/$FQDN_LETTER/$FQDN || true
#rmdir -p /var/alternc/html/a/admin 2> /dev/null || true
#rmdir -p /var/alternc/html/r/root 2> /dev/null || true
;;
upgrade)
;;
purge)
#find /var/alternc/bureau/locales -type f -name "alternc.mo" -exec rm {} \;
#find /var/alternc/bureau/locales -type f -name "alternc" -exec rm {} \;
#rm /var/alternc/bureau/class/local.php
#rm -f /var/alternc/apacheconf/bureau
#rm -f /var/alternc/apacheconf/$FQDN_LETTER/$FQDN
;;
failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument '$1'" >&2
exit 1
;;
esac
#DEBHELPER#

View File

@ -52,21 +52,21 @@ _Description: Name of the secondary domain name server:
Template: alternc/alternc_html Template: alternc/alternc_html
Type: string Type: string
_Description: The path where alternc's users html files will be put _Description: Path where AlternC's users html files will be located:
Please enter the directory name where you want html user files to be put. Please enter the directory name where you want html user files to be put.
The default value should be good in most cases. The default value should be good in most cases.
. .
This directory wil contain every alternc users personnal directories. This directory will contain every AlternC users personal directories.
Template: alternc/alternc_mail Template: alternc/alternc_mail
Type: string Type: string
_Description: The path where alternc's users mails will be put _Description: Path where AlternC's users mails will be located:
Please enter the directory name where you want to put your users maildirs. Please enter the directory name where you want to put your users maildirs.
The default value should be good in most cases. The default value should be good in most cases.
Template: alternc/alternc_logs Template: alternc/alternc_logs
Type: string Type: string
_Description: The path where alternc's logs files will be placed _Description: Path where alternc's logs files will be located:
Please enter the directory name where you want to put your log files. Please enter the directory name where you want to put your log files.
The default value should be good in most cases. The default value should be good in most cases.
@ -221,23 +221,23 @@ _Description: Should AlternC remove mailboxes?
Template: alternc/slaves Template: alternc/slaves
Type: string Type: string
_Description: Slave servers _Description: Slave servers:
This is a space-separated list of servers that are "slaves" to the This is a space-separated list of servers that are "slaves" to the
master server (this server). When writing apache configuration files, master server (this server). When writing Apache configuration files,
the master server will attempt to reload apache on those remote the master server will attempt to reload Apache on those remote
servers. The alternc-slave package correctly configures those machines servers. The alternc-slave package correctly configures those machines
to allow login and reload. to allow login and reload.
Template: alternc/use_local_mysql Template: alternc/use_local_mysql
Type: boolean Type: boolean
_Description: Shall we use locally found MySQL server? _Description: Use locally found MySQL server?
A local MySQL connection was established on the server. A local MySQL connection was established on the server.
Tell us if you want to use it. If not remote MySQL server Please tell if you want to use it. If not remote MySQL server
connection parameters will be needed. connection parameters will be needed.
Template: alternc/use_remote_mysql Template: alternc/use_remote_mysql
Type: boolean Type: boolean
_Description: Shall we use a remote MySQL server? _Description: Use a remote MySQL server?
No local Mysql server was found. No local Mysql server was found.
Please confirm you want to use a remote Mysql Server. Please confirm you want to use a remote Mysql Server.
If not, AlternC cannot be installed. If not, AlternC cannot be installed.
@ -246,10 +246,12 @@ Template: alternc/remote_mysql_error
Type: boolean Type: boolean
_Description: MySQL connection error. Try again? _Description: MySQL connection error. Try again?
Remote connection to the MySQL server failed. Remote connection to the MySQL server failed.
Please confirm that we shall try again. Please confirm to try again.
Template: alternc/use_private_ip Template: alternc/use_private_ip
Type: boolean Type: boolean
_Description: Private IP detected, use it anyway? _Description: Private IP detected, use it anyway?
The IP address you have appears to be private, please confirm you want to use it anyway. The IP address of the machine appears to be private, please confirm that
The server might not be reachable from outside your network. this is an expected situation, since the server might not be reachable
from outside your network.

2
debian/compat vendored
View File

@ -1 +1 @@
7 8

16
debian/control vendored
View File

@ -3,14 +3,14 @@ Section: admin
Priority: optional Priority: optional
Maintainer: Antoine Beaupré <anarcat@koumbit.org> Maintainer: Antoine Beaupré <anarcat@koumbit.org>
Uploaders: Benjamin Sonntag <benjamin@alternc.org> Uploaders: Benjamin Sonntag <benjamin@alternc.org>
Build-Depends-Indep: findutils (>= 4.1.7), gettext (>= 0.10.40-5) Build-Depends-Indep: perl, findutils (>= 4.1.7), gettext (>= 0.10.40-5)
Build-Depends: debhelper (>= 4.0.2), po-debconf Build-Depends: debhelper (>= 8), po-debconf
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Package: alternc Package: alternc
Architecture: all Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0, bash (>= 4) Pre-depends: debconf (>= 0.5.00) | debconf-2.0, bash (>= 4)
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, bind9, wget, rsync, ca-certificates, locales, perl-suid | perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), sudo, adduser, mysql-client, dnsutils, acl, dovecot-common (>=1:1.2.15), dovecot-common(<< 1:2.0), dovecot-imapd (>= 1:1.2.15), dovecot-pop3d (>= 1:1.2.15), vlogger, mailx, incron, cron, ${misc:depends} Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, bind9, wget, rsync, ca-certificates, locales, perl-suid | perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), sudo, adduser, mysql-client, dnsutils, acl, dovecot-common (>=1:1.2.15), dovecot-common(<< 1:2.0), dovecot-imapd (>= 1:1.2.15), dovecot-pop3d (>= 1:1.2.15), vlogger, mailutils | mailx, incron, cron, ${misc:Depends}
Recommends: mysql-server(>= 5.0), ntp, quota Recommends: mysql-server(>= 5.0), ntp, quota
Conflicts: alternc-admintools, alternc-awstats (<< 1.0), alternc-webalizer (<= 0.9.4), alternc-mailman (<< 2.0) Conflicts: alternc-admintools, alternc-awstats (<< 1.0), alternc-webalizer (<= 0.9.4), alternc-mailman (<< 2.0)
Provides: alternc-admintools Provides: alternc-admintools
@ -39,7 +39,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
Package: alternc-slave Package: alternc-slave
Architecture: all Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0 Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, postfix-tls, bind9, wget, rsync, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), adduser, mysql-client, sudo, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d, vlogger, mailx, incron, cron, ${misc:depends} Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, postfix-tls, bind9, wget, rsync, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), adduser, mysql-client, sudo, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d, vlogger, mailutils | mailx, incron, cron, ${misc:Depends}
Recommends: dovecot-managesieved, dovecot-sieve, dovecot-mysql, quota Recommends: dovecot-managesieved, dovecot-sieve, dovecot-mysql, quota
Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4), alternc Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4), alternc
Provides: alternc Provides: alternc
@ -75,7 +75,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
Package: alternc-squirrelmail Package: alternc-squirrelmail
Architecture: all Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0 Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), squirrelmail, squirrelmail-locales, avelsieve, ${misc:depends} Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), squirrelmail, squirrelmail-locales, avelsieve, ${misc:Depends}
Conflicts: alternc (<= 1.0.3), alternc-changepass Conflicts: alternc (<= 1.0.3), alternc-changepass
Provides: alternc-webmail Provides: alternc-webmail
Suggests: Suggests:
@ -106,7 +106,7 @@ Description-fr.UTF-8: Webmail Squirrelmail pour AlternC
Package: alternc-roundcube Package: alternc-roundcube
Architecture: all Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0 Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), roundcube (>= 0.7.1), roundcube-mysql (>= 0.7.1), roundcube-plugins (>= 0.7.1), imagemagick, ${misc:depends} Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), roundcube (>= 0.7.1), roundcube-mysql (>= 0.7.1), roundcube-plugins (>= 0.7.1), imagemagick, ${misc:Depends}
Conflicts: alternc (<< 1.1) Conflicts: alternc (<< 1.1)
Provides: alternc-webmail Provides: alternc-webmail
Suggests: Suggests:
@ -139,7 +139,7 @@ Priority: optional
Section: admin Section: admin
Architecture: all Architecture: all
Pre-depends: debconf Pre-depends: debconf
Depends: alternc (>= 3.0~rc1), awstats (>=6.1-1), php5-cli, ${misc:depends} Depends: alternc (>= 3.0~rc1), awstats (>=6.1-1), php5-cli, ${misc:Depends}
Suggests: apachemerge Suggests: apachemerge
Description: Awstats statistics module for AlternC Description: Awstats statistics module for AlternC
AlternC is a mutualized hosting software manager for Linux. AlternC is a mutualized hosting software manager for Linux.
@ -154,7 +154,7 @@ Description: Awstats statistics module for AlternC
Package: alternc-upnp Package: alternc-upnp
Architecture: all Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0 Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), miniupnpc, php5-cli, ${misc:depends} Depends: debianutils (>= 1.13.1), alternc (>= 3.0~rc1), miniupnpc, php5-cli, ${misc:Depends}
Description: UPnP client for AlternC Description: UPnP client for AlternC
AlternC is a mutualized hosting software manager for Linux. AlternC is a mutualized hosting software manager for Linux.
It allows you to manage your websites, domains, ftp, emails, aliases, It allows you to manage your websites, domains, ftp, emails, aliases,

164
debian/rules vendored
View File

@ -12,162 +12,18 @@ REV=$(shell env LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$
VERSION="${MAJOR}~svn${REV}" VERSION="${MAJOR}~svn${REV}"
export VERSION export VERSION
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) override_dh_install:
CFLAGS += -g #dh install
endif $(MAKE) install-alternc DESTDIR=$(CURDIR)/debian/alternc
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) $(MAKE) install-squirrelmail DESTDIR=$(CURDIR)/debian/alternc-squirrelmail
INSTALL_PROGRAM += -s $(MAKE) install-roundcube DESTDIR=$(CURDIR)/debian/alternc-roundcube
endif $(MAKE) install-upnp DESTDIR=$(CURDIR)/debian/alternc-upnp
$(MAKE) install-awstats DESTDIR=$(CURDIR)/debian/alternc-awstats
$(MAKE) install-slave DESTDIR=$(CURDIR)/debian/alternc-slave
# This has to be exported to make some magic below work. %:
export DH_OPTIONS dh $@
build: build-stamp
build-stamp:
dh_testdir
/usr/bin/msgfmt po/fr/LC_MESSAGES/alternc-admintools.po -o po/fr/LC_MESSAGES/alternc-admintools.mo
find bureau/locales -mindepth 2 -maxdepth 2 -type d -name "LC_MESSAGES" -exec msgfmt "{}/alternc" -o "{}/alternc.mo" \;
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
debconf-updatepo
dh_clean
find bureau/locales -mindepth 3 -maxdepth 3 -type d -name "alternc.mo" -delete
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
# FIXME: if alternc still works with this commented out : remove it :-D
# dh_clean -k
dh_installdirs
# Install
cp -r etc/* debian/alternc/etc
cp -r install/* debian/alternc/usr/share/alternc/install
test -d debian/alternc/usr/share/alternc/panel || mkdir debian/alternc/usr/share/alternc/panel
cp -r bureau/* debian/alternc/usr/share/alternc/panel
(cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc)
# we don't use the full VERSION intepreted but only what's in the changelog
sed -i -e "s/@@REPLACED_DURING_BUILD@@/${MAJOR}/" debian/alternc/usr/share/alternc/panel/class/local.php
echo ${VERSION} > debian/alternc/usr/share/alternc/panel/class/.svn-infos
# Fix permisions
chmod 755 debian/alternc/etc/alternc
# Group and user 1999 reference alterncpanel
chown -R 1999:1999 debian/alternc/usr/share/alternc/panel
chmod -R 644 debian/alternc/usr/share/alternc/panel
chmod -R a+X debian/alternc/usr/share/alternc/panel
chown -R www-data:www-data debian/alternc/var/log/alternc
chmod a+x debian/alternc/usr/share/alternc/install/alternc.install debian/alternc/usr/share/alternc/install/dopo.sh debian/alternc/usr/share/alternc/install/mysql.sh debian/alternc/usr/share/alternc/install/newone.php debian/alternc/usr/share/alternc/install/reset_root.php debian/alternc/usr/share/alternc/install/upgrade_check.sh debian/alternc/usr/share/alternc/install/upgrades/*.php debian/alternc/usr/share/alternc/install/upgrades/*.sh
mkdir -p debian/alternc/var/run/alternc/
chown 1999:1999 debian/alternc/var/run/alternc/
# Ex old alternc-admintools
install tools/top_http_users debian/alternc/usr/bin
install tools/top_mysql_users debian/alternc/usr/bin
install tools/top_ftp_users debian/alternc/usr/bin
install tools/get_domains_by_account debian/alternc/usr/bin
install tools/get_account_by_domain debian/alternc/usr/bin
install tools/alternc_get_path debian/alternc/usr/bin
install src/alternc_reload debian/alternc/usr/bin
install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/
# Remove helpers files from l18n dir
find debian/alternc/usr/share/alternc/panel/locales/ \
-maxdepth 1 -type f -exec rm -f {} \;
# Remove CVS directories
/usr/bin/find debian/alternc -depth -type d -name CVS -exec rm {} -rf \;
/usr/bin/find debian/alternc -depth -type d -name .svn -exec rm {} -rf \;
# cp debian/alternc.lintian debian/alternc/usr/share/lintian/overrides/alternc
# cp debian/alternc-slave.lintian debian/alternc/usr/share/lintian/overrides/alternc-slave
# alternc-squirrelmail:
(cd squirrelmail && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc-squirrelmail)
# alternc-roundcube:
(cd roundcube && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc-roundcube)
# alternc-upnp
(cd upnp && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc-upnp)
# alternc-awstats:
(cd awstats && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc-awstats)
cd ..
# Copy the desk files
cp -r awstats/bureau/* debian/alternc-awstats/usr/share/alternc/panel
find debian/alternc-awstats/usr/share/alternc/panel/ -depth -iname ".svn" -exec rm -rf "{}" \;
rm -f debian/alternc-awstats/usr/share/alternc/panel/locales/Makefile
# Fix permisions
chown -R root:www-data debian/alternc-awstats/usr/share/alternc/panel
chmod -R 644 debian/alternc-awstats/usr/share/alternc/panel
chmod -R a+X debian/alternc-awstats/usr/share/alternc/panel
touch debian/alternc-awstats/var/cache/awstats/.placeholder
chown www-data:www-data debian/alternc-awstats/var/cache/awstats
chmod 755 debian/alternc-awstats/var/cache/awstats
mkdir -p debian/alternc-awstats/var/cache/awstats
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
# dh_installexamples
# dh_installmenu
dh_installdebconf
dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
dh_installman man/*
dh_installcron
# dh_installinfo
dh_install -i --sourcedir=$(CURDIR)/debian/alternc
dh_strip
dh_link
dh_compress
#we handle our own perms
# dh_fixperms
# dh_makeshlibs
dh_installdeb
dh_perl
dh_shlibdeps
dh_gencontrol -- -cdebian/control
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build install binary-common
# (Uncomment this next line if you have such packages.)
# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build install binary-common
# $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
# Any other binary targets build just one binary package at a time.
# binary-%: build install
# make -f debian/rules binary-common DH_OPTIONS=-p$*
# binary: binary-indep binary-arch
# .PHONY: build clean binary-indep binary-arch binary install
binary: binary-common
.PHONY: build clean binary install
build-snapshot: build-snapshot:
@echo "building a package based on the current snapshot (${VERSION})" @echo "building a package based on the current snapshot (${VERSION})"

View File

@ -22,13 +22,6 @@
# Purpose of file: Main install script, launch it anytime ;) # Purpose of file: Main install script, launch it anytime ;)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# This script now assumes it has MySQL connectivity through
# /etc/alternc/my.cnf
# Also launches scripts in /usr/lib/alternc/install.d/
# with an argument telling where you are in alternc.install
# argument will be : startup, templates, apache2, before-reload, end
# Somes check before start operations # Somes check before start operations
if [ `id -u` -ne 0 ]; then if [ `id -u` -ne 0 ]; then
echo "must be launched as root" echo "must be launched as root"
@ -87,7 +80,7 @@ if [ -e /etc/dovecot/dovecot.conf ]; then
CONFIG_FILES="$CONFIG_FILES etc/dovecot/dovecot.conf etc/dovecot/dovecot-sql.conf etc/dovecot/dovecot-dict-quota.conf" CONFIG_FILES="$CONFIG_FILES etc/dovecot/dovecot.conf etc/dovecot/dovecot-sql.conf etc/dovecot/dovecot-dict-quota.conf"
fi fi
INSTALLED_CONFIG_TAR="/var/backups/alternc/etc-installed.tar.gz" INSTALLED_CONFIG_TAR="/var/lib/alternc/backups/etc-installed.tar.gz"
####################################################################### #######################################################################
# Look for modified configuration files # Look for modified configuration files
@ -234,14 +227,14 @@ run-parts --arg=templates /usr/lib/alternc/install.d
###################################################################### ######################################################################
# Backup the Main database # Backup the Main database
DB_BACKUP="/var/backups/alternc/${MYSQL_DATABASE}-db-`date +%Y%m%d-%H:%M:%S`.gz" DB_BACKUP="/var/lib/alternc/backups/${MYSQL_DATABASE}-db-`date +%Y%m%d-%H:%M:%S`.gz"
db_dump="mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords --quote-names --force --quick --add-locks --lock-tables --extended-insert ${MYSQL_DATABASE}" db_dump="mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords --quote-names --force --quick --add-locks --lock-tables --extended-insert ${MYSQL_DATABASE}"
$db_dump | /bin/gzip -c > $DB_BACKUP || echo "backup of the main database failed" $db_dump | /bin/gzip -c > $DB_BACKUP || echo "backup of the main database failed"
####################################################################### #######################################################################
# Backup configuration files # Backup configuration files
# #
BACKUP_FILE="/var/backups/alternc/etc-original-`date +%Y%m%d-%H%M`.tar.gz" BACKUP_FILE="/var/lib/alternc/backups/etc-original-`date +%Y%m%d-%H%M`.tar.gz"
# Only backup what we are really going to replace # Only backup what we are really going to replace
BACKUPS="" BACKUPS=""

View File

@ -1,4 +1,3 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php

View File

@ -1,24 +0,0 @@
.TH ALTERNC.INSTALL 8
.SH NAME
alternc.install \- Installation script for AlternC
.SH DESCRIPTION
AlternC is a hosting control panel that automatically configure your services based on optimal mass-hosting parameters. alternc.install is a script that do this automatic configuration.
.PP
This script is automatically launched at the end of alternc's package installation.
.PP
You can launch it again when you changed anything in the /etc/alternc/templates configuration files.
.SH OPTIONS
This program follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
.TP
.B \-f, \-\-force
Overwrite any file that has been changed since last AlternC install.
.BR

View File

@ -1,21 +0,0 @@
.TH ALTERNC.INSTALL 8
.SH NAME
alternc.install \- script d'installation d'AlternC
.SH DESCRIPTION
AlternC est un panneau de contrôle qui configure automatiquement vos services pour de l'hébergement de masse. alternc.install est le script qui effectue cette configuration automatique.
.PP
Ce script est lancé automatiquement lors de l'installation du package d'AlternC
.PP
Vous pouvez le lancer à nouveau lorsque vous changez quoi que ce soi dans votre configuration d'AlternC dans /etc/alternc/
.SH OPTIONS
.TP
.B \-f, \-\-force
Écrase tout fichier qui aurait été modifié manuellement depuis le dernier lancement de alternc.install
.BR

41
man/alternc.install.pod Normal file
View File

@ -0,0 +1,41 @@
=head1 NAME
alternc.install - Deploys AlternC and associated services configuration files
=head1 SYNOPSIS
alternc.install [B<--force>] |B<--slave>]
=head1 DESCRIPTION
AlternC is a hosting control panel that automatically configure your services based on optimal mass-hosting parameters. alternc.install is a script that do this automatic configuration.
alternc.install use variables from /etc/alternc/local.sh and replace them in files found in /etc/alternc/templates/ then push those interpreted files into /etc. It also backup every file into /var/lib/alternc/backups/ before replacing them.
This script now assumes it has MySQL connectivity through /etc/alternc/my.cnf
It Also launches scripts in /usr/lib/alternc/install.d/ with an argument telling where you are in alternc.install argument will be : startup, templates, apache2, before-reload, end
=head1 OPTIONS
=over 2
=item B<--force>
If any file in /etc has been manually changed (instead of changing its template in /etc/alternc), alternc.install will refuse to overwrite them. use B<--force> to overwrite them anyway.
=item B<--slave>
When you launch alternc.install, any AlternC slave instance defined in /etc/alternc/local.sh has its own alternc.install launch with this parameter. You should not use it yourself unless you know what you are doing
=back
=head1 AUTHOR
Benjamin Sonntag for AlternC Team <team@alternc.org>
=head1 SEE ALSO
Go to http://www.alternc.org/ or join #alternc IRC channel on Freenode for more information on AlternC.
=cut

View File

@ -1,30 +0,0 @@
# ----------------------------------------------------------------------
# AlternC - Web Hosting System
# Copyright (C) 2000-2012 by the AlternC Development Team.
# https://alternc.org/
# ----------------------------------------------------------------------
# LICENSE
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2
# 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.
#
# To read the license please visit http://www.gnu.org/copyleft/gpl.html
# ----------------------------------------------------------------------
# Purpose of file: Makefile des binaires de /usr/lib/alternc
# ----------------------------------------------------------------------
SCRIPTS=sqlbackup.sh quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh update_mails.sh alternc_add_policy_dovecot rebuild_all_webconf.sh courier-dovecot-migrate.pl popimap-log-login.sh mem_add mem_del quota_edit quota_get du.pl update_quota_mail.sh inotify_update_domains.sh functions.sh functions_hosting.sh functions_dns.sh mail_dodelete.php procmail_to_sieve.php lxc_stopexpired.php
BIN=$(DESTDIR)/usr/lib/alternc/
install:
# FIXME: change it to root:root AND do the chgrp alterncpanel AT POSTINST
# Group 1999 references alterncpanel
chown root:1999 $(BIN)
chmod 755 $(BIN)
install -o root -g 1999 -m0755 $(SCRIPTS) $(BIN)

View File

@ -1,38 +0,0 @@
#! /bin/bash
source /usr/lib/alternc/functions.sh
path="$1"
if [ -z "$path" ] ; then
echo "Give a full-path directory to this script, it will tell"
echo "you if you can access it with a website"
echo ""
echo "Missing parameters"
echo "Usage: $0 <directory>"
echo "Example: $0 $ALTERNC_HTML/admin/mydir/"
exit 0
fi
account=`echo "$path" | sed "s#$ALTERNC_HTML/./##" | cut -d '/' -f 1`
relpath=`echo "$path" | sed "s#$ALTERNC_HTML/./[^/]*##"`
request="SELECT
m.login AS user,
CONCAT('http://', s.sub, if(s.sub='','','.'), s.domaine, s.valeur) AS fqdn
FROM
sub_domaines s,
membres m,
domaines_type dt
WHERE
m.login='$account'
AND m.uid = s.compte
AND s.type = dt.name
AND dt.target = 'DIRECTORY'
AND '$relpath' LIKE CONCAT( if(s.valeur='','/',s.valeur) ,'%')
ORDER BY sub ASC
;
"
mysql --defaults-file=/etc/alternc/my.cnf -B -e "$request"

View File

@ -21,12 +21,12 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
install: install:
# Desktop files # Desktop files
install -m 644 m_upnp.php $(DESTDIR)/usr/share/alternc/panel/class/ install -m 644 m_upnp.php $(DESTDIR)/usr/share/alternc/panel/class/
install -m 644 upnp_list.php upnp_change.php $(DESTDIR)/usr/share/alternc/panel/admin/ install -m 644 upnp_list.php upnp_change.php $(DESTDIR)/usr/share/alternc/panel/admin/
install -m 644 adminmenu_upnp.php $(DESTDIR)/usr/share/alternc/panel/admin/ install -m 644 adminmenu_upnp.php $(DESTDIR)/usr/share/alternc/panel/admin/
# Cron # Cron
install -m 755 update_upnp.sh $(DESTDIR)/usr/lib/alternc/ install -m 755 update_upnp.sh $(DESTDIR)/usr/lib/alternc/
# Install script # Install script
install -m 644 upnp.sql $(DESTDIR)/usr/share/alternc/install/ install -m 644 upnp.sql $(DESTDIR)/usr/share/alternc/install/
install -m 755 upnp-install $(DESTDIR)/usr/lib/alternc/install.d install -m 755 upnp-install $(DESTDIR)/usr/lib/alternc/install.d

View File

@ -0,0 +1,2 @@
#!/bin/sh