1# only really known to work on ubuntu, if you're using anything else, hopefully
2# it should at least give you a clue how to install it by hand
3
4PREFIX ?= /usr
5SYSCONFDIR ?= /etc
6DATADIR ?= $(PREFIX)/share
7DESTDIR ?=
8
9PYTHON ?= /usr/bin/python3
10
11all: uniemoji.xml config.py
12
13uniemoji.xml: uniemoji.xml.in
14	sed -e "s:@PYTHON@:$(PYTHON):g;" \
15	    -e "s:@DATADIR@:$(DATADIR):g" $< > $@
16
17config.py: config.py.in
18	sed -e "s:@SYSCONFDIR@:$(SYSCONFDIR):g" $< > $@
19
20install: all
21	install -m 0755 -d $(DESTDIR)$(DATADIR)/ibus-uniemoji $(DESTDIR)$(SYSCONFDIR)/xdg/uniemoji $(DESTDIR)$(DATADIR)/ibus/component
22	install -m 0644 uniemoji.svg UnicodeData.txt emojione.json $(DESTDIR)$(DATADIR)/ibus-uniemoji
23	install -m 0755 uniemoji.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
24	install -m 0644 config.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
25	install -m 0644 ibus.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
26	install -m 0644 uniemoji.xml $(DESTDIR)$(DATADIR)/ibus/component
27	install -m 0644 custom.json $(DESTDIR)$(SYSCONFDIR)/xdg/uniemoji
28
29uninstall:
30	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/uniemoji.svg
31	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/UnicodeData.txt
32	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/emojione.json
33	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/uniemoji.py
34	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/config.py
35	rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/ibus.py
36	rmdir $(DESTDIR)$(DATADIR)/ibus-uniemoji
37	rm -f $(DESTDIR)$(SYSCONFDIR)/xdg/uniemoji/custom.json
38	rmdir $(DESTDIR)$(SYSCONFDIR)/xdg/uniemoji
39	rm -f $(DESTDIR)$(DATADIR)/ibus/component/uniemoji.xml
40
41clean:
42	rm -f uniemoji.xml
43	rm -f config.py
44