Code

Fixed bugs that prevented to "make distcheck"
authorYves Mettier <ymettier@free.fr>
Mon, 17 Sep 2012 13:46:24 +0000 (15:46 +0200)
committerFlorian Forster <octo@collectd.org>
Tue, 25 Sep 2012 09:57:34 +0000 (11:57 +0200)
Fixes Github issue #132.

Signed-off-by: Florian Forster <octo@collectd.org>
bindings/Makefile.am
src/Makefile.am

index 69312fd1a1e36ebd0915e4c18f30e61226621e4a..3876cc2c06d3f6ae70b08243cd18343b1c3f5a6f 100644 (file)
@@ -10,28 +10,55 @@ EXTRA_DIST = perl/Makefile.PL \
             perl/lib/Collectd/Plugins/Monitorus.pm \
             perl/lib/Collectd/Plugins/OpenVZ.pm
 
+CLEANFILES = \
+       buildperl/Collectd.pm \
+       buildperl/Collectd/Plugins/OpenVZ.pm \
+       buildperl/Collectd/Unixsock.pm \
+       buildperl/Makefile.PL \
+       .perl-directory-stamp
+
+DISTCLEANFILES = \
+       buildperl/Collectd.pm \
+       buildperl/Collectd/Plugins/OpenVZ.pm \
+       buildperl/Collectd/Unixsock.pm \
+       buildperl/Makefile.PL \
+       .perl-directory-stamp
+
 all-local: @PERL_BINDINGS@
 
+
 install-exec-local:
-       [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) install )
+       [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install )
+
+# Perl 'make uninstall' does not work as well as wanted.
+# So we do the work here.
+uninstall-local:
+       rm -f $(DESTDIR)$(mandir)/man3/Collectd::Unixsock.3pm
+       rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd.pm
+       rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Plugins/OpenVZ.pm
+       rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Unixsock.pm
+       rm -f $(DESTDIR)$(prefix)/lib64/perl5/perllocal.pod
+       rm -f $(DESTDIR)$(prefix)/lib64/perl5/auto/Collectd/.packlist
 
 clean-local:
-       [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) realclean )
+       rm -rf buildperl
 
-perl: perl/Makefile
-       cd perl && $(MAKE)
+perl: buildperl/Makefile
+       cd buildperl && $(MAKE)
 
-perl/Makefile: .perl-directory-stamp perl/Makefile.PL \
+buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
        $(top_builddir)/config.status
-       cd perl && @PERL@ Makefile.PL INSTALL_BASE=$(prefix) @PERL_BINDINGS_OPTIONS@
+       cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(prefix) @PERL_BINDINGS_OPTIONS@
+
+buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
 
 .perl-directory-stamp:
-       if test ! -d perl; then \
-         mkdir -p perl/Collectd/Plugins; \
-         cp $(srcdir)/perl/Collectd.pm perl/; \
-         cp $(srcdir)/perl/Makefile.PL perl/; \
-         cp $(srcdir)/perl/Collectd/Unixsock.pm perl/Collectd/; \
-         cp $(srcdir)/perl/Collectd/Plugins/OpenVZ.pm perl/Collectd/Plugins/; \
+       if test ! -d buildperl; then \
+         mkdir -p buildperl/Collectd/Plugins; \
+         cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \
+         cp $(srcdir)/perl/Makefile.PL buildperl/; \
+         cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \
+         cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \
        fi
        touch $@
 
index 29aac6a96171cf257b6f13e7d0f51620db629e26..59f1d257e2402fa064f731c086264c94731ea11a 100644 (file)
@@ -1265,3 +1265,8 @@ install-exec-hook:
        $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
        $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
                $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
+
+uninstall-hook:
+       rm -f $(DESTDIR)$(pkgdatadir)/types.db;
+       rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
+       rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;