All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kexec-tools 0/7] build enhancements and GitHub workflow
@ 2021-04-02 10:17 Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 1/7] build: create tarball without self-referential hard links Simon Horman
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

This series aimes to:

1. Allow creation of dist tarball without self-referential hard links
2. Add a distckeck target
3. Add a GitHub workflow which to performs basic build testing

A sample run of the workflow can be seen here
https://github.com/horms/kexec-tools/actions/runs/711376088

Simon Horman (7):
  build: create tarball without self-referential hard links
  build: add dist make target
  build: uninstall kexec_test
  build: use DESTDIR in uninstall target
  build: simplify uninstall target
  build: add distcheck target
  github: initial workflow

 .github/workflows/build.yml |  72 ++++++++++++++++++
 Makefile.in                 | 141 +++++++++++++++++-------------------
 configure.ac                |   1 +
 3 files changed, 141 insertions(+), 73 deletions(-)
 create mode 100644 .github/workflows/build.yml

-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 1/7] build: create tarball without self-referential hard links
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 2/7] build: add dist make target Simon Horman
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

The current method of creating the tarball, which is to the hard-link
the source directory to the target directory, results in self-referential
hardlinks which can be observed using tar xf.

This patch resolves this by using an intermediate tarball, held in memory,
which collects files to be distributed. This is then unpacked in the target
directory which is finally packed into the distribution tarball, a file.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index fb01134..a9c779f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -201,14 +201,13 @@ configure: configure.ac
 tarball: $(TARBALL.gz)
 
 $(TARBALL): $(SRCS) $(GENERATED_SRCS)
-	$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
-	$(LN) -s $(srcdir) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(TAR) -c $(SRCS) $(GENERATED_SRCS) | \
+	        $(TAR) -C $(PACKAGE_NAME)-$(PACKAGE_VERSION) -x
 	$(TAR) -cf $@ $(PSRCS)
-	$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
-	$(LN) -sf . $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 	$(TAR) -rf $@ $(PGSRCS)
-	$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
-	@echo $(dist)
+	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 
 $(TARBALL.gz): $(TARBALL)
 	gzip -c < $^ > $@
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 2/7] build: add dist make target
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 1/7] build: create tarball without self-referential hard links Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 3/7] build: uninstall kexec_test Simon Horman
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

This provides a familiar alias for the existing tarball target.
The result is a tar.gz file.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index a9c779f..dc7fb07 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -198,6 +198,8 @@ Makefile: Makefile.in config.status
 configure: configure.ac
 	cd $(srcdir) && autoheader && autoconf && rm -rf autom4te.cache
 
+dist: tarball
+
 tarball: $(TARBALL.gz)
 
 $(TARBALL): $(SRCS) $(GENERATED_SRCS)
@@ -397,4 +399,4 @@ uninstall:
 	done
 
 .PHONY: echo install uninstall all targets uninstall-targets clean dist-clean distclean \
-	maintainer-clean maintainerclean tarball rpm
+	maintainer-clean maintainerclean dist tarball rpm
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 3/7] build: uninstall kexec_test
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 1/7] build: create tarball without self-referential hard links Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 2/7] build: add dist make target Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 4/7] build: use DESTDIR in uninstall target Simon Horman
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

kexec_test is installed but not uninstalled.
Correct this oversight.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index dc7fb07..4fe1016 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -181,15 +181,19 @@ UNINSTALL_KDUMP = $(sbindir)/kdump
 UNINSTALL_KDUMP_MANPAGE = $(mandir)/man8/kdump.8
 UNINSTALL_KEXEC = $(sbindir)/kexec
 UNINSTALL_KEXEC_MANPAGE = $(mandir)/man8/kexec.8
+UNINSTALL_KEXEC_TEST = $(pkglibdir)/kexec_test
 UNINSTALL_VMCORE_DMESG = $(sbindir)/vmcore-dmesg
 UNINSTALL_VMCORE_DMESG_MANPAGE = $(mandir)/man8/vmcore-dmesg.8
 
 TARGETS:=$(BINARIES) $(MAN_PAGES)
 targets: $(TARGETS)
 
+UNINSTALL_TARGETS_i386:=$(UNINSTALL_KEXEC_TEST)
+UNINSTALL_TARGETS_x86_64:=$(UNINSTALL_KEXEC_TEST)
 UNINSTALL_TARGETS:=$(UNINSTALL_KDUMP) $(UNINSTALL_KDUMP_MANPAGE) \
 		   $(UNINSTALL_KEXEC) $(UNINSTALL_KEXEC_MANPAGE) \
-		   $(UNINSTALL_VMCORE_DMESG) $(UNINSTALL_VMCORE_DMESG_MANPAGE)
+		   $(UNINSTALL_VMCORE_DMESG) $(UNINSTALL_VMCORE_DMESG_MANPAGE) \
+		   $(UNINSTALL_TARGETS_$(ARCH))
 uninstall-targets: $(UNINSTALL_TARGETS)
 
 Makefile: Makefile.in config.status
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 4/7] build: use DESTDIR in uninstall target
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
                   ` (2 preceding siblings ...)
  2021-04-02 10:17 ` [PATCH kexec-tools 3/7] build: uninstall kexec_test Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 5/7] build: simplify " Simon Horman
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

For symmetry with the install target, also use DESTDIR in the uninstall
target.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 4fe1016..94e9fd8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -338,67 +338,67 @@ install: $(TARGETS)
 uninstall:
 	UINSTALL_LIST='$(UNINSTALL_TARGETS)'; for file in $$UINSTALL_LIST ; do \
 		if test `$(DIRNAME) $$file` =     "$(sbindir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(bindir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(libexecdir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(datadir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(sysconfdir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(sharedstatedir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(localstatedir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(libdir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(infodir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man1" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man2" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man3" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man4" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man5" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man6" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man7" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(mandir)/man8" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(includedir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(pkgdatadir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(pkglibdir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 		if test `$(DIRNAME) $$file` =     "$(pkgincludedir)" ; then \
-			rm -rf $$file ; \
+			rm -rf $(DESTDIR)/$$file ; \
 		fi; \
 	done
 
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 5/7] build: simplify uninstall target
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
                   ` (3 preceding siblings ...)
  2021-04-02 10:17 ` [PATCH kexec-tools 4/7] build: use DESTDIR in uninstall target Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 6/7] build: add distcheck target Simon Horman
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

This appears to have been copied from some generated code.
Simplify it by rolling repetitive operations into a for loop.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in | 81 +++++++++++------------------------------------------
 1 file changed, 17 insertions(+), 64 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 94e9fd8..1569b42 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -106,6 +106,14 @@ PKGDATADIR=$(DATADIR)/$(PACKAGE_NAME)
 PKGLIBDIR=$(LIBDIR)/$(PACKAGE_NAME)
 PKGINCLUDEIR=$(INCLUDEDIR)/$(PACKAGE_NAME)
 
+ALLOWED_UNINSTALL_DIRS := \
+	$(SBINDIR) \
+	$(sbindir) $(bindir) $(libexecdir) $(datadir) $(sysconfdir) \
+	$(sharedstatedir) $(localstatedir) $(libdir) $(infodir) \
+	$(mandir)/man1 $(mandir)/man2 $(mandir)/man3 $(mandir)/man4 \
+	$(mandir)/man5 $(mandir)/man6 $(mandir)/man7 $(mandir)/man8 \
+	$(includedir) $(pkgdatadir) $(pkglibdir) $(pkgincludedir)
+
 all: targets
 
 # generic build rules
@@ -336,70 +344,15 @@ install: $(TARGETS)
 	done
 
 uninstall:
-	UINSTALL_LIST='$(UNINSTALL_TARGETS)'; for file in $$UINSTALL_LIST ; do \
-		if test `$(DIRNAME) $$file` =     "$(sbindir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(bindir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(libexecdir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(datadir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(sysconfdir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(sharedstatedir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(localstatedir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(libdir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(infodir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man1" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man2" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man3" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man4" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man5" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man6" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man7" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(mandir)/man8" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(includedir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(pkgdatadir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(pkglibdir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
-		if test `$(DIRNAME) $$file` =     "$(pkgincludedir)" ; then \
-			rm -rf $(DESTDIR)/$$file ; \
-		fi; \
+	UINSTALL_LIST='$(UNINSTALL_TARGETS)'; \
+	for file in $$UINSTALL_LIST ; do \
+		DIRS='$(ALLOWED_UNINSTALL_DIRS)'; \
+		for dir in $$DIRS ; do \
+			if test `$(DIRNAME) $$file` = "$$dir" ; then \
+				rm -rf $(DESTDIR)/$$file ; \
+				break ; \
+			fi; \
+		done; \
 	done
 
 .PHONY: echo install uninstall all targets uninstall-targets clean dist-clean distclean \
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 6/7] build: add distcheck target
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
                   ` (4 preceding siblings ...)
  2021-04-02 10:17 ` [PATCH kexec-tools 5/7] build: simplify " Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-02 10:17 ` [PATCH kexec-tools 7/7] github: initial workflow Simon Horman
  2021-04-07 19:26 ` [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

Add distcheck target which aims to exercise build, install and uninstall
using distribution tarball.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 Makefile.in  | 39 ++++++++++++++++++++++++++++++++++++++-
 configure.ac |  1 +
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 1569b42..09bbd5c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -55,6 +55,8 @@ LIBS		= @LIBS@
 
 # Utilities called by the makefiles
 INSTALL		= @INSTALL@
+CHMOD		= @CHMOD@
+CD		= cd
 MKDIR		= @MKDIR@
 RM		= @RM@
 CP		= @CP@
@@ -215,6 +217,8 @@ dist: tarball
 tarball: $(TARBALL.gz)
 
 $(TARBALL): $(SRCS) $(GENERATED_SRCS)
+	[ ! -d $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] || \
+	        $(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 	$(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 	$(TAR) -c $(SRCS) $(GENERATED_SRCS) | \
@@ -255,6 +259,38 @@ dist-clean: clean
 	$(RM) -f include/config.h.in configure $(SPEC)
 	$(RM) -rf autom4te.cache
 
+distuninstallcheck:
+	FOUND=$$(find $(distuninstallcheck_dir) ! -type d) && \
+		[ -z "$$FOUND" ] || { \
+			echo "Unexpeced files found after uninstall:" && \
+			echo "$$FOUND" && \
+			exit 1; }
+
+distcheck: $(TARBALL)
+	[ ! -d $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] || \
+	        $(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(TAR) -xf $(TARBALL)
+	$(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build \
+	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build/sub \
+	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_inst \
+	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_dest
+	$(CHMOD) a-w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build
+	INSTALL_BASE=$$($(CD) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,') &&\
+		DESTDIR="$(PACKAGE_NAME)-$(PACKAGE_VERSION)/_dest" && \
+		$(CD) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build/sub && \
+			../../configure \
+			$(DISTCHECK_CONFIGURE_FLAGS) \
+			--srcdir=../.. --prefix="$$INSTALL_BASE" && \
+		$(MAKE) $(AM_MAKEFLAGS) && \
+		$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" install && \
+		$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" uninstall && \
+		$(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$DESTDIR" \
+			distuninstallcheck
+	$(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+
 install: $(TARGETS)
 	for file in $(TARGETS) ; do \
 		if test `$(DIRNAME) $$file` =     "$(SBINDIR)" ; then \
@@ -355,5 +391,6 @@ uninstall:
 		done; \
 	done
 
-.PHONY: echo install uninstall all targets uninstall-targets clean dist-clean distclean \
+.PHONY: echo install uninstall distuninstallcheck all targets \
+	uninstall-targets clean dist-clean distclean distcheck \
 	maintainer-clean maintainerclean dist tarball rpm
diff --git a/configure.ac b/configure.ac
index 6c8e053..6469fd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,7 @@ AC_SUBST(PURGATORY_EXTRA_CFLAGS, [$PURGATORY_EXTRA_CFLAGS])
 
 dnl Find the helper functions
 AC_PROG_INSTALL
+AC_CHECK_PROG([CHMOD],    chmod,    chmod,    "no", [$PATH])
 AC_CHECK_PROG([MKDIR],    mkdir,    mkdir,    "no", [$PATH])
 AC_CHECK_PROG([RM],       rm,       rm,       "no", [$PATH])
 AC_CHECK_PROG([CP],       cp,       cp,       "no", [$PATH])
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH kexec-tools 7/7] github: initial workflow
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
                   ` (5 preceding siblings ...)
  2021-04-02 10:17 ` [PATCH kexec-tools 6/7] build: add distcheck target Simon Horman
@ 2021-04-02 10:17 ` Simon Horman
  2021-04-07 19:26 ` [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-02 10:17 UTC (permalink / raw)
  To: kexec; +Cc: Simon Horman

Initial github workflow which builds kexec on a range of architectures.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 .github/workflows/build.yml | 72 +++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 .github/workflows/build.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..df35703
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,72 @@
+name: Build
+
+on: push
+
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-20.04
+    strategy:
+      matrix:
+        arch:
+        - arm
+        - arm64
+        - hppa
+        - i686
+        - m68k
+        - mips
+        - mipsel
+        - powerpc
+        - powerpc64
+        - powerpc64le
+        - sh4
+        - s390x
+        - x86_64-x32
+        include:
+          - arch: x86_64
+          - arch: x86_64
+            libxen: libxen
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+
+    - name: Set Environment
+      env:
+        LIBXEN: ${{ matrix.libxen }}
+        ARCH: ${{ matrix.arch }}
+      run: |
+        case $LIBXEN in
+          libxen) EXTRA_PKGS+=" libxen-dev" ;;
+        esac
+
+        case $ARCH in
+          arm)         GNU_ARCH="arm-linux-gnueabi" ;;
+          arm64)       GNU_ARCH="aarch64-linux-gnu" ;;
+          x86_64)      ;;
+          x86_64-x32)  GNU_ARCH="x86_64-linux-gnux32"
+                       CROSS_COMPILER_PKG="gcc-x86-64-linux-gnux32" ;;
+          *)           GNU_ARCH="$ARCH-linux-gnu" ;;
+        esac
+
+        if [ -n "$GNU_ARCH" ]; then
+          if [ -z "$CROSS_COMPILER_PKG" ]; then
+            CROSS_COMPILER_PKG="gcc-$GNU_ARCH"
+          fi
+          EXTRA_PKGS+=" $CROSS_COMPILER_PKG"
+          CONFIG_FLAGS+=" --host=$GNU_ARCH"
+        fi
+
+        echo "EXTRA_PKGS=$EXTRA_PKGS" >> $GITHUB_ENV
+        echo "CONFIG_FLAGS=$CONFIG_FLAGS" >> $GITHUB_ENV
+
+    - name: Install Dependencies
+      if: env.EXTRA_PKGS != ''
+      run: sudo apt-get -q=2 install ${{ env.EXTRA_PKGS }}
+
+    - name: Build
+      run: |
+        ./bootstrap
+        ./configure ${{ env.CONFIG_FLAGS }}
+        make -j"$(nproc)" distcheck \
+          DISTCHECK_CONFIGURE_FLAGS="${{ env.CONFIG_FLAGS }}"
+
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH kexec-tools 0/7] build enhancements and GitHub workflow
  2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
                   ` (6 preceding siblings ...)
  2021-04-02 10:17 ` [PATCH kexec-tools 7/7] github: initial workflow Simon Horman
@ 2021-04-07 19:26 ` Simon Horman
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2021-04-07 19:26 UTC (permalink / raw)
  To: kexec

On Fri, Apr 02, 2021 at 12:17:30PM +0200, Simon Horman wrote:
> This series aimes to:
> 
> 1. Allow creation of dist tarball without self-referential hard links
> 2. Add a distckeck target
> 3. Add a GitHub workflow which to performs basic build testing
> 
> A sample run of the workflow can be seen here
> https://github.com/horms/kexec-tools/actions/runs/711376088

Series applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-07 19:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 10:17 [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 1/7] build: create tarball without self-referential hard links Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 2/7] build: add dist make target Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 3/7] build: uninstall kexec_test Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 4/7] build: use DESTDIR in uninstall target Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 5/7] build: simplify " Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 6/7] build: add distcheck target Simon Horman
2021-04-02 10:17 ` [PATCH kexec-tools 7/7] github: initial workflow Simon Horman
2021-04-07 19:26 ` [PATCH kexec-tools 0/7] build enhancements and GitHub workflow Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.