summaryrefslogtreecommitdiffstats
path: root/move/Makefile
blob: 95fd84a9be72809d14f5af66f02a461aa080bb15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

DEST_LIVETREE = /tmp/live_tree
DEST_STAGE2 = $(DEST_LIVETREE)/usr/lib/stage2

ISO = /BIG/mdkmove.iso

DATA_FILES = devices symlinks directories-to-create etcfiles all-etcfiles keyfiles \
             BOOT-800-MOVE.jpg BOOT-1024-MOVE.jpg BOOT-1280-MOVE.jpg BOOT-1600-MOVE.jpg

PROGRAM_FILES = etc-monitorer.pl tree/startkde_move tree/wait4x tree/netscape tree/alsa_default.pl
LANG_FILES = $(shell perl -ne 'print $$1 if /ALLOWED_LANGS = qw\((.*)\)/' move.pm)

STAGE1 = ../mdk-stage1
INSTALL = ../perl-install

INSTALL_FILES = install2.pm install_steps.pm install_any.pm install_interactive.pm install_steps_gtk.pm install_steps_interactive.pm install_messages.pm install_gtk.pm

ARCH := $(shell arch | egrep "(x86_64|sparc64|s390x)")
ifneq ("x$(ARCH)", "x")
LIB_NAME = lib64
else
LIB_NAME = lib
endif

.PHONY: iso 

all: install

build: stage1 xwait runlevel_set
	sudo ./collect-directories-to-create.pl $(DEST_LIVETREE) > data/directories-to-create
	sudo find $(DEST_LIVETREE)/etc -type f | perl -pe 's|$(DEST_LIVETREE)||' > data/all-etcfiles
	$(MAKE) -C ../perl-install mo_files

stage1:
	cd $(STAGE1) && ADDITIONAL_DEFS="-DMANDRAKE_MOVE" MOVE=1 make init stage1-full init-move
	cd .. ; ./make_boot_img move

install:
	 #- todo: make_boot_img alike to create boot volume from ../mdk-stage1/stage1-cdrom (isolinux mandatory since stock kernel is so big)
	sudo cp -f $(STAGE1)/init-move $(DEST_LIVETREE)/sbin/init

	$(MAKE) -C ../perl-install/share/po install NAME=libDrakX DATADIR=$(DEST_LIVETREE)/usr/share

	sudo cp -f xwait $(DEST_LIVETREE)/usr/bin
	sudo cp -f runlevel_set $(DEST_LIVETREE)/usr/bin
	sudo cp -f runstage2 $(DEST_LIVETREE)/usr/bin/runstage2.pl
	sudo rm -rf $(DEST_STAGE2)
	sudo mkdir -p $(DEST_STAGE2)
	sudo sh -c 'echo 1 > $(DEST_STAGE2)/help.pm'
	sudo cp -f *.pm $(DEST_STAGE2)
	sudo cp -f $(addprefix $(INSTALL)/, $(INSTALL_FILES)) $(DEST_STAGE2)
	sudo cp -f $(PROGRAM_FILES) $(DEST_LIVETREE)/usr/bin
	sudo rm -f $(DEST_LIVETREE)/usr/bin/{halt,reboot}  #- symlinks to consolehelper
	sudo cp -f tree/{halt,reboot} $(DEST_LIVETREE)/usr/bin
	sudo cp -f tree/X_move $(DEST_LIVETREE)/usr/X11R6/bin
	sudo cp -f tree/sound.initscript $(DEST_LIVETREE)/etc/init.d/sound

	sudo rm -rf $(DEST_LIVETREE)/usr/share/langs
	sudo mkdir -p $(DEST_LIVETREE)/usr/share/langs
	sudo cp -f $(patsubst %, $(INSTALL)/pixmaps/langs/lang-%.png, $(LANG_FILES)) $(DEST_LIVETREE)/usr/share/langs

	 #- overwrite /usr/lib/libDrakX files of the live tree with those in CVS
	(cd $(DEST_LIVETREE)/usr/lib/libDrakX ; find -name "*.pm") | egrep -v 'ctxhelp|drakfirsttime' | (cd $(INSTALL) ; sudo cpio -pLumd $(DEST_LIVETREE)/usr/lib/libDrakX/)

	 #- overwrite stuff.so of drakxtools because it doesn't contain C_DRAKX stuff
	sudo cp -f ../perl-install/c/blib/arch/auto/stuff/stuff.so $(DEST_LIVETREE)/usr/lib/libDrakX/auto/c/stuff

	 #- overwrite MDK-Common
	sudo cp -f ../../soft/perl-MDK-Common/MDK/Common/*.pm $(DEST_LIVETREE)/usr/$(LIB_NAME)/perl5/vendor_perl/*/MDK/Common

	 #- duplicated :(
	sudo perl -pi -e 's/#[-+].*//; $$_ = "\n" if (/^=(head|begin)/ .. /^=cut/) || /use (diagnostics|vars|strict)/' $(DEST_STAGE2)/*.pm `find $(DEST_LIVETREE)/usr/lib/libDrakX -name "*.pm"`

	sudo mkdir -p $(DEST_LIVETREE)/move
	sudo cp -f $(addprefix data/, $(DATA_FILES)) $(DEST_LIVETREE)/move

	sudo install -m 440 tree/sudoers $(DEST_LIVETREE)/etc
	sudo install -m 644 tree/mdk_move_boot_loop.desktop $(DEST_LIVETREE)/usr/share/autostart
	sudo install tree/{mdk_move_loop,mdk_totem,mdk_behind_totem} $(DEST_LIVETREE)/usr/bin
	sudo install -m 644 -D tree/mdk_totem.desktop $(DEST_LIVETREE)/etc/skel/Desktop/mdk_totem.desktop
	sudo install -m 644 tree/{kdedrc,konsolerc} $(DEST_LIVETREE)/usr/share/config
	sudo install -m 644 img/Mandrake.png $(DEST_LIVETREE)/usr/share/mdk/backgrounds
	sudo install -m 644 img/FE* $(DEST_LIVETREE)/usr/share/wallpapers

	grep ChangeLog $(INSTALL)/CVS/Entries > /tmp/version
	sudo cp -f /tmp/version $(DEST_LIVETREE)/usr/share/VERSION

live_tree_boot:
	rm -f /tmp/live_tree*.clp
	./make_live_tree_boot
	tools/fix-fc-cache.pl $(DEST_LIVETREE)
	$(MAKE) /tmp/live_tree_always.clp
	$(MAKE) /tmp/live_tree_boot.clp
	$(MAKE) /tmp/live_tree_totem.clp
	-$(MAKE) /tmp/live_tree_nvidia.clp
	$(MAKE) $(patsubst %, /tmp/live_tree_always_i18n_%.clp, $(LANG_FILES))

un_live_tree_boot:
	./make_live_tree_boot -u
	tools/fix-fc-cache.pl $(DEST_LIVETREE)

iso: un_live_tree_boot install live_tree_boot
	rm -rf /tmp/iso /tmp/live_tree.clp
	mkdir /tmp/iso
	cp -a isolinux /tmp/iso
	rm -rf /tmp/iso/isolinux/CVS
	$(MAKE) /tmp/live_tree.clp
	mv /tmp/*.clp /tmp/iso

	touch /tmp/iso/isolinux/boot.cat
	find /tmp/iso/isolinux -type f -printf '%p 100\n' > /tmp/iso.sort ; echo '/tmp/iso/live_tree_boot.clp 5' >> /tmp/iso.sort
#	download version: MOVE10DO
#	complete version: MOVE10IN
	mkisofs -r -J -hide-rr-moved -nobak -cache-inodes -P MandrakeSoft -V 'MandrakeMove' -volset MOVE10IN -b isolinux/isolinux.bin -c isolinux/boot.cat -sort /tmp/iso.sort -no-emul-boot -boot-load-size 4 -boot-info-table -o $(ISO) /tmp/iso
	mv /tmp/iso/*.clp /tmp
	mkcd --addmd5 $(ISO)
#	cdrecord -v -eject dev=0,0,0 blank=fast gracetime=2 speed=99 $(ISO)
#	ftp://a:a@leia//BIG/mdkmove.iso

xwait: %: %.c
	$(CC) $(CFLAGS) $< -L/usr/X11R6/$(LIB_NAME) -lX11 -o $@

runlevel_set: %: %.c
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -f xwait

%.clp: %
	if [ -e $<.sort ]; then \
	mkisofs -R -sort $<.sort $< | create_compressed_fs - 65536 $@ 2000 2>/dev/null ; \
	else \
	mkisofs -R $< | create_compressed_fs - 65536 $@ 2000 2>/dev/null ; \
	fi

check_dirs:
	for i in `cat data/*.dirs`; do grep /tmp/live_tree$$i/ data/*.list; done ||:

# perl tools/busy-files-accesses --no-link --no-dir --full-dirs 'data/always.dirs data/boot.dirs data/totem.dirs' --already-have data/always.list