2013-04-23 15:11:00 +00:00
#!/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)
2018-04-15 14:08:37 +00:00
VERSION = $( MAJOR)
2013-04-23 15:11:00 +00:00
export VERSION
build :
# gettext are built at runtime, to be able to MERGE them from CORE + MODULES before msgfmt
install :
2017-10-07 13:12:18 +00:00
#install-alternc install-squirrelmail install-roundcube install-awstats
2013-04-23 15:11:00 +00:00
# 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
2018-06-21 14:52:02 +00:00
cp -r src/* $( DESTDIR) /usr/lib/alternc/
2013-04-23 15:11:00 +00:00
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
2013-10-18 08:31:06 +00:00
cp -r etc/incron.d $( DESTDIR) /etc
2014-03-28 10:39:22 +00:00
install -o root -g root -m 440 etc/sudoers.d/alternc $( DESTDIR) /etc/sudoers.d
2013-10-18 08:31:06 +00:00
chmod 755 $( DESTDIR) /etc/alternc etc/incron.d
2013-04-23 15:11:00 +00:00
# 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
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
2018-06-24 17:40:22 +00:00
sed -i -e " s/@@REPLACED_DURING_BUILD@@/ ${ MAJOR } / " $( DESTDIR) /usr/share/alternc/panel/class/local.php $( DESTDIR) /usr/share/alternc/install/alternc.install
2018-06-24 17:44:38 +00:00
help2man -n "Hosting control panel software" --no-discard-stderr --section 8 $( DESTDIR) /usr/share/alternc/install/alternc.install -o $( DESTDIR) /usr/share/man/man8/alternc.install.8
2013-04-23 15:11:00 +00:00
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/
2018-06-21 14:52:02 +00:00
#SSL functions
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_panel-ssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_vhost-mixssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_roundcube-ssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_squirrelmail-ssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_php52-ssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_php52-mixssl.sh
ln -s hosting_vhost-ssl.sh $( DESTDIR) /etc/alternc/functions_hosting/hosting_url-ssl.sh
2013-04-23 15:11:00 +00:00
install-slave : install -common
# Man pages
2014-08-01 09:59:56 +00:00
pod2man --center "" --date "" --release "AlternC" --section= 8 man/alternc.install.pod >$( DESTDIR) /usr/share/man/man8/alternc.install.8
2013-04-23 15:11:00 +00:00
# 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)
2015-05-07 15:43:54 +00:00
install-api :
make -C api install DESTDIR = $( DESTDIR)