summaryrefslogtreecommitdiffstats
path: root/perl-install/install/Makefile
blob: 048e401f413838be26a5ceaa2feb7296903b4bbe (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
include ../../Makefile.config
include ../Makefile.config

PRODUCT=drakx-installer-stage2

ROOTDEST = /export
STAGE2_DEST = $(ROOTDEST)/install/stage2
DEST = $(STAGE2_DEST)/live

REP4PMS     = /usr/lib/libDrakX
DESTREP4PMS = $(DEST)$(REP4PMS)

all: xs

clean xs:
	make -C .. $@

dist-svn:
	mkdir -p $(PRODUCT)-$(VERSION)
	svn export -q -rBASE .. $(PRODUCT)-$(VERSION)/perl-install
	svn export -q -rBASE ../../tools $(PRODUCT)-$(VERSION)/tools
	svn export -q -rBASE ../../kernel $(PRODUCT)-$(VERSION)/kernel
	cp ../../Makefile.config $(PRODUCT)-$(VERSION)/
	tar cfa $(PRODUCT)-$(VERSION).tar.xz $(PRODUCT)-$(VERSION)
	rm -rf $(PRODUCT)-$(VERSION)

dist-git:
	@cd ../..; git archive --prefix=$(PRODUCT)-$(VERSION)/ HEAD kernel perl-install tools Makefile.config | xz >$(PRODUCT)-$(VERSION).tar.xz;
	@echo WARNING: rpmsrate is MISSING!!!

tar:
	rm -rf $(PRODUCT)*.tar* $(PRODUCT)-$(VERSION)
	@if [ -e "../../.svn" ]; then \
		$(MAKE) dist-svn; \
	elif [ -e "../../.git" ]; then \
		$(MAKE) dist-git; \
	else \
		echo "Unknown SCM (not SVN nor GIT)";\
		exit 1; \
	fi;
	$(info $(PRODUCT)-$(VERSION).tar.xz is ready)

install:
	$(MAKE) full_stage2
	echo $(VERSION) > $(STAGE2_DEST)/VERSION

install_pms:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)

# commands implemented in perl:
	for i in `perl -ne 's/sub (\w+?)_?(\(\))? {.*/$$1/ and print' commands.pm` sync; do ln -sf commands $(DEST)/usr/bin/$$i; done

# install & clean perl modules:
	install -d $(DESTREP4PMS)
	cd .. ; for i in $(PMS); do \
		dest=$(DESTREP4PMS)/`dirname $$i`; \
		install -d $$dest; \
		perl -pe 's/#[-+].*//; $$_ = "\n" if (/^=(back|begin|head|item)/ .. /^=cut/) || /use (diagnostics|strict|vars|warnings)/' $$i > $(DESTREP4PMS)/$$i; \
	done

	cp ../share/*.rc share/*.rc $(DESTREP4PMS)
	chmod a+x $(DESTREP4PMS)/install/install2
	chmod a+x $(DESTREP4PMS)/install/commands

get_needed_files: xs
# generate installer system:
	REP4PMS=$(REP4PMS) ../../tools/install-xml-file-list share/list.xml $(DEST)
	mkdir -p $(DEST)/usr/sbin
	/usr/lib/dracut/modules.d/30convertfs/convertfs.sh $(DEST)
	chmod u-s -R $(DEST) # for mount/umount
	share/generate-xlocales $(DEST)

	../../tools/simplify-drakx-modules $(DEST)/usr/*/*/*/utf8_heavy.pl

	perl -I.. -Mlang -e 'symlink "UTF-8", "$(DEST)/usr/share/locale/$$_" foreach lang::list_langs()'

# various needed soft links (eg for ndiswrapper):
	perl -ane 'symlink "$$F[1]", "$(DEST)$$F[0]"' share/aliases
# default shell:
ifeq (ia64,$(ARCH))
	ln -sf bash $(DEST)/bin/sh
else
	ln -sf ash $(DEST)/bin/sh
endif

# X11 font caches:
	mkfontdir $(DEST)/usr/share/fonts
	fc-cache -f $(DEST)/usr/share/fonts

# drakx translations:
	$(MAKE) -C ../share/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
	$(MAKE) -C help/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
	$(MAKE) -C share/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
# POFILES to disable for installation:
# be,fur: too few messages translated; 
# ta: font problem
	rm -rf $(DEST)/usr/share/locale_special/{be,fur,ta}

full_stage2:
	$(MAKE) stage2
	@if [ "$${DEBUG_INSTALL+xxx}" ]; then make dont_run_directly_stage2; else : ; fi
	$(MAKE) compress

compress:
	../../tools/mdkinst_stage2_tool --clean --compress $(STAGE2_DEST)

stage2:
	rm -rf $(DEST)
	mkdir -p $(DEST)/usr
	$(MAKE) get_needed_files 
	$(MAKE) install_pms

dont_run_directly_stage2:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)
	install -m 755 share/runinstall2.sh share/gdb-inst $(DEST)/usr/bin/
	ln -sf runinstall2.sh $(DEST)/usr/bin/runinstall2

trace_stage2:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)
	f=`perldoc -l Devel::Trace`; install -m 644 -D $$f $(DEST)$$f
	perl -pi -e 's|(#!/usr/bin/perl).*|$$1 -d:Trace|' $(DEST)/usr/bin/runinstall2

# [pixel] after make install_pms:
# sudo sh -c 'CLEAN=1 perl ../../tools/drakx-in-chroot /export /tmp/rr --useless_thing_accepted --kickstart install/auto_inst.cfg.local.pl'