diff --git a/.gitattributes b/.gitattributes index f24dcf29..cb431d73 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ /CODING_CONVENTION.php -text /COPYING -text /DEBIAN_COMPLIANCE -text +/Makefile -text /README -text awstats/Makefile -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/messages.po -text debian/.svnignore -text -debian/README.Debian -text debian/alternc-awstats.cron.d -text debian/alternc-awstats.dirs -text debian/alternc-awstats.lintian-override -text @@ -420,7 +420,6 @@ debian/alternc-roundcube.dirs -text debian/alternc-roundcube.postinst -text debian/alternc-slave.config -text debian/alternc-slave.dirs -text -debian/alternc-slave.install -text debian/alternc-slave.links -text debian/alternc-slave.lintian -text debian/alternc-slave.logrotate -text @@ -440,7 +439,6 @@ debian/alternc.logrotate -text debian/alternc.postinst -text debian/alternc.postrm -text debian/alternc.preinst -text -debian/alternc.prerm -text debian/alternc.templates -text debian/changelog -text debian/compat -text @@ -538,8 +536,7 @@ lang/en_US.po -text lang/nl_NL.po -text man/alternc-admintools.8 -text man/alternc-admintools.fr.8 -text -man/alternc.install.8 -text -man/alternc.install.fr.8 -text +man/alternc.install.pod -text man/get_account_by_domain.8 -text man/get_domains_by_account.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/avelsieve-config.php -text squirrelmail/unavelsieve -text -src/Makefile -text src/alternc-check -text src/alternc-dboptimize -text src/alternc-passwd -text @@ -623,7 +619,6 @@ tests/make_mail_dataset.sh -text tests/mechdump.pm -text tests/test_demo.pl -text tests/whois_test.php -text -tools/alternc_get_path -text tools/get_account_by_domain -text tools/get_domains_by_account -text tools/top_ftp_users -text diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..9ab40adc --- /dev/null +++ b/Makefile @@ -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) + diff --git a/debian/README.Debian b/debian/README.Debian deleted file mode 100644 index a57ae913..00000000 --- a/debian/README.Debian +++ /dev/null @@ -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 , Tue, 09 Sep 2002 19:31:26 +0200 - - diff --git a/debian/alternc-awstats.preinst b/debian/alternc-awstats.preinst index 63fbff78..7a33fb70 100755 --- a/debian/alternc-awstats.preinst +++ b/debian/alternc-awstats.preinst @@ -1,6 +1,6 @@ #!/bin/sh -e -# Check that AlternC is properly installed/configured +# Check that AlternC is properly installed AND configured if [ -f /etc/alternc/local.sh ] then exit 0 @@ -12,7 +12,6 @@ else db_fset alternc-awstats/errorinstall seen false db_input medium alternc-awstats/errorinstall db_go - # il FAUT qu'AlternC soit proprement configuré pour installer awstats exit 1 fi diff --git a/debian/alternc-slave.dirs b/debian/alternc-slave.dirs index ee204cac..e2d32540 100644 --- a/debian/alternc-slave.dirs +++ b/debian/alternc-slave.dirs @@ -9,7 +9,7 @@ usr/bin usr/lib/alternc usr/sbin usr/share/alternc/install +usr/share/man/man8/ usr/share/locale/fr/LC_MESSAGES -var/backups/alternc +var/lib/alternc/backups var/log/alternc -var/run/alternc diff --git a/debian/alternc-slave.install b/debian/alternc-slave.install deleted file mode 100644 index 3382be94..00000000 --- a/debian/alternc-slave.install +++ /dev/null @@ -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/* diff --git a/debian/alternc-slave.postrm b/debian/alternc-slave.postrm index 6a5d52e1..450504c8 100644 --- a/debian/alternc-slave.postrm +++ b/debian/alternc-slave.postrm @@ -16,13 +16,13 @@ set -e case "$1" in purge) 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_go db_get alternc/postrm_remove_datafiles || true if [ "$RET" = "true" ]; then - rm -rf /var/backups/alternc + rm -rf /var/lib/alternc/backups/ fi rm -f /etc/apache/conf.d/override_php.conf /etc/apache/conf.d/alternc-ssl.conf /etc/apache/conf.d/alternc.conf diff --git a/debian/alternc-slave.templates b/debian/alternc-slave.templates index 152f28c8..43be4a2f 100644 --- a/debian/alternc-slave.templates +++ b/debian/alternc-slave.templates @@ -127,7 +127,7 @@ Template:alternc-slave/monitor_ip Type: string _Description: The monitoring server: 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 Type: boolean diff --git a/debian/alternc.cron.d b/debian/alternc.cron.d index 1cd1a666..3731e344 100644 --- a/debian/alternc.cron.d +++ b/debian/alternc.cron.d @@ -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 0 4 * * * alterncpanel /usr/lib/alternc/compress_logs.sh diff --git a/debian/alternc.dirs b/debian/alternc.dirs index 7edbc424..05c32bf4 100644 --- a/debian/alternc.dirs +++ b/debian/alternc.dirs @@ -17,11 +17,11 @@ usr/lib/alternc/install.d usr/lib/alternc/reload.d usr/lib/alternc/safe_mode_exec_dir usr/sbin +usr/share/man/man8/ usr/share/alternc/install usr/share/locale/fr/LC_MESSAGES -var/backups/alternc -/var/lib/alternc/apache-vhost -/var/lib/alternc/bind -/var/lib/alternc/bind/zones +var/lib/alternc/backups +var/lib/alternc/apache-vhost +var/lib/alternc/bind +var/lib/alternc/bind/zones var/log/alternc -var/run/alternc diff --git a/debian/alternc.postrm b/debian/alternc.postrm index f17b6cc1..7d4b0212 100644 --- a/debian/alternc.postrm +++ b/debian/alternc.postrm @@ -16,7 +16,7 @@ set -e case "$1" in purge) 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 # FIXME : remove following commented lines if we are sure @@ -38,7 +38,7 @@ case "$1" in #db_go #db_get alternc/postrm_remove_datafiles || true #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 # Purge bind zones @@ -63,7 +63,7 @@ case "$1" in # Restore orignals conf files which have been replaced by Alternc # 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 # Reload services which use these files diff --git a/debian/alternc.prerm b/debian/alternc.prerm deleted file mode 100644 index ca57dd53..00000000 --- a/debian/alternc.prerm +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Debian alternc prerm -# Benjamin Sonntag - -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# diff --git a/debian/alternc.templates b/debian/alternc.templates index 7bfcb693..35f8b9a0 100644 --- a/debian/alternc.templates +++ b/debian/alternc.templates @@ -52,21 +52,21 @@ _Description: Name of the secondary domain name server: Template: alternc/alternc_html 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. 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 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. The default value should be good in most cases. Template: alternc/alternc_logs 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. The default value should be good in most cases. @@ -221,23 +221,23 @@ _Description: Should AlternC remove mailboxes? Template: alternc/slaves Type: string -_Description: Slave servers +_Description: Slave servers: This is a space-separated list of servers that are "slaves" to the - master server (this server). When writing apache configuration files, - the master server will attempt to reload apache on those remote + master server (this server). When writing Apache configuration files, + the master server will attempt to reload Apache on those remote servers. The alternc-slave package correctly configures those machines to allow login and reload. Template: alternc/use_local_mysql 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. - 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. Template: alternc/use_remote_mysql Type: boolean -_Description: Shall we use a remote MySQL server? +_Description: Use a remote MySQL server? No local Mysql server was found. Please confirm you want to use a remote Mysql Server. If not, AlternC cannot be installed. @@ -246,10 +246,12 @@ Template: alternc/remote_mysql_error Type: boolean _Description: MySQL connection error. Try again? Remote connection to the MySQL server failed. - Please confirm that we shall try again. + Please confirm to try again. Template: alternc/use_private_ip Type: boolean _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 server might not be reachable from outside your network. + The IP address of the machine appears to be private, please confirm that + this is an expected situation, since the server might not be reachable + from outside your network. + diff --git a/debian/compat b/debian/compat index 7f8f011e..45a4fb75 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +8 diff --git a/debian/control b/debian/control index 3300f6d5..ade160b9 100644 --- a/debian/control +++ b/debian/control @@ -3,14 +3,14 @@ Section: admin Priority: optional Maintainer: Antoine Beaupré Uploaders: Benjamin Sonntag -Build-Depends-Indep: findutils (>= 4.1.7), gettext (>= 0.10.40-5) -Build-Depends: debhelper (>= 4.0.2), po-debconf +Build-Depends-Indep: perl, findutils (>= 4.1.7), gettext (>= 0.10.40-5) +Build-Depends: debhelper (>= 8), po-debconf Standards-Version: 3.9.4 Package: alternc Architecture: all 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 Conflicts: alternc-admintools, alternc-awstats (<< 1.0), alternc-webalizer (<= 0.9.4), alternc-mailman (<< 2.0) Provides: alternc-admintools @@ -39,7 +39,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian Package: alternc-slave Architecture: all 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 Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4), alternc Provides: alternc @@ -75,7 +75,7 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian Package: alternc-squirrelmail Architecture: all 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 Provides: alternc-webmail Suggests: @@ -106,7 +106,7 @@ Description-fr.UTF-8: Webmail Squirrelmail pour AlternC Package: alternc-roundcube Architecture: all 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) Provides: alternc-webmail Suggests: @@ -139,7 +139,7 @@ Priority: optional Section: admin Architecture: all 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 Description: Awstats statistics module for AlternC AlternC is a mutualized hosting software manager for Linux. @@ -154,7 +154,7 @@ Description: Awstats statistics module for AlternC Package: alternc-upnp Architecture: all 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 AlternC is a mutualized hosting software manager for Linux. It allows you to manage your websites, domains, ftp, emails, aliases, diff --git a/debian/rules b/debian/rules index ecaf7fdf..1ca59c45 100755 --- a/debian/rules +++ b/debian/rules @@ -12,162 +12,18 @@ REV=$(shell env LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$ VERSION="${MAJOR}~svn${REV}" export VERSION -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif +override_dh_install: +#dh install + $(MAKE) install-alternc DESTDIR=$(CURDIR)/debian/alternc + $(MAKE) install-squirrelmail DESTDIR=$(CURDIR)/debian/alternc-squirrelmail + $(MAKE) install-roundcube DESTDIR=$(CURDIR)/debian/alternc-roundcube + $(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: @echo "building a package based on the current snapshot (${VERSION})" diff --git a/install/alternc.install b/install/alternc.install index 564754ce..f6e0f4ca 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -22,13 +22,6 @@ # 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 if [ `id -u` -ne 0 ]; then 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" 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 @@ -234,14 +227,14 @@ run-parts --arg=templates /usr/lib/alternc/install.d ###################################################################### # 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 | /bin/gzip -c > $DB_BACKUP || echo "backup of the main database failed" ####################################################################### # 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 BACKUPS="" diff --git a/install/upgrades/3.0.0~3.php b/install/upgrades/3.0.0~3.php index 709d9782..2c6b9ec1 100644 --- a/install/upgrades/3.0.0~3.php +++ b/install/upgrades/3.0.0~3.php @@ -1,4 +1,3 @@ - #!/usr/bin/php ] |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 + +=head1 SEE ALSO + +Go to http://www.alternc.org/ or join #alternc IRC channel on Freenode for more information on AlternC. + +=cut diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 60555b76..00000000 --- a/src/Makefile +++ /dev/null @@ -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) diff --git a/tools/alternc_get_path b/tools/alternc_get_path deleted file mode 100644 index e25ede4e..00000000 --- a/tools/alternc_get_path +++ /dev/null @@ -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 " - 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" - diff --git a/upnp/Makefile b/upnp/Makefile index 5b6601a2..79fc263e 100644 --- a/upnp/Makefile +++ b/upnp/Makefile @@ -21,12 +21,12 @@ # ---------------------------------------------------------------------- install: - # Desktop files +# Desktop files 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 adminmenu_upnp.php $(DESTDIR)/usr/share/alternc/panel/admin/ - # Cron +# Cron 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 755 upnp-install $(DESTDIR)/usr/lib/alternc/install.d diff --git a/upnp/upnp-install b/upnp/upnp-install index e69de29b..13f47935 100644 --- a/upnp/upnp-install +++ b/upnp/upnp-install @@ -0,0 +1,2 @@ +#!/bin/sh +