summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7329f07dac61dc53b4a01f76dc2373d29c4bd1c5 (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
prefix=/usr
LIBDIR=$(DESTDIR)$(prefix)/lib
BINDIR=$(DESTDIR)$(prefix)/bin
DATADIR=$(DESTDIR)$(prefix)/share
LOCALEDIR=$(DATADIR)/locale
MANDIR=$(DATADIR)/man
INSTALL=install

all: 	Makefile
	cd src/xmpppy-0.5.0rc1 && pwd && python setup.py build && cp -r xmpp ..

clean:	Makefile

install:
	$(INSTALL) -d $(LOCALEDIR) $(BINDIR) $(DATADIR)/poezio $(DATADIR)/poezio/data $(DATADIR)/poezio/src $(DATADIR)/poezio/src/xmpp

	$(INSTALL) -m644 data/* $(DATADIR)/poezio/data/

	for sourcefile in `find src/ -maxdepth 1 -type f | grep -v '.svn' | grep -v '.pyc'` ; do \
		$(INSTALL) -m644 $$sourcefile $(DATADIR)/poezio/src; \
	done
	$(INSTALL) -m644 src/xmpp/* $(DATADIR)/poezio/src/xmpp/

	echo "#!/bin/sh" > $(BINDIR)/poezio
	echo "cd $(DATADIR)/poezio/src/ && python client.py" >> $(BINDIR)/poezio
	chmod 755 $(BINDIR)/poezio

	for localename in `find locale/ -maxdepth 1 -type d | grep -v '.svn' | sed 's:locale/::g'` ; do \
		if [ -d locale/$$localename ]; then \
		    $(INSTALL) -d $(LOCALEDIR)/$$localename; \
		    $(INSTALL) -d $(LOCALEDIR)/$$localename/LC_MESSAGES; \
			msgfmt locale/$$localename/LC_MESSAGES/poezio.po -o locale/$$localename/LC_MESSAGES/poezio.mo -v; \
			$(INSTALL) -m644 locale/$$localename/LC_MESSAGES/poezio.mo $(LOCALEDIR)/$$localename/LC_MESSAGES; \
		fi \
	done

uninstall:
	rm -f $(BINDIR)/poezio
	rm -rf $(DATADIR)/poezio

	for gettextfile in `find $(LOCALEDIR) -name 'poezio.mo'` ; do \
		rm -f $$gettextfile; \
	done

pot:
	xgettext src/*.py --from-code=utf-8 --keyword=_ -o locale/poezio.pot