fb5d045e3b3317d66086273e70c5f7b3a65ee2de
[people/teissler/ipfire-2.x.git] / lfs / cdrom
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 ###############################################################################
22
23 ###############################################################################
24 # Definitions
25 ###############################################################################
26
27 include Config
28
29 VER = ipfire
30
31 THISAPP = cdrom
32 DL_FILE = rawrite.exe
33 DL_FROM = $(URL_IPFIRE)
34 TARGET = $(DIR_INFO)/$(THISAPP)
35
36 ###############################################################################
37 # Top-level Rules
38 ###############################################################################
39
40 objects = $(DL_FILE) \
41 rawwritewin-0.7.zip \
42 install-en-1.4.0.pdf.zip \
43 quickstart-en.pdf.zip
44
45 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
46 rawwritewin-0.7.zip = http://uranus.it.swin.edu.au/~jn/linux/rawwritewin-0.7.zip
47 install-en-1.4.0.pdf.zip = $(URL_SFNET)/ipcop/install-en-1.4.0.pdf.zip
48 quickstart-en.pdf.zip = http://www.ipcop.org/1.4.0/en/quickstart/quickstart-en.pdf.zip
49
50 $(DL_FILE)_MD5 = 7dac6ea496014d32dbce6c50feb254ca
51 rawwritewin-0.7.zip_MD5 = 0130b497c8c3bc7d136a4236b0d9fbf6
52 install-en-1.4.0.pdf.zip_MD5 = 07e0b5131f1434010d8a00571f9acd81
53 quickstart-en.pdf.zip_MD5 = ca77ef5f1efca6bc519cc42acfd69aa4
54
55 install : $(TARGET)
56
57 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
58
59 download :$(patsubst %,$(DIR_DL)/%,$(objects))
60
61 md5 : $(subst %,%_MD5,$(objects))
62
63 ###############################################################################
64 # Downloading, checking, md5sum
65 ###############################################################################
66
67 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
68 @$(CHECK)
69
70 $(patsubst %,$(DIR_DL)/%,$(objects)) :
71 @$(LOAD)
72
73 $(subst %,%_MD5,$(objects)) :
74 @$(MD5)
75
76 ###############################################################################
77 # Installation Details
78 ###############################################################################
79
80 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
81 rm -rf /install/cdrom /tmp/*
82
83 # Compress root filesystem
84 # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
85 mkdir -p /install/cdrom/{doc,dosutils,images}
86 find $(DIR_SRC)/config/rootfiles/common -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
87 find $(DIR_SRC)/config/rootfiles/ver_$(IPFVER) -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
88 tar -c -C / --files-from=/tmp/ROOTFILES \
89 -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
90 --exclude='proc/*' --exclude='tmp/ROOTFILES'
91 rm -f /tmp/ROOTFILES
92 tar -x -C /tmp -f /$(SNAME).tar
93 rm -f /$(SNAME).tar
94 cd /tmp && tar jcf /install/cdrom/$(SNAME)-$(VERSION).tbz2 * && rm -rf *
95
96 # Other files
97 sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > /install/cdrom/README.txt
98 cp $(DIR_SRC)/doc/COPYING /install/cdrom/
99 cp /install/images/*.img /install/cdrom/images
100 unzip $(DIR_DL)/install-en-1.4.0.pdf.zip -d /install/cdrom/doc
101 unzip $(DIR_DL)/quickstart-en.pdf.zip -d /install/cdrom/doc
102 cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
103 cp $(DIR_DL)/rawrite.exe /install/cdrom/dosutils
104 unzip -j -L $(DIR_DL)/rawwritewin*.zip -x "*.txt" -d /install/cdrom/dosutils
105
106 # Make the ISO
107 mkdir -p /install/cdrom/boot/isolinux; \
108 dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog; \
109 cp /install/images/cdinitrd.gz /install/cdrom/boot/isolinux/instroot.gz; \
110 cp /boot/vmlinuz-$(KVER) /install/cdrom/boot/isolinux/vmlinuz; \
111 cp $(DIR_SRC)/config/kernel/syslinux.cfg /install/cdrom/boot/isolinux/isolinux.cfg; \
112 cp $(DIR_SRC)/config/kernel/install-message /install/cdrom/boot/isolinux/message; \
113 cp /usr/lib/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin; \
114 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
115 -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
116 -c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-$(IPFVER).iso