]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/configroot
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[people/pmueller/ipfire-2.x.git] / lfs / configroot
1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
3 # #
4 # IPCop is free software; you can redistribute it and/or modify #
5 # it under the terms of the GNU General Public License as published by #
6 # the Free Software Foundation; either version 2 of the License, or #
7 # (at your option) any later version. #
8 # #
9 # IPCop is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU General Public License #
15 # along with IPCop; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
17 # #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20 # #
21 # Modifications by: #
22 # ??-12-2003 Mark Wormgoor < mark@wormgoor.com> #
23 # - Modified Makefile for IPCop build #
24 # #
25 # $Id: configroot,v 1.9.2.23 2006/02/04 11:04:36 franck78 Exp $
26 # #
27 ###############################################################################
28
29 ###############################################################################
30 # Definitions
31 ###############################################################################
32
33 include Config
34
35 THISAPP = configroot
36 DIR_APP = $(DIR_SRC)/$(THISAPP)
37 TARGET = $(DIR_INFO)/$(THISAPP)
38
39 ###############################################################################
40 # Top-level Rules
41 ###############################################################################
42
43 install : $(TARGET)
44
45 check :
46
47 download :
48
49 md5 :
50
51 ###############################################################################
52 # Installation Details
53 ###############################################################################
54
55 $(TARGET) :
56 @$(PREBUILD)
57
58 # Create all directories
59 for i in addon-lang alcatelusb auth backup backup/sets ca certs cnx_pci crls ddns dhcp dhcpc dmzholes \
60 eagle-usb eciadsl ethernet isdn key langs logging main modem optionsfw patches portfw \
61 ppp private proxy red remote shaping snort time vpn wireless xtaccess ; do \
62 mkdir -p $(CONFIG_ROOT)/$$i; \
63 done
64
65 # Touch empty files
66 for i in auth/users backup/include.user backup/exclude.user \
67 certs/index.txt ddns/config ddns/noipsettings ddns/settings ddns/ipcache dhcp/settings \
68 dhcp/fixleases dhcp/advoptions dmzholes/config ethernet/aliases ethernet/settings \
69 isdn/settings main/hosts main/settings optionsfw/settings patches/available patches/installed \
70 portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
71 ppp/settings-5 ppp/settings proxy/settings remote/settings shaping/settings \
72 shaping/config snort/settings vpn/config vpn/settings vpn/ipsec.conf \
73 vpn/ipsec.secrets vpn/caconfig wireless/config wireless/settings; do \
74 touch $(CONFIG_ROOT)/$$i; \
75 done
76
77 # Copy initial configfiles
78 cp $(DIR_SRC)/config/cfgroot/header.pl $(CONFIG_ROOT)/
79 cp $(DIR_SRC)/config/cfgroot/general-functions.pl $(CONFIG_ROOT)/
80 cp $(DIR_SRC)/config/cfgroot/lang.pl $(CONFIG_ROOT)/
81 cp $(DIR_SRC)/config/cfgroot/countries.pl $(CONFIG_ROOT)/
82 cp $(DIR_SRC)/config/cfgroot/backup-exclude $(CONFIG_ROOT)/backup/exclude.system
83 cp $(DIR_SRC)/config/cfgroot/backup-include $(CONFIG_ROOT)/backup/include.system
84 cp $(DIR_SRC)/config/cfgroot/backup-exclude.hardware $(CONFIG_ROOT)/backup/exclude.hardware
85 cp $(DIR_SRC)/config/cfgroot/advoptions-list $(CONFIG_ROOT)/dhcp/advoptions-list
86 cp $(DIR_SRC)/config/cfgroot/modem-defaults $(CONFIG_ROOT)/modem/defaults
87 cp $(DIR_SRC)/config/cfgroot/modem-settings $(CONFIG_ROOT)/modem/settings
88 cp $(DIR_SRC)/config/cfgroot/proxy-acl $(CONFIG_ROOT)/proxy/acl-1.4
89 cp $(DIR_SRC)/config/cfgroot/xtaccess-config $(CONFIG_ROOT)/xtaccess/config
90 cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
91 cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
92 cp $(DIR_SRC)/config/cfgroot/ipcop.gpg $(CONFIG_ROOT)/key/
93 cp $(DIR_SRC)/langs/list $(CONFIG_ROOT)/langs/
94
95 # Oneliner configfiles
96 echo "ENABLED=off" > $(CONFIG_ROOT)/vpn/settings
97 echo "VPN_DELAYED_START=0" >>$(CONFIG_ROOT)/vpn/settings
98 echo "01" > $(CONFIG_ROOT)/certs/serial
99 echo "nameserver 1.2.3.4" > $(CONFIG_ROOT)/ppp/fake-resolv.conf
100 echo "DISABLEPING=NO" > $(CONFIG_ROOT)/optionsfw/settings
101
102 # Symbolic links
103 ln -sf /etc/rc.d/rc.updatered $(CONFIG_ROOT)/dhcpc/dhcpcd.exe
104
105 # Modify variables in header.pl
106 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
107 -e "s+VERSION+$(VERSION)+g" \
108 $(CONFIG_ROOT)/header.pl
109
110 # Modify variables in general-functions.pl
111 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
112 -e "s+VERSION+$(VERSION)+g" \
113 $(CONFIG_ROOT)/general-functions.pl
114
115 # Modify CONFIG_ROOT in lang.pl
116 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
117 $(CONFIG_ROOT)/lang.pl
118
119 # Language files
120 for i in $(DIR_SRC)/langs/*/cgi-bin/*.pl ; do \
121 cp $$i $(CONFIG_ROOT)/langs/; \
122 done
123
124 # Configroot permissions
125 chown -R nobody:nobody $(CONFIG_ROOT)
126 chown root:root $(CONFIG_ROOT)
127 for i in backup/ header.pl general-functions.pl lang.pl addon-lang/ langs/ red/ ; do \
128 chown -R root:root $(CONFIG_ROOT)/$$i; \
129 done
130 chown nobody:nobody $(CONFIG_ROOT)/backup/sets
131 chown root:nobody $(CONFIG_ROOT)/dhcpc
132
133 @$(POSTBUILD)