Makefile 1.88 KB
Newer Older
1 2 3
all:
	echo "We don't need any build"

4
installd_list = pack.d repack.d prescription.d play.d
5
cmd_list = epm serv esu
6

7
.PHONY: all clean install check install_common $(installd_list) $(cmd_list)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
8

9 10 11 12 13
# get version from the spec by default
PKGVER = $(shell grep "^Version: " eepm.spec | cut -d" " -f2)
PKGREL = $(shell grep "^Release: " eepm.spec | cut -d" " -f2)
version := $(PKGVER)-$(PKGREL)

14
pkgdatadir=$(datadir)/eepm
Vitaly Lipatov's avatar
Vitaly Lipatov committed
15

16
install: install_common $(installd_list) $(cmd_list)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
17 18

install_common:
19
	mkdir -p $(DESTDIR)$(bindir)/
Vitaly Lipatov's avatar
Vitaly Lipatov committed
20

Vitaly Lipatov's avatar
Vitaly Lipatov committed
21
	# breaks link
Vitaly Lipatov's avatar
Vitaly Lipatov committed
22 23
	cp -a `ls -1 bin/* | grep -v "[-_]"` $(DESTDIR)$(bindir)/
	cp -a bin/distr_info $(DESTDIR)$(bindir)/
Vitaly Lipatov's avatar
Vitaly Lipatov committed
24
	chmod 0755 $(DESTDIR)$(bindir)/*
25

Vitaly Lipatov's avatar
Vitaly Lipatov committed
26
	mkdir -p $(DESTDIR)$(pkgdatadir)/
27
	cp -a `ls -1 bin/* | grep "[-_]"` $(DESTDIR)$(pkgdatadir)/
Vitaly Lipatov's avatar
Vitaly Lipatov committed
28
	rm -f $(DESTDIR)$(pkgdatadir)/distr_info
29

30 31
	mkdir -p $(DESTDIR)$(sysconfdir)/eepm/
	cp -a etc/eepm.conf $(DESTDIR)$(sysconfdir)/eepm/
32
	cp -a etc/serv.conf $(DESTDIR)$(sysconfdir)/eepm/
33
	cp -a etc/*.list $(DESTDIR)$(sysconfdir)/eepm/
34

35 36
	mkdir -p $(DESTDIR)$(mandir)/man1
	cp -a `ls -1 man/*` $(DESTDIR)$(mandir)/man1/
37

38 39
	mkdir -p $(DESTDIR)$(sysconfdir)/bash_completion.d/
	install -m 0644 bash_completion/serv $(DESTDIR)$(sysconfdir)/bash_completion.d/serv
40
	install -m 0644 bash_completion/eepm $(DESTDIR)$(sysconfdir)/bash_completion.d/eepm
41 42

	# shebang.req.files
43 44
	chmod a+x $(DESTDIR)$(pkgdatadir)/serv-*
	chmod a+x $(DESTDIR)$(pkgdatadir)/epm-*
45 46 47
	chmod a+x $(DESTDIR)$(pkgdatadir)/tools_*

	mkdir -p $(DESTDIR)/var/lib/eepm/
48
	mkdir -p $(DESTDIR)/var/cache/eepm/
49 50


51
$(cmd_list):
Vitaly Lipatov's avatar
Vitaly Lipatov committed
52 53
	sed -e "s|SHAREDIR=.*|SHAREDIR=$(pkgdatadir)|g" \
		-e "s|CONFIGDIR=.*|CONFIGDIR=$(sysconfdir)/eepm|g" \
54
		-e "s|@VERSION@|$(version)|g" <bin/$@ >$(DESTDIR)$(bindir)/$@
55
	chmod 0755 $(DESTDIR)$(bindir)/$@
Vitaly Lipatov's avatar
Vitaly Lipatov committed
56

57 58
$(installd_list):
	mkdir -p $(DESTDIR)$(sysconfdir)/eepm/$@/
59
	cp $@/* $(DESTDIR)$(sysconfdir)/eepm/$@/
60
	chmod 0755 $(DESTDIR)$(sysconfdir)/eepm/$@/*.sh
Vitaly Lipatov's avatar
Vitaly Lipatov committed
61 62


63 64
check:
	echo "test suite.."