summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 5933f3093644a0a4e0aa778d511cb43c1d4be7f1 (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
NAME = drakx-net
VERSION = 2.32.1

DESTDIR=
libdir=/usr/lib
bindir=/usr/bin
sbindir=/usr/sbin
libexecdir=/usr/libexec
desktopdir=/usr/share/applications
autostartdir=/etc/xdg/autostart
iconsdir=/usr/lib/libDrakX/icons
scalableiconsdir=/usr/share/icons/hicolor/scalable/actions
pixmapsdir=/usr/share/libDrakX/pixmaps

USER_TOOLS=net_applet
ROOT_TOOLS=drakconnect drakfirewall drakgw drakhosts drakids drakinvictus draknetprofile draknfs drakproxy drakroam draksambashare drakvpn draknetcenter

all:
	(find lib -name '*.pm'; find bin -type f) | xargs perl -pi -e 's/\s*use\s+(diagnostics|vars|strict).*//g'
	make -C po
	make -C polkit
	make -C data

check:
	@for p in `find lib -name *.pm`; do perl -cw -I$(libdir)/libDrakX $$p || exit 1; done
	@for p in bin/*; do perl -cw $$p || exit 1; done

install:
	install -d $(DESTDIR){$(libdir),$(bindir),$(libexecdir),$(desktopdir),$(autostartdir),$(iconsdir),$(pixmapsdir),$(scalableiconsdir)}
	cp -a lib/* $(DESTDIR)$(libdir)/libDrakX/
	find $(DESTDIR) -name .perl_checker -exec rm {} \;
	(cd bin && \
	  install -m755 $(USER_TOOLS) $(DESTDIR)$(bindir) && \
	  install -m755 $(ROOT_TOOLS) $(DESTDIR)$(libexecdir) \
	)
	install -m644 $(wildcard data/*.desktop) $(DESTDIR)$(desktopdir)
	install -m644 $(wildcard data/icons/*.png) $(DESTDIR)$(iconsdir)
	install -m644 $(wildcard data/pixmaps/*.png) $(DESTDIR)$(pixmapsdir)
	# FIXME: Unify install locations for drakx icons
	for icon in connected disconnected unconfigured connecting; do \
		install -m644 data/pixmaps/svg/$$icon.svg $(DESTDIR)$(scalableiconsdir)/$(NAME)-$$icon.svg; \
	done
	perl -pe 's/\s+--force//g' $(DESTDIR)$(desktopdir)/net_applet.desktop > $(DESTDIR)$(autostartdir)/net_applet.desktop
	make -C po install
	make -C polkit install

cleandist:
	rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar*

dist: cleandist
	rm -rf $(NAME)-$(VERSION).tar*
	git archive --prefix $(NAME)-$(VERSION)/ HEAD | xz -9 > $(NAME)-$(VERSION).tar.xz
	$(info $(NAME)-$(VERSION).tar.xz is ready)


clean:
	make -C po clean
	make -C polkit clean