]> granicus.if.org Git - graphviz/commitdiff
change from $HOME/.graphviz/xxx.config to /usr/lib/graphviz/config
authorellson <devnull@localhost>
Sun, 8 May 2005 20:39:27 +0000 (20:39 +0000)
committerellson <devnull@localhost>
Sun, 8 May 2005 20:39:27 +0000 (20:39 +0000)
update config at install

cmd/dot/Makefile.am
graphviz.spec.in
lib/gvc/Makefile.am
lib/gvc/gvconfig.c

index 6011fd99ecce4bb8a7bc384cfc1cb8b7a4d8083b..5f054f511a244eab302eed0e51e02c5fe5add96f 100644 (file)
@@ -49,8 +49,11 @@ install-data-hook:
        (cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; $(LN_S) dot.1 $$i; done;)
        (cd $(DESTDIR)$(pdfdir); for i in $(linkedpdf); do rm -f $$i; $(LN_S) dot.pdf $$i; done;)
 
+# create "neato", "fdp" etc as soflinks to "dot"
+# run dot once, if possible, to create plugin config
 install-exec-hook:
        (cd $(DESTDIR)$(bindir); for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot $$i; done;)
+       if test "x$(DESTDIR)" = "x"; then (cd $(bindir); ./dot -V 2>/dev/null;); fi
 
 uninstall-hook:
        (cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;)
index f59c9aa167b8bcadfff741f70f4f1b73115a9d95..1eb66257ae745c0715850fab0bff43bdb92a2b16 100644 (file)
@@ -145,6 +145,10 @@ make \
 cp -a $RPM_BUILD_ROOT%{_datadir}/%{name}/doc __doc
 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/doc
 
+%post
+echo -n "Running 'dot -V' to generate 'config' for plugins."
+%{_bindir}/dot -V
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
index a678ab4754bd39fe2d33ec544cf4050aa61b6c3b..909f898426618656e91059bc46ba4403d5e0e47d 100644 (file)
@@ -15,6 +15,8 @@ pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h \
 pkglib_LTLIBRARIES = libgvc.la
 
 libgvc_la_SOURCES = gvrender.c gvlayout.c gvtextlayout.c gvcontext.c \
-       gvjobs.c gvevent.c gvplugin.c gvconfig.c gvhostname.c
+       gvjobs.c gvevent.c gvplugin.c gvconfig.c
+
+# gvhostname.c
 
 EXTRA_DIST = Makefile.old
index 8893422e5acdeed81b35c3cf3f456486ee87e746..eb3d56e20eae5e79428fded5463b6cf75e8cd6c7 100644 (file)
@@ -275,11 +275,13 @@ void gvconfig(GVC_t * gvc)
     struct stat config_st, libdir_st;
     FILE *f = NULL;
     char *config_path = NULL, *config_text = NULL;
-    char *home;
 
-    char *config_dir_name = ".graphviz";
     char *config_file_name = "config";
+#if 0
+    char *home;
+    char *config_dir_name = ".graphviz";
     char *s;
+#endif
 
 #define MAX_SZ_CONFIG 100000
 #endif
@@ -301,6 +303,7 @@ void gvconfig(GVC_t * gvc)
        return;
     }
 
+#if 0
     home = getenv ("HOME");
     if (!home) {
        rc = -1;
@@ -329,6 +332,13 @@ void gvconfig(GVC_t * gvc)
 
         rc = stat(config_path, &config_st);
     }
+#else
+    config_path = malloc(strlen(GVLIBDIR) + 1 + strlen(config_file_name) + 1);
+    strcpy(config_path, GVLIBDIR);
+    strcat(config_path, "/");
+    strcat(config_path, config_file_name);
+    rc = stat(config_path, &config_st);
+#endif
        
     if (rc == -1 || libdir_st.st_mtime > config_st.st_mtime) {
        config_rescan(gvc, config_path);