~gilir/screenlets/trunk-core-remerge

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
73
74
#-------------------------------------------------------------------------------
# Screenlets (c) RYX (aka Rico Pfaus) 2007-2009 <ryx@ryxperience.com>
# 
# [for full list of authors see file AUTHORS]
#-------------------------------------------------------------------------------
#
# A simple makefile to allow installing/uninstalling applets and performing
# other actions like creating a source-package or documentation.
#

PREFIX = /usr/local
INSTALL_LOG = install.log
MELANGE_SERVICE_FILE = src/share/melange/org.UniversalApplets.Melange.service
DAEMON_SERVICE_FILE = src/share/screenlets-daemon/org.Screenlets.Daemon.service
MANAGER_SERVICE_FILE = src/share/screenlets-manager/org.Screenlets.ScreenletsManager.service

.PHONY : docs
.PHONY : uninstall

all:
	@echo "Makefile: Available actions: install, uninstall, clean, doxydoc, source_package, translations"

# install
install:
	-mkdir /etc/screenlets
	@echo $(PREFIX) > /etc/screenlets/prefix
	sed 's:PREFIX:$(PREFIX):' < $(MELANGE_SERVICE_FILE).in > $(MELANGE_SERVICE_FILE)
	sed 's:PREFIX:$(PREFIX):' < $(DAEMON_SERVICE_FILE).in > $(DAEMON_SERVICE_FILE)
	sed 's:PREFIX:$(PREFIX):' < $(MANAGER_SERVICE_FILE).in > $(MANAGER_SERVICE_FILE)
	python setup.py install --record=$(INSTALL_LOG) --prefix=$(PREFIX)
	
# uninstall
uninstall:
	rm -rf $(shell cat $(INSTALL_LOG))
	rm -rf /etc/screenlets
	rm -f $(INSTALL_LOG)
	rm -f $(HOME)/.config/autostart/screenlets-daemon.desktop
	@echo "Makefile: Screenlets removed."

# remove temporary files created by install
# note: this does not remove the install log
clean:
	python setup.py clean
	rm -rf dist
	rm -rf build
	rm -f $(MELANGE_SERVICE_FILE)
	rm -f $(DAEMON_SERVICE_FILE)
	rm -f $(MANAGER_SERVICE_FILE)
	@echo "Makefile: Temporary files have been removed."

# create API-documentation (using doxgen)
doxydoc:
	doxygen doxygen.conf

# create API-documentation (using pydoc)
pydoc:
	make -C docs

# create API-documentation (using epydoc)
epydoc:
	epydoc --html --output=docs/epydoc --name="Screenlets $(VERSION)" screenlets screenlets.backend screenlets.drawing screenlets.install screenlets.menu screenlets.options screenlets.Plugins screenlets.session screenlets.services screenlets.sensors screenlets.utils screenlets.plugins.Amarok screenlets.plugins.AmazonCoverArtSearch screenlets.plugins.Banshee screenlets.plugins.CoverSearch screenlets.plugins.Exaile screenlets.plugins.GenericPlayer screenlets.plugins.iCal screenlets.plugins.keyring screenlets.plugins.Listen screenlets.plugins.Loader screenlets.plugins.Mail screenlets.plugins.Mplayer screenlets.plugins.Proxy screenlets.plugins.Quodlibet screenlets.plugins.Rhythmbox screenlets.plugins.Sonata screenlets.plugins.Songbird

# create API-documentation
menu:
	make -C desktop-menu
	
# build a source-release
source_package:
	python setup.py sdist --formats=bztar
	@echo "Makefile: Source-package is ready and waiting in ./dist ..."

# generate translations template
translations:
	xgettext --language=Python --output=messages.pot --copyright-holder="Natan Yellin" --msgid-bugs-address=aantny@gmail.com src/lib/screenlets/*.py src/bin/melange src/bin/screenlets-*