Commit 2a630ec7 authored by Sebastien Granjoux's avatar Sebastien Granjoux
Browse files

project-wizard: Generate the licenses in a more general way, fix bgo #627431

Generate licenses without using predefined autogen macros which are buggy in version 5.12 and 5.13.
The list of all licenses is defined in licenses.tpl.in file and other licenses can be added in licenses directory.
parent fc56c114
......@@ -25,7 +25,8 @@ template_in_files = \
sdl.wiz.in \
library.wiz.in \
vala-gtk.wiz.in \
gnome-shell-extension.wiz.in
gnome-shell-extension.wiz.in \
licenses.tpl.in
wizard_filesdir = $(anjuta_data_dir)/project
wizard_files_DATA = \
......@@ -45,11 +46,17 @@ wizard_files_DATA = \
appwiz_sdl.png \
gnome.png \
gnome.svg \
$(template_in_files:.wiz.in=.wiz)
$(template_in_files:.in=)
# Translate wiz file
%.wiz: %.wiz.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -x -u -c $(top_builddir)/po/.intltool-merge-cache
%.tpl: %.tpl.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po)
$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@_ -x -u -c $(top_builddir)/po/.intltool-merge-cache
echo "[+ autogen5 template +]" | cat - $@_ > $@;
rm $@_
EXTRA_DIST = $(wizard_files_DATA) $(template_in_files)
-include $(top_srcdir)/git.mk
......@@ -20,12 +20,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -101,7 +96,7 @@
[+ENDIF+]
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* plugin.c
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#include <config.h>
#include <libanjuta/anjuta-shell.h>
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* plugin.h
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#ifndef _[+NameCUpper+]_H_
#define _[+NameCUpper+]_H_
......
......@@ -18,12 +18,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -69,7 +64,7 @@
[+ENDIF+]
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* main.cc
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#include <iostream>
......
......@@ -21,12 +21,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -77,7 +72,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
......@@ -18,12 +18,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-substitute (string-downcase (get "Name")) " " "-")+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="string" name="Description" _label="Description:" _description="Long description of your plugin" default="[+Name+]" mandatory="yes"/>
<property type="string" name="UUID" _label="UUID:" _description="Uuid is a globally-unique identifier for your extension.
This should be in the format of an email address (foo.bar@extensions.example.com), but
......@@ -50,7 +45,7 @@ email address." default='[+(string-substitute (string->c-name! (get "Name")) " "
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
</content>
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* extension.js
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
const St = imports.gi.St;
const Main = imports.ui.main;
......
......@@ -20,12 +20,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -75,7 +70,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* main.c
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#include <config.h>
#include <gtk/gtk.h>
......
......@@ -20,12 +20,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -78,7 +73,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* [+NameLower+].c
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#include "[+NameLower+].h"
[+IF (=(get "HaveI18n") "1")+]
#include <glib/gi18n.h>
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* [+NameLower+].h
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#ifndef _[+NameCUpper+]_
#define _[+NameCUpper+]_
......
......@@ -20,12 +20,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -75,7 +70,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* main.cc
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
#include <gtkmm.h>
#include <iostream>
......
......@@ -21,12 +21,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -73,7 +68,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
</content>
......
[+ autogen5 template +]
[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+]
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* [+MainClass+].java
* Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
* Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]>
*
[+CASE (get "License") +]
[+ == "BSD" +][+(bsd (get "Name") (get "Author") " * ")+]
[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
[+ == "GPL" +][+(gpl (get "Name") " * ")+]
[+ESAC+] */
[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+]
*/
class [+MainClass+] {
public static void main(String[] args) {
......
......@@ -18,12 +18,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -45,7 +40,7 @@
</directory>
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
</content>
......
......@@ -19,12 +19,7 @@
<page name="options" _label="Project options" _description="Options for project build system">
<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" summary="yes"/>
<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
<item name="GPL" _label="General Public License (GPL)"/>
<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
<item name="None" _label="No license"/>
</property>
[+INCLUDE "licenses.tpl"+]
<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
......@@ -77,7 +72,7 @@
[+ENDIF+]
</directory>
<directory source="licenses" destination="[+Destination+]">
<file source="[+License+]" destination="COPYING"/>
<file source="[+License+].txt" destination="COPYING"/>
</directory>
<directory source="minimal" destination="[+Destination+]">
<directory source="." destination=".anjuta">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment