From: Sebastian Harl Date: Fri, 10 Oct 2008 13:07:05 +0000 (+0200) Subject: Install types.db into PKGDATADIR instead of PKGLIBDIR. X-Git-Tag: collectd-4.6.0~162^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=eb78f4965a6a2cd25c54ffb832f5e42744d968ad;p=collectd.git Install types.db into PKGDATADIR instead of PKGLIBDIR. The FHS specifies that /usr/share should be used to store architecture independent data while /usr/lib includes object files, libraries and architecture dependent data. --- diff --git a/contrib/exec-munin.px b/contrib/exec-munin.px index 223a8a5e..9163730c 100755 --- a/contrib/exec-munin.px +++ b/contrib/exec-munin.px @@ -59,7 +59,7 @@ the C plugin above provides C and C which are both voltages, you can use a hyphen to add a "type instance" to the type. For a list of already defined "types" look at the F file in -collectd's library path, e.Eg. F. +collectd's shared data directory, e.Eg. F. =item B I diff --git a/contrib/fedora/collectd.spec b/contrib/fedora/collectd.spec index 89ce1237..35eb8bec 100644 --- a/contrib/fedora/collectd.spec +++ b/contrib/fedora/collectd.spec @@ -232,7 +232,7 @@ exit 0 %attr(0644,root,root) %{_libdir}/%{name}/wireless.so* %attr(0644,root,root) %{_libdir}/%{name}/wireless.la -%attr(0644,root,root) %{_libdir}/%{name}/types.db +%attr(0644,root,root) %{_datadir}/%{name}/types.db %dir /var/lib/collectd diff --git a/contrib/redhat/collectd.conf b/contrib/redhat/collectd.conf index 7a026fac..0aaaee31 100644 --- a/contrib/redhat/collectd.conf +++ b/contrib/redhat/collectd.conf @@ -9,7 +9,7 @@ FQDNLookup true BaseDir "/var/lib/collectd" PIDFile "/var/run/collectd.pid" PluginDir "/usr/lib/collectd" -TypesDB "/usr/lib/collectd/types.db" +TypesDB "/usr/share/collectd/types.db" Interval 10 ReadThreads 5 diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec index bce76473..62acc184 100644 --- a/contrib/redhat/collectd.spec +++ b/contrib/redhat/collectd.spec @@ -85,7 +85,7 @@ cp contrib/redhat/collectd.conf $RPM_BUILD_ROOT/etc/collectd.conf sed -i 's:#BaseDir "/usr/var/lib/collectd":BaseDir "/var/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf sed -i 's:#PIDFile "/usr/var/run/collectd.pid":PIDFile "/var/run/collectd.pid":' $RPM_BUILD_ROOT/etc/collectd.conf sed -i 's:#PluginDir "/usr/lib/collectd":PluginDir "/usr/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf -sed -i 's:#TypesDB "/usr/lib/collectd/types.db":TypesDB "/usr/lib/collectd/types.db":' $RPM_BUILD_ROOT/etc/collectd.conf +sed -i 's:#TypesDB "/usr/share/collectd/types.db":TypesDB "/usr/share/collectd/types.db":' $RPM_BUILD_ROOT/etc/collectd.conf sed -i 's:#Interval 10:Interval 10:' $RPM_BUILD_ROOT/etc/collectd.conf sed -i 's:#ReadThreads 5:ReadThreads 5:' $RPM_BUILD_ROOT/etc/collectd.conf ##Move config contribs @@ -247,7 +247,7 @@ exit 0 %attr(0644,root,root) %{_libdir}/%{name}/wireless.so* %attr(0644,root,root) %{_libdir}/%{name}/wireless.la -%attr(0644,root,root) %{_libdir}/%{name}/types.db +%attr(0644,root,root) %{_datadir}/%{name}/types.db %exclude %{_libdir}/perl5/5.8.8/%{_arch}-linux-thread-multi/perllocal.pod %attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/Collectd.pm diff --git a/src/Makefile.am b/src/Makefile.am index cd50eea1..87401983 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -868,7 +868,7 @@ install-exec-hook: else \ $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \ fi; \ - cp -f $(srcdir)/types.db $(DESTDIR)$(pkglibdir)/; $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db; $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \ $(DESTDIR)$(pkgdatadir)/postgresql_default.conf; diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 28004afa..cdbef5a1 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -9,7 +9,7 @@ FQDNLookup true #BaseDir "@prefix@/var/lib/@PACKAGE_NAME@" #PIDFile "@prefix@/var/run/@PACKAGE_NAME@.pid" #PluginDir "@prefix@/lib/@PACKAGE_NAME@" -#TypesDB "@prefix@/lib/@PACKAGE_NAME@/types.db" +#TypesDB "@prefix@/share/@PACKAGE_NAME@/types.db" #Interval 10 #ReadThreads 5 diff --git a/src/configfile.c b/src/configfile.c index 9609086f..ca0cafeb 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -891,7 +891,7 @@ int cf_read (char *filename) /* Read the default types.db if no `TypesDB' option was given. */ if (cf_default_typesdb) - read_types_list (PLUGINDIR"/types.db"); + read_types_list (PKGDATADIR"/types.db"); return (0); } /* int cf_read */ diff --git a/src/types.db.pod b/src/types.db.pod index f0a49f6b..11c7f794 100644 --- a/src/types.db.pod +++ b/src/types.db.pod @@ -29,9 +29,10 @@ happen. See L for more details. =head1 FILES The location of the types.db file is defined by the B configuration -option (see L). If you want to specify custom data-sets, you -should do so by using a custom file specified as an additional argument to the -B option. +option (see L). It defaults to collectd's shared data +directory, i.Ee. F/share/collectd/>. If you want to specify +custom data-sets, you should do so by using a custom file specified as an +additional argument to the B option. =head1 SEE ALSO