Blame SOURCES/open-lldp-v1.0.1-17-lldp-automake-fixes-for-dist-distcheck.patch

89f6b3
From c986aa5bc5f509f3cbc033212e0808a992ec48bf Mon Sep 17 00:00:00 2001
89f6b3
From: John Fastabend <john.r.fastabend@intel.com>
89f6b3
Date: Fri, 30 Jan 2015 08:32:07 -0800
89f6b3
Subject: [PATCH] lldp: automake fixes for dist/distcheck
89f6b3
89f6b3
This fixes the dist and distcheck automake targets for making release
89f6b3
archives.
89f6b3
89f6b3
All missing header files that have been added to git are listed in
89f6b3
noinst_HEADERS, so they get added to the release archive but are not
89f6b3
installed.  Some of these ( qgb_vdp22_(cmds|clif).h ) may be part of the
89f6b3
client API and need to be moved to lldpad_include_HEADERS?
89f6b3
89f6b3
The srcdir prefix was removed from references to liblldp_clif.la, it's
89f6b3
not needed and breaks builds where the output dir is different from the
89f6b3
source dir as this is a generated file.
89f6b3
89f6b3
The liblldp_clid-vdp22.3 man page was added.
89f6b3
89f6b3
The qbg22sim and vdptest man pages were added to the release archive,
89f6b3
but still should only be installed if debug is configured.
89f6b3
89f6b3
lldpad.init was added to dist_noinst_DATA to add to the release
89f6b3
89f6b3
The custom systemd unit file install rule was replaced with a dist_DATA
89f6b3
definition, letting automake build the rules to handle them.  Before
89f6b3
they were being left out of the release archive.
89f6b3
89f6b3
Same thing with the bash completion files, just tell automake where they
89f6b3
go.
89f6b3
89f6b3
Compared to git-archive, make dist now gets almost everything.
89f6b3
I left the test data files out for now, even though the binaries and
89f6b3
man pages are being included.
89f6b3
89f6b3
Signed-off-by: Chris Leech <cleech@redhat.com>
89f6b3
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
89f6b3
---
89f6b3
 Makefile.am | 42 ++++++++++++++++++------------------------
89f6b3
 1 file changed, 18 insertions(+), 24 deletions(-)
89f6b3
89f6b3
diff --git a/Makefile.am b/Makefile.am
89f6b3
index 27dffc2..69deda2 100644
89f6b3
--- a/Makefile.am
89f6b3
+++ b/Makefile.am
89f6b3
@@ -43,7 +43,10 @@ include/lldp_8023_clif.h include/lldp_dcbx_clif.h include/lldp_evb_clif.h \
89f6b3
 include/lldp_evb22_clif.h include/qbg_vdp_clif.h include/qbg_vdpnl.h \
89f6b3
 include/qbg_vdp22_clif.h include/lldp_8021qaz_clif.h \
89f6b3
 include/lldp_orgspec_clif.h include/lldp_cisco_clif.h \
89f6b3
-include/lldptool.h include/lldp_rtnl.h include/dcbtool.h include/lldp_dcbx_cfg.h
89f6b3
+include/lldptool.h include/lldp_rtnl.h include/dcbtool.h include/lldp_dcbx_cfg.h \
89f6b3
+include/qbg_vdp22_cmds.h include/qbg_vdp22_clif.h \
89f6b3
+include/linux/ethtool.h include/linux/if_bonding.h include/linux/if_bridge.h \
89f6b3
+include/linux/if.h include/linux/if_link.h include/linux/if_vlan.h
89f6b3
 
89f6b3
 lldpad_SOURCES = lldpad.c config.c lldp_dcbx_nl.c ctrl_iface.c \
89f6b3
 event_iface.c eloop.c lldp_dcbx_cmds.c log.c lldpad_shm.c \
89f6b3
@@ -84,7 +87,7 @@ vdptool_LDFLAGS = -llldp_clif $(LIBNL_LIBS)
89f6b3
 
89f6b3
 dcbtool_SOURCES = dcbtool.c dcbtool_cmds.c parse_cli.l \
89f6b3
 weak_readline.c $(lldpad_include_HEADERS) $(noinst_HEADERS)
89f6b3
-dcbtool_LDADD = ${srcdir}/liblldp_clif.la
89f6b3
+dcbtool_LDADD = liblldp_clif.la
89f6b3
 dcbtool_LDFLAGS = -ldl -llldp_clif
89f6b3
 
89f6b3
 lldptool_SOURCES = lldptool.c lldptool_cmds.c lldp_rtnl.c \
89f6b3
@@ -93,7 +96,7 @@ lldptool_SOURCES = lldptool.c lldptool_cmds.c lldp_rtnl.c \
89f6b3
 		   lldp_8021qaz_clif.c lldp_evb_clif.c qbg/vdp_clif.c \
89f6b3
 		   lldp_orgspec_clif.c lldp_cisco_clif.c lldp_evb22_clif.c \
89f6b3
 		   weak_readline.c $(lldpad_include_HEADERS) $(noinst_HEADERS)
89f6b3
-lldptool_LDADD = ${srcdir}/liblldp_clif.la
89f6b3
+lldptool_LDADD = liblldp_clif.la
89f6b3
 lldptool_LDFLAGS = -ldl -llldp_clif $(LIBNL_LIBS)
89f6b3
 
89f6b3
 if BUILD_DEBUG
89f6b3
@@ -104,14 +107,20 @@ qbg22sim_SOURCES = test/qbg22sim.c
89f6b3
 qbg22sim_LDFLAGS = -lrt
89f6b3
 endif
89f6b3
 
89f6b3
+## put a spec file and documentation in the distribution archive
89f6b3
+dist_noinst_DATA = lldpad.spec README COPYING ChangeLog lldpad.init
89f6b3
+
89f6b3
 ## man pages
89f6b3
 dist_man_MANS = docs/lldpad.8 docs/dcbtool.8 docs/lldptool.8 \
89f6b3
 		docs/lldptool-ets.8 docs/lldptool-pfc.8 docs/lldptool-app.8 \
89f6b3
 		docs/lldptool-evb.8 docs/lldptool-vdp.8 docs/lldptool-med.8 \
89f6b3
 		docs/lldptool-dcbx.8 \
89f6b3
-		docs/lldptool-evb22.8 docs/vdptool.8
89f6b3
+		docs/lldptool-evb22.8 docs/vdptool.8 \
89f6b3
+		docs/liblldp_clif-vdp22.3
89f6b3
 if BUILD_DEBUG
89f6b3
-nodist_man_MANS = test/qbg22sim.1 test/vdptest.1
89f6b3
+dist_man_MANS += test/qbg22sim.1 test/vdptest.1
89f6b3
+else
89f6b3
+dist_noinst_DATA += test/qbg22sim.1 test/vdptest.1
89f6b3
 endif
89f6b3
 
89f6b3
 ## force the creation of an empty configuration directory at install time
89f6b3
@@ -124,24 +133,9 @@ install-data-hook:	installdirs-local
89f6b3
 pkgconfigdir = ${libdir}/pkgconfig
89f6b3
 pkgconfig_DATA = lldpad.pc liblldp_clif.pc
89f6b3
 
89f6b3
-## put a spec file and documentation in the distribution archive
89f6b3
-dist_noinst_DATA = lldpad.spec README COPYING ChangeLog
89f6b3
+systemdsystemunitdir = $(prefix)/lib/systemd/system
89f6b3
+dist_systemdsystemunit_DATA = lldpad.service lldpad.socket
89f6b3
 
89f6b3
-## special hooks to handle the init script
89f6b3
-install-data-local: lldpad.service lldpad.socket
89f6b3
-	$(MKDIR_P) $(DESTDIR)/usr/lib/systemd/system
89f6b3
-	$(INSTALL_DATA) lldpad.service $(DESTDIR)/usr/lib/systemd/system/lldpad.service
89f6b3
-	$(INSTALL_DATA) lldpad.socket $(DESTDIR)/usr/lib/systemd/system/lldpad.socket
89f6b3
-
89f6b3
-BASH_COMPLETION_DIR=/etc/bash_completion.d/
89f6b3
-
89f6b3
-install-data-hook:
89f6b3
-	## provide support for bash completion
89f6b3
-	$(MKDIR_P) $(DESTDIR)/$(BASH_COMPLETION_DIR)
89f6b3
-	$(INSTALL_DATA) ${srcdir}/contrib/bash_completion/* $(DESTDIR)/$(BASH_COMPLETION_DIR)
89f6b3
-
89f6b3
-uninstall-local:
89f6b3
-	rm -f '$(DESTDIR)/usr/lib/systemd/system/lldpad.*'
89f6b3
-	rm -f '$(includedir)/dcbd/clif_cmds.h'
89f6b3
-	rm -f '$(includedir)/dcbd'
89f6b3
+bashcompletiondir = $(sysconfdir)/bash_completion.d
89f6b3
+dist_bashcompletion_DATA = contrib/bash_completion/lldpad contrib/bash_completion/lldptool
89f6b3
 
89f6b3
-- 
89f6b3
2.1.0
89f6b3