Artem Egorkine avatar Artem Egorkine committed c565dd3

Install images and a compile-time generated defs.py

Comments (0)

Files changed (4)

 \.py[co]$
 \.sw.?$
 \.orig$
+
+# autoconf & automake -generated
+
 ^aclocal.m4$
 ^autom4te.cache
 ^Makefile(.in)?$
 ^install-sh$
 ^missing$
 ^py-compile$
+
+# build-time generated files
+
 ^TeamcityApplet.server$
+^defs.py$
 server_in_files = TeamcityApplet.server.in
 server_DATA = $(server_in_files:.server.in=.server)
 
-$(server_DATA): $(server_in_files)
+$(server_DATA): $(server_in_files) Makefile
 	sed -e "s|\@LIBDIR\@|$(pkglibdir)|" $< > $@
 
 CLEANFILES = \
-	$(server_in_files)
+	$(server_DATA)
 
 icondir = $(datadir)/pixmaps
 icon_DATA = images/teamcity-icon.png
 
+# images
+
+imagesdir = $(datadir)/pixmaps/$(PACKAGE)
+images_DATA = \
+	images/icon.png
+
 # sources
 
 pkglib_SCRIPTS = \
 	teamcity-applet
 
+defs.py: defs.py.in Makefile
+	sed -e "s|\@PACKAGE\@|$(PACKAGE)|" \
+	    -e "s|\@VERSION\@|$(VERSION)|" \
+	    -e "s|\@IMAGESDIR\@|$(imagesdir)|" \
+	    $< > $@
+
+BUILT_SOURCES = defs.py
+CLEANFILES += defs.py
+
 teamcityappletdir = $(pythondir)/teamcityapplet
 teamcityapplet_PYTHON = \
 	teamcityapplet/__init__.py \
 	teamcityapplet/applet.py \
 	teamcityapplet/feed.py \
-	teamcityapplet/config.py
+	teamcityapplet/config.py \
+	defs.py
 
 teamcityapplet_uidir = $(pythondir)/teamcityapplet/ui
 teamcityapplet_ui_PYTHON = \
+PACKAGE = '@PACKAGE@'
+VERSION = '@VERSION@'
+
+IMAGESDIR = '@IMAGESDIR@'

teamcityapplet/config.py

 except ImportError:
     PACKAGE = 'teamcity-gnome-applet'
     VERSION = '0'
-    ICON = path.join( path.dirname(__file__), '../images', 'icon.png' )
+    IMAGESDIR = path.join( path.dirname(__file__), '../images' )
 
+ICON = path.join( IMAGESDIR, 'icon.png' )
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.