From a17a4821ac20e46aa2289168596535a8ead01db1 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 29 Jul 2017 20:18:19 +0200 Subject: Fix make distcheck Add all headers to _SOURCES Cleanup update-mime-database (and c.o.) and disable them for distcheck as they leave files after uninstall --- Makefile.am | 2 ++ configure.ac | 12 ++++++++++++ data/Makefile.am | 30 +++++++++++++++++++++++++++--- src/Makefile.am | 34 +++++++++++++++++++++++----------- test/Makefile.am | 20 ++++++++++---------- 5 files changed, 74 insertions(+), 24 deletions(-) diff --git a/Makefile.am b/Makefile.am index 50d865f..5400d59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,6 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \ config.sub configure depcomp install-sh ltmain.sh \ missing config.rpath mkinstalldirs compile +DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb + SUBDIRS = src data test diff --git a/configure.ac b/configure.ac index fdf8800..2d7c041 100644 --- a/configure.ac +++ b/configure.ac @@ -166,8 +166,20 @@ AS_IF([test x$qt_check = xyes], ]) AM_CONDITIONAL([HAVE_QT],[test "x$have_qt" = "x1"]) + AM_CONDITIONAL([HAVE_GUI],[test "x$have_gtk" = "x1" -o "x$have_qt" = "x1"]) +AC_ARG_ENABLE([update-mimedb], + [AC_HELP_STRING([--disable-update-mimedb], [disable the update-mime-database after install])], + [enable_update_mimedb=$enableval], + [enable_update_mimedb=yes]) +AM_CONDITIONAL([ENABLE_UPDATE_MIMEDB], [test "x$enable_update_mimedb" = "xyes"]) +AS_IF([test "x$have_gtk" = "x1" -o "x$have_qt" = "x1"], + [AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no]) + AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])]) +AS_IF([test "x$have_gtk" = "x1"], + [AC_PATH_PROG([GTK_UPDATE_ICON_CACHE], [gtk-update-icon-cache], [no])]) + # Finish up AC_CONFIG_HEADERS([src/config.h]) diff --git a/data/Makefile.am b/data/Makefile.am index 00b1478..c54614f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -17,8 +17,21 @@ Applicationicon_DATA += tp-monitor.png Applicationmime_DATA += tp-monitor.xml install-data-hook: - -update-mime-database -n $(datadir)/mime - -update-desktop-database $(Applicationdir) +if ENABLE_UPDATE_MIMEDB + @if $(AM_V_P); then set -x; else echo " INSTALL update-mime-database"; fi; \ + $(UPDATE_MIME_DATABASE) -n "$(datadir)/mime" + @if $(AM_V_P); then set -x; else echo " INSTALL update-desktop-database"; fi; \ + $(UPDATE_DESKTOP_DATABASE) "$(Applicationdir)" +endif + +uninstall-hook: +if ENABLE_UPDATE_MIMEDB + @if $(AM_V_P); then set -x; else echo " UNINSTALL update-mime-database"; fi; \ + $(UPDATE_MIME_DATABASE) "$(datadir)/mime" + @if $(AM_V_P); then set -x; else echo " UNINSTALL update-desktop-database"; fi; \ + $(UPDATE_DESKTOP_DATABASE) "$(Applicationdir)" +endif + endif if HAVE_GTK @@ -28,10 +41,21 @@ Application_DATA += tp-monitor-gtk.desktop .PHONY: install-data-gtk-hook install-data-gtk-hook: - -gtk-update-icon-cache $(datadir)/icons/hicolor +if ENABLE_UPDATE_MIMEDB + @if $(AM_V_P); then set -x; else echo " INSTALL gtk-update-icon-cache"; fi; \ + -$(GTK_UPDATE_ICON_CACHE) "$(datadir)/icons/hicolor" +endif + +uninstall-gtk-hook: +if ENABLE_UPDATE_MIMEDB + @if $(AM_V_P); then set -x; else echo " UNINSTALL gtk-update-icon-cache"; fi; \ + -$(GTK_UPDATE_ICON_CACHE) "$(datadir)/icons/hicolor" +endif install-data-hook: install-data-gtk-hook +uninstall-hook: uninstall-gtk-hook + endif if HAVE_QT diff --git a/src/Makefile.am b/src/Makefile.am index 07ce35f..4aaf8b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,18 +27,22 @@ tp_LDADD += libmitm.a @SSL_LIBS@ endif tp_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' @THREAD_CFLAGS@ -libproxy_a_SOURCES = proxy.cc resolver.cc logger.cc +libproxy_a_SOURCES = proxy.cc proxy.hh resolver.cc resolver.hh \ + logger.cc logger.hh libproxy_a_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' @THREAD_CFLAGS@ -libtp_a_SOURCES = args.cc xdg.cc terminal.cc http.cc url.cc paths.cc \ - character.cc config.cc strings.cc io.cc looper.cc \ - buffer.cc chunked.cc package.cc +libtp_a_SOURCES = args.cc args.hh xdg.cc xdg.hh terminal.cc terminal.hh \ + http.cc http.hh url.cc url.hh paths.cc paths.hh \ + character.cc character.hh config.cc config.hh \ + strings.cc strings.hh io.cc io.hh looper.cc looper.hh \ + buffer.cc buffer.hh chunked.cc chunked.hh \ + package.cc package.hh data.hh common.hh if !HAVE_SSL libtp_a_SOURCES += mitm_stub.cc endif libtp_a_CXXFLAGS = $(AM_CXXFLAGS) -DSYSCONFDIR='"@SYSCONFDIR@"' -libmitm_a_SOURCES = mitm.cc +libmitm_a_SOURCES = mitm.cc mitm.hh ssl.hh lru.hh if HAVE_MBEDTLS libmitm_a_SOURCES += ssl_mbedtls.cc endif @@ -47,23 +51,31 @@ libmitm_a_SOURCES += ssl_openssl.cc endif libmitm_a_CXXFLAGS = $(AM_CXXFLAGS) @SSL_CFLAGS@ -tp_genca_SOURCES = genca.cc logger.cc +tp_genca_SOURCES = genca.cc logger.cc logger.hh tp_genca_LDADD = libmitm.a libtp.a @SSL_LIBS@ tp_genca_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' -libmonitor_a_SOURCES = monitor.cc gui_hexdump.cc +libmonitor_a_SOURCES = monitor.cc monitor.hh gui_hexdump.cc gui_hexdump.hh libmonitor_a_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' @THREAD_CFLAGS@ -tp_monitor_SOURCES = monitor-cmd.cc resolver.cc \ - gui_plainattrtext.cc gui_attrtext.cc +tp_monitor_SOURCES = monitor-cmd.cc ios_save.hh resolver.cc resolver.hh \ + gui_plainattrtext.cc gui_plainattrtext.hh \ + gui_attrtext.cc gui_attrtext.hh tp_monitor_LDADD = libmonitor.a libtp.a @THREAD_LIBS@ tp_monitor_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' @THREAD_CFLAGS@ -libmonitor_gui_a_SOURCES = monitor-gui.cc gui_config.cc +libmonitor_gui_a_SOURCES = monitor-gui.cc gui_config.cc gui_config.hh \ + gui_about.hh gui_file.hh gui_main.hh \ + gui_window.hh gui_formapply.hh gui_menu.hh \ + gui_statusbar.hh gui_form.hh gui_listmodel.hh \ + gui_message.hh gui_textwnd.hh + libmonitor_gui_a_CXXFLAGS = $(AM_CXXFLAGS) -DVERSION='"@VERSION@"' \ @THREAD_CFLAGS@ @PCAP_CFLAGS@ -libattrstr_a_SOURCES = gui_attrtext.cc gui_htmlattrtext.cc +libattrstr_a_SOURCES = gui_attrtext.cc gui_attrtext.hh \ + gui_htmlattrtext.cc gui_htmlattrtext.hh \ + observers.hh tp_monitor_gtk_SOURCES = gui_gtk.cc tp_monitor_gtk_LDADD = libmonitor_gui.a libattrstr.a libproxy.a libmonitor.a \ diff --git a/test/Makefile.am b/test/Makefile.am index 5264665..abc1f9c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,34 +1,34 @@ MAINTAINERCLEANFILES = Makefile.in -AM_CXXFLAGS = @DEFINES@ +AM_CXXFLAGS = @DEFINES@ -I$(top_srcdir)/src TESTS = test-url test-http test-args test-xdg test-paths test-strings \ test-observers test-htmlattrtext test-package check_PROGRAMS = $(TESTS) -test_url_SOURCES = test-url.cc +test_url_SOURCES = test-url.cc test.hh test_url_LDADD = $(top_builddir)/src/libtp.a -test_http_SOURCES = test-http.cc +test_http_SOURCES = test-http.cc test.hh test_http_LDADD = $(top_builddir)/src/libtp.a -test_args_SOURCES = test-args.cc +test_args_SOURCES = test-args.cc test.hh test_args_LDADD = $(top_builddir)/src/libtp.a -test_xdg_SOURCES = test-xdg.cc +test_xdg_SOURCES = test-xdg.cc test.hh test_xdg_LDADD = $(top_builddir)/src/libtp.a -test_strings_SOURCES = test-strings.cc +test_strings_SOURCES = test-strings.cc test.hh test_strings_LDADD = $(top_builddir)/src/libtp.a -test_paths_SOURCES = test-paths.cc +test_paths_SOURCES = test-paths.cc test.hh test_paths_LDADD = $(top_builddir)/src/libtp.a -test_observers_SOURCES = test-observers.cc +test_observers_SOURCES = test-observers.cc test.hh -test_htmlattrtext_SOURCES = test-htmlattrtext.cc +test_htmlattrtext_SOURCES = test-htmlattrtext.cc test.hh test_htmlattrtext_LDADD = $(top_builddir)/src/libattrstr.a -test_package_SOURCES = test-package.cc +test_package_SOURCES = test-package.cc test.hh test_package_LDADD = $(top_builddir)/src/libtp.a -- cgit v1.2.3-70-g09d2