summaryrefslogtreecommitdiffstats
path: root/perl-install/Makefile.drakxtools
blob: b6d1f986abd63e94ed2479f7c4c3e452b4001e33 (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
# -*- Makefile -*-
include Makefile.config

INLIBDEST_DIRS = Newt c resize_fat sbus_probing 
HAVEINST_DIRS = share/po standalone/interactive_http
DIRS = $(INLIBDEST_DIRS) $(HAVEINST_DIRS) ddcprobe harddrake printer serial_probe
NAME = libDrakX
PREFIX = 
LIBDIR = $(PREFIX)/usr/lib
MENUDIR= $(LIBDEST)/menu
DATADIR = $(PREFIX)/usr/share
ICONSDIR= $(DATADIR)/icons
BINDEST = $(PREFIX)/usr/bin
SBINDEST = $(PREFIX)/usr/sbin
ETCDEST = $(PREFIX)/etc/gtk
BINX11DEST = $(PREFIX)/usr/X11R6/bin
LIBX11DEST = $(PREFIX)/usr/X11R6/lib/X11
LIBDEST = $(LIBDIR)/$(NAME)
PIXDIR = $(DATADIR)/$(NAME)/pixmaps
INITDIR =  $(PREFIX)/etc/rc.d/init.d
.PHONY: $(DIRS)

all: rpcinfo-flushed $(DIRS)

$(DIRS):
	install -d auto
	rm -f share/po/DrakX.pot # force rebuild of po's
	[ ! -e $@/Makefile ] || $(MAKE) -C $@

install:
	mkdir -p $(BINDEST) $(ETCDEST) $(SBINDEST) $(DATADIR)/{harddrake,pixmaps,icons/{large,mini}} $(BINX11DEST) $(LIBX11DEST) $(PIXDIR) $(INITDIR) $(MENUDIR)
	install -d $(INLIBDEST_DIRS:%=$(LIBDEST)/%)
	install $(STANDALONEPMS) standalone/service_harddrake.sh $(SBINDEST)
	install -s rpcinfo-flushed ddcprobe/ddcxinfos serial_probe/serial_probe $(SBINDEST)
	ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres
	ln -s fileshareset $(SBINDEST)/filesharelist
	mv -f $(SBINDEST)/lsnetdrake $(BINDEST)
	mv -f $(SBINDEST)/drakbug $(BINDEST)
	mv -f $(SBINDEST)/drakhelp $(BINDEST)
	mv -f $(SBINDEST)/localedrake $(BINDEST)

	install -m 644 *.pm $(LIBDEST)
	for i in $(PMS_DIRS); do install -d $(LIBDEST)/$$i ; install -m 644 $$i/*.pm $(LIBDEST)/$$i/;done
	install -m 644 pixmaps/*.* $(PIXDIR)
	install -m 644 share/diskdrake.rc $(DATADIR)/$(NAME)

	install -d $(PREFIX)/etc/security
	echo 'RESTRICT=yes' > $(PREFIX)/etc/security/fileshare.conf

	for i in $(HAVEINST_DIRS); do \
		$(MAKE) -C $$i install PREFIX=$(PREFIX) DATADIR=$(DATADIR) NAME=$(NAME) ; \
	done

	find auto -follow -name .exists -o -name "*.bs" | xargs rm -f
	cp -rfL auto standalone/icons $(LIBDEST)
	mv $(LIBDEST)/icons/harddrake2/menu/harddrake-menu32.png $(ICONSDIR)/harddrake.png
	mv $(LIBDEST)/icons/harddrake2/menu/harddrake-menu48.png $(ICONSDIR)/large/harddrake.png
	mv $(LIBDEST)/icons/harddrake2/menu/harddrake-menu16.png $(ICONSDIR)/mini/harddrake.png
	rmdir $(LIBDEST)/icons/harddrake2/menu
	mv $(LIBDEST)/icons/harddrake2/ $(DATADIR)/pixmaps/
	mv $(SBINDEST)/service_harddrake.sh $(INITDIR)/harddrake
	mv $(SBINDEST)/service_harddrake $(DATADIR)/harddrake/
	ln -s $(SBINDEST)/{XFdrake,drakx11}
	ln -s $(SBINDEST)/{diskdrake,drakdisk}
	ln -s $(SBINDEST)/{drakclock,clock.pl}
	ln -s $(SBINDEST)/{harddrake2,drakhardware}
	ln -s $(SBINDEST)/{keyboarddrake,drakkeyboard}
	ln -s $(SBINDEST)/{localedrake,draklocale}
	ln -s $(SBINDEST)/{logdrake,draklog}
	ln -s $(SBINDEST)/{mousedrake,drakmouse}
	ln -s $(SBINDEST)/{net_monitor,draknet_monitor}
	ln -s $(SBINDEST)/{printerdrake,drakprinter}