Patch #2926 2010-02-10 16:44

neildarlow

Fix for closed bug #16808 - codesnippets install/uninstall
Download
2926-Fix_for_closed.patch (1.6 KB)
Category
Plugin::Bugfix
Status
Accepted
Close date
2010-02-15 13:08
Assigned to
biplab
--- src/plugins/contrib/codesnippets/resources/Makefile.am.orig    2010-02-10 17:53:03.850303545 +0000
+++ src/plugins/contrib/codesnippets/resources/Makefile.am    2010-02-11 13:55:25.534967920 +0000
@@ -118,34 +118,23 @@
         $(srcdir)/../snippetsconfig.h \
         $(srcdir)/../snippetsimages.h
 
-pkgdatadir = $(datadir)/@PACKAGE@/images/codesnippets
+pkgdata_DATA = codesnippets.zip
+CLEANFILES = $(pkgdata_DATA)
 
-dist_pkgdata_DATA =     allsnippets.png \
-            category.png \
-            snippet.png \
-            findf.png \
-            findfdisabled.png \
-            options.png \
-            optionsdisabled.png \
-            stop.png \
-            stopdisabled.png
+imagedir = $(pkgdatadir)/images/codesnippets
+
+dist_image_DATA =  allsnippets.png \
+        category.png \
+        snippet.png \
+        findf.png \
+        findfdisabled.png \
+        options.png \
+        optionsdisabled.png \
+        stop.png \
+        stopdisabled.png
 
 EXTRA_DIST = manifest.xml
 
-codesnippets.zip: manifest.xml
+codesnippets.zip: $(EXTRA_DIST)
     PWD=`pwd` cd $(srcdir) && zip $(PWD)/codesnippets.zip manifest.xml > /dev/null
 
-install-data-local: codesnippets.zip
-    $(mkinstalldirs) $(DESTDIR)$(datadir)/@PACKAGE@/; \
-    if test -f $(srcdir)/codesnippets.zip; then p=$(srcdir)/codesnippets.zip; else p=codesnippets.zip; fi; \
-    $(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/@PACKAGE@/codesnippets.zip
-
-clean-local:
-    if test -f $(srcdir)/codesnippets.zip; then rm $(srcdir)/codesnippets.zip; fi;
-
-distclean-local:
-    if test -f $(srcdir)/codesnippets.zip; then rm $(srcdir)/codesnippets.zip; fi;
-
-uninstall-local:
-    if test -f $(DESTDIR)$(datadir)/@PACKAGE@/codesnippets.zip; then rm $(DESTDIR)$(datadir)/@PACKAGE@/codesnippets.zip; fi;
-
neildarlow 2010-02-10 16:47

Test cases:

1) make uninstall

2) make install

3) make clean

4) Availability of plugin in Code::Blocks

neildarlow 2010-02-11 17:11

This is a revised patch (against current HEAD) which also supports *make dist*.

Please consider applying this patch because it uses automake features effectively to support VPATH builds. I'm not sure that the current solution does so for the clean cases (hardcoded $(srcdir) references).

biplab 2010-02-15 13:08

Thanks for the patch.