Alternc  latest
Alternc logiel libre pour l'hébergement
Makefile
Go to the documentation of this file.
1 #!/usr/bin/make -f
2 # ----------------------------------------------------------------------
3 # AlternC - Web Hosting System
4 # Copyright (C) 2000-2013 by the AlternC Development Team.
5 # https://alternc.org/
6 # ----------------------------------------------------------------------
7 # LICENSE
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License (GPL)
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # To read the license please visit http://www.gnu.org/copyleft/gpl.html
20 # ----------------------------------------------------------------------
21 # Purpose of file: Global Makefile
22 # ----------------------------------------------------------------------
23 MAJOR=$(shell sed -ne 's/^[^(]*(\‍([^)]*\‍)).*/\1/;1p' debian/changelog)
24 VERSION=$(MAJOR)
25 export VERSION
26 
27 build:
28 # gettext are built at runtime, to be able to MERGE them from CORE + MODULES before msgfmt
29 
30 install:
31 #install-alternc install-squirrelmail install-roundcube install-awstats
32 
33 # install AlternC files common between ALTERNC and ALTERNC-SLAVE
34 install-common:
35 # Shell Scripts
36  test -d $(DESTDIR)/usr/lib/alternc || mkdir -p $(DESTDIR)/usr/lib/alternc
37  cp -r src/* $(DESTDIR)/usr/lib/alternc/
38  chown root:root $(DESTDIR)/usr/lib/alternc/*
39  chmod 755 $(DESTDIR)/usr/lib/alternc/*
40 
41 # Configuration Files
42  test -d $(DESTDIR)/etc || mkdir -p $(DESTDIR)/etc
43  cp -r etc/alternc $(DESTDIR)/etc
44  cp -r etc/incron.d $(DESTDIR)/etc
45  install -o root -g root -m 440 etc/sudoers.d/alternc $(DESTDIR)/etc/sudoers.d
46  chmod 755 $(DESTDIR)/etc/alternc etc/incron.d
47 
48 # Installer and upgrade scripts
49  test -d $(DESTDIR)/usr/share/alternc/install || mkdir -p $(DESTDIR)/usr/share/alternc/install
50  cp -r install/* $(DESTDIR)/usr/share/alternc/install
51  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 $(DESTDIR)/usr/share/alternc/install/variables.php
52 
53 
54 # install AlternC itself:
55 install-alternc: install-common
56 # Web Panel
57  test -d $(DESTDIR)/usr/share/alternc/panel || mkdir $(DESTDIR)/usr/share/alternc/panel
58  cp -r bureau/* $(DESTDIR)/usr/share/alternc/panel
59  sed -i -e "s/@@REPLACED_DURING_BUILD@@/${MAJOR}/" $(DESTDIR)/usr/share/alternc/panel/class/local.php $(DESTDIR)/usr/share/alternc/install/alternc.install
60  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
61  chown -R root:root $(DESTDIR)/usr/share/alternc/panel
62  chmod -R 644 $(DESTDIR)/usr/share/alternc/panel
63  chmod -R a+X $(DESTDIR)/usr/share/alternc/panel
64 # Logs
65  test -d $(DESTDIR)/var/log/alternc || mkdir $(DESTDIR)/var/log/alternc
66  chown -R root:root $(DESTDIR)/var/log/alternc
67 
68 # Ex old alternc-admintools
69  install -o root -g root -m 755 tools/* $(DESTDIR)/usr/bin
70 # Man pages
71  install -o root -g root -m 644 man/*.8 $(DESTDIR)/usr/share/man/man8/
72 
73 #SSL functions
74  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_panel-ssl.sh
75  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_vhost-mixssl.sh
76  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_roundcube-ssl.sh
77  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_squirrelmail-ssl.sh
78  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_php52-ssl.sh
79  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_php52-mixssl.sh
80  ln -s hosting_vhost-ssl.sh $(DESTDIR)/etc/alternc/functions_hosting/hosting_url-ssl.sh
81 
82 install-slave: install-common
83 # Man pages
84  pod2man --center "" --date "" --release "AlternC" --section=8 man/alternc.install.pod >$(DESTDIR)/usr/share/man/man8/alternc.install.8
85 
86 
87 # Then its modules :
88 install-awstats:
89  make -C awstats install DESTDIR=$(DESTDIR)
90 
91 install-roundcube:
92  make -C roundcube install DESTDIR=$(DESTDIR)
93 
94 install-squirrelmail:
95  make -C squirrelmail install DESTDIR=$(DESTDIR)
96 
97 install-api:
98  make -C api install DESTDIR=$(DESTDIR)
99