Переглянути джерело

g.version: new -x flag for cross-ref citation of GRASS GIS

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68657 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 роки тому
батько
коміт
d15db283a5
4 змінених файлів з 41 додано та 3 видалено
  1. 21 0
      CITING
  2. 1 1
      general/g.version/Makefile
  3. 15 1
      general/g.version/main.c
  4. 4 1
      include/Makefile

+ 21 - 0
CITING

@@ -0,0 +1,21 @@
+The GRASS Development Team, the addon authors, further contributors and the user community have invested enormous efforts in making GRASS GIS available to you. Please give credit where credit is due and cite GRASS GIS and its addons when you use them for data analysis.
+
+For generic citations see below; for citing a particular GRASS GIS module, you may refer to the main author(s) along with the GRASS Development Team.
+
+Here are some choices depending on the version used:
+* GRASS Development Team, YEAR. Geographic Resources Analysis Support System (GRASS) Software, Version 7.0. Open Source Geospatial Foundation. http://grass.osgeo.org
+* GRASS Development Team, YEAR. Geographic Resources Analysis Support System (GRASS) Programmer's Manual. Open Source Geospatial Foundation. Electronic document: http://grass.osgeo.org/programming7
+
+For other (scientific) references, see
+* https://grasswiki.osgeo.org/wiki/GRASS_Citation_Repository
+
+A BibTeX entry for LaTeX users is:
+
+@Manual{GRASS_GIS_software,
+  title = {Geographic Resources Analysis Support System (GRASS) Software},
+  author = {{GRASS Development Team}},
+  organization = {Open Source Geospatial Foundation},
+  address = {USA},
+  year = {YEAR},
+  url = {http://grass.osgeo.org},
+}

+ 1 - 1
general/g.version/Makefile

@@ -3,7 +3,7 @@ MODULE_TOPDIR = ../..
 PGM=g.version
 
 # cat the COPYING file, add a c line-break \n at each line end
-# and remove the unix newline. 
+# and remove the unix newline (see: include/Makefile)
 
 EXTRA_CFLAGS = $(PROJINC) $(GEOSCFLAGS) \
 	-DGRASS_VERSION_NUMBER=\"'$(GRASS_VERSION_NUMBER)'\" \

+ 15 - 1
general/g.version/main.c

@@ -46,6 +46,10 @@ static const char COPYING[] =
 #include <grass/copying.h>
 ;
 
+static const char CITING[] =
+#include <grass/citing.h>
+;
+
 static const char GRASS_CONFIGURE_PARAMS[] =
 #include <grass/confparms.h>
 ;
@@ -53,7 +57,7 @@ static const char GRASS_CONFIGURE_PARAMS[] =
 int main(int argc, char *argv[])
 {
     struct GModule *module;
-    struct Flag *copyright, *build, *gish_rev, *shell, *extended;
+    struct Flag *copyright, *build, *gish_rev, *cite_flag, *shell, *extended;
 
     G_gisinit(argv[0]);
 
@@ -94,6 +98,11 @@ int main(int argc, char *argv[])
     shell->description = _("Print info in shell script style (including SVN revision number)");
     shell->guisection = _("Shell");
 
+    cite_flag = G_define_flag();
+    cite_flag->key = 'x';
+    cite_flag->description =
+        _("Display information on how to cite the GRASS GIS software and Addons");
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
@@ -115,6 +124,11 @@ int main(int argc, char *argv[])
 	fputs(COPYING, stdout);
     }
 
+    if (cite_flag->answer) {
+	fprintf(stdout, "\n");
+	fputs(CITING, stdout);
+    }
+
     if (build->answer) {
 	fprintf(stdout, "\n");
 	fputs(GRASS_CONFIGURE_PARAMS, stdout);

+ 4 - 1
include/Makefile

@@ -5,7 +5,7 @@ include $(MODULE_TOPDIR)/include/Make/Rules.make
 
 SRCH := $(wildcard ../include/*.h ../include/defs/*.h ../include/vect/*.h ../include/iostream/*.h)
 DSTH := $(patsubst ../include/%.h,$(ARCH_INCDIR)/%.h,$(SRCH))
-DSTH_EXTRA = $(ARCH_INCDIR)/copying.h $(ARCH_INCDIR)/confparms.h
+DSTH_EXTRA = $(ARCH_INCDIR)/copying.h $(ARCH_INCDIR)/citing.h $(ARCH_INCDIR)/confparms.h
 
 SRCMAKE := $(wildcard ../include/Make/*.make)
 DSTMAKE := $(patsubst ../include/Make/%.make,$(ARCH_DISTDIR)/include/Make/%.make,$(SRCMAKE))
@@ -45,5 +45,8 @@ $(ARCH_DISTDIR)/include/Make:
 $(ARCH_INCDIR)/copying.h: $(MODULE_TOPDIR)/COPYING | $(ARCH_INCDIR)
 	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
 
+$(ARCH_INCDIR)/citing.h: $(MODULE_TOPDIR)/CITING | $(ARCH_INCDIR)
+	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
+
 $(ARCH_INCDIR)/confparms.h: $(MODULE_TOPDIR)/config.status | $(ARCH_INCDIR)
 	sed -n '7s/^#\(.*\)$$/"\1"/p' $< > $@