[anjuta] project-wizard: bgo #655865 - library project naming. library names is not what you want.



commit 7e7d0da0020d2d04542233fed5303c8727647c10
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sun Jan 22 17:15:40 2012 +0100

    project-wizard: bgo #655865 - library project naming. library names is not what you want.

 .../templates/anjuta-plugin/src/Makefile.am.tpl    |   22 ++++++++++++---
 plugins/project-wizard/templates/library.wiz.in    |    8 +++---
 .../templates/library/configure.ac.tpl             |    2 +-
 .../templates/library/src/Makefile.am.tpl          |   28 +++++++++++++++-----
 4 files changed, 44 insertions(+), 16 deletions(-)
---
diff --git a/plugins/project-wizard/templates/anjuta-plugin/src/Makefile.am.tpl b/plugins/project-wizard/templates/anjuta-plugin/src/Makefile.am.tpl
index 94ca72d..a87ed38 100644
--- a/plugins/project-wizard/templates/anjuta-plugin/src/Makefile.am.tpl
+++ b/plugins/project-wizard/templates/anjuta-plugin/src/Makefile.am.tpl
@@ -1,5 +1,19 @@
 [+ autogen5 template +]
-# Sample Makefile for a anjuta plugin.
+[+
+(define prefix_if_missing
+        (lambda
+                (name prefix)
+                (string-append
+                         (if
+                                (==* (get name) prefix)
+                                ""
+                                prefix
+                        )
+                        (get name)
+                )
+        )
+)
++]# Sample Makefile for a anjuta plugin.
 [+IF (=(get "HasUI") "1")+]
 # Plugin UI file
 [+NameCLower+]_xmldir = $(anjuta_ui_dir)
@@ -46,13 +60,13 @@ AM_CPPFLAGS = \
 plugindir = $(anjuta_plugin_dir)
 
 # The plugin
-plugin_LTLIBRARIES = lib[+NameHLower+].la
+plugin_LTLIBRARIES = [+(prefix_if_missing "NameHLower" "lib")+].la
 
 # Plugin sources
-lib[+NameCLower+]_la_SOURCES = plugin.c plugin.h
+[+(prefix_if_missing "NameCLower" "lib")+]_la_SOURCES = plugin.c plugin.h
 
 # Plugin dependencies
-lib[+NameCLower+]_la_LIBADD = \
+[+(prefix_if_missing "NameCLower" "lib")+]_la_LIBADD = \
 	$(LIBANJUTA_LIBS) [+IF (=(get "HavePackage") "1")+]$([+NameCUpper+]_LIBS)[+ENDIF+]
 
 EXTRA_DIST = \
diff --git a/plugins/project-wizard/templates/library.wiz.in b/plugins/project-wizard/templates/library.wiz.in
index eace9b9..5115ca4 100644
--- a/plugins/project-wizard/templates/library.wiz.in
+++ b/plugins/project-wizard/templates/library.wiz.in
@@ -11,7 +11,7 @@
 	</project-wizard>
 	
 	<page name="basic" _label="Basic information" _description="General Project Information">
-		<property type="string" name="Name" _label="Project Name:" _description="project name" default="foo" summary="yes" restriction="filename" mandatory="yes"/>
+		<property type="string" name="Name" _label="Project Name:" _description="project name" default="libfoo" summary="yes" restriction="filename" mandatory="yes"/>
 		<property type="string" name="Author" _label="Author:" _description="" default="[+UserName+]" mandatory="yes"/>
 		<property type="string" name="Email" _label="Email address:" _description="" default="[+EmailAddress+]" mandatory="no"/>
 		<property type="string" name="Version" _label="Version:" default="0.1" mandatory="yes"/>
@@ -54,7 +54,7 @@
 			<file source="NEWS"/>
 			<file source="README"/>
 			<file source="autogen.sh" executable="yes"/>
-			<file destination="lib[+NameHLower+].anjuta" source="project.anjuta"/>
+			<file destination="[+NameHLower+].anjuta" source="project.anjuta"/>
 			[+IF (=(get "HaveI18n") "1") +]
 			<directory source="po">
 				<file source="ChangeLog"/>
@@ -66,7 +66,7 @@
 			<file source="configure.ac.tpl" destination="configure.ac"/>
 			<directory source="src">
 				<file source="Makefile.am.tpl" destination="Makefile.am"/>
-				<file source="library.pc.in" destination="lib[+NameHLower+]-[+Version+].pc.in"/>
+				<file source="library.pc.in" destination="[+NameHLower+]-[+Version+].pc.in"/>
 				<file source="lib.c"/>
 				<file source="lib.h" destination="[+NameHLower+].h"/>
 			</directory>
@@ -89,6 +89,6 @@
 	</content>
 	
 	<action>
-		<open file="[+Destination+]/lib[+NameHLower+].anjuta"/>
+		<open file="[+Destination+]/[+NameHLower+].anjuta"/>
 	</action>
 </project-template>
diff --git a/plugins/project-wizard/templates/library/configure.ac.tpl b/plugins/project-wizard/templates/library/configure.ac.tpl
index b05ebf3..eabc296 100644
--- a/plugins/project-wizard/templates/library/configure.ac.tpl
+++ b/plugins/project-wizard/templates/library/configure.ac.tpl
@@ -44,6 +44,6 @@ GTK_DOC_CHECK([1.0])
 
 AC_OUTPUT([
 Makefile
-src/lib[+NameHLower+]-[+Version+].pc
+src/[+NameHLower+]-[+Version+].pc
 src/Makefile
 [+IF (=(get "HaveI18n") "1")+]po/Makefile.in[+ENDIF+]])
diff --git a/plugins/project-wizard/templates/library/src/Makefile.am.tpl b/plugins/project-wizard/templates/library/src/Makefile.am.tpl
index 53122e6..e71f901 100644
--- a/plugins/project-wizard/templates/library/src/Makefile.am.tpl
+++ b/plugins/project-wizard/templates/library/src/Makefile.am.tpl
@@ -1,5 +1,19 @@
 [+ autogen5 template +]
-## Process this file with automake to produce Makefile.in
+[+
+(define prefix_if_missing
+        (lambda
+                (name prefix)
+                (string-append
+                         (if
+                                (==* (get name) prefix)
+                                ""
+                                prefix
+                        )
+                        (get name)
+                )
+        )
+)
++]## Process this file with automake to produce Makefile.in
 
 ## Created by Anjuta
 
@@ -13,21 +27,21 @@ AM_CFLAGS =\
 	 -Wall\
 	 -g
 
-lib_LTLIBRARIES = lib[+NameHLower+].la
+lib_LTLIBRARIES = [+(prefix_if_missing "NameHLower" "lib")+].la
 
 
-lib[+NameCLower+]_la_SOURCES = \
+[+(prefix_if_missing "NameCLower" "lib")+]_la_SOURCES = \
 	lib.c
 
-lib[+NameCLower+]_la_LDFLAGS = 
+[+(prefix_if_missing "NameCLower" "lib")+]_la_LDFLAGS = 
 
-lib[+NameCLower+]_la_LIBADD = [+IF (=(get "HavePackage") "1")+]$([+NameCUpper+]_LIBS)[+ENDIF+]
+[+(prefix_if_missing "NameCLower" "lib")+]_la_LIBADD = [+IF (=(get "HavePackage") "1")+]$([+NameCUpper+]_LIBS)[+ENDIF+]
 
 include_HEADERS = \
 	[+NameHLower+].h
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = lib[+NameHLower+]-[+Version+].pc
+pkgconfig_DATA = [+NameHLower+]-[+Version+].pc
 
 EXTRA_DIST = \
-	lib[+NameHLower+]-[+Version+].pc.in
+	[+NameHLower+]-[+Version+].pc.in



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]