From fcc7645b094e904cfb57ce5eb9e7515ad12b420f Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 14 Apr 2024 09:13:25 +0200 Subject: [PATCH] Changes for deployment --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++++--- .github/workflows/build_freebsd.yml | 2 +- .github/workflows/build_shared.yml | 2 +- Makefile.am | 23 +++++++++------------ common/Makefile.am | 13 ++++++------ configure.ac | 2 +- include/Makefile.am | 14 ++++++------- libcpath/Makefile.am | 14 ++++++------- m4/libcerror.m4 | 4 ++-- m4/libclocale.m4 | 4 ++-- m4/libcsplit.m4 | 4 ++-- m4/libuna.m4 | 4 ++-- manuals/Makefile.am | 6 ++---- msvscpp/Makefile.am | 6 ++---- synclibs.sh | 11 +++++----- tests/Makefile.am | 10 ++++------ tests/test_library.sh | 9 +++------ tests/test_manpage.sh | 9 +++------ 18 files changed, 86 insertions(+), 82 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a0fe34..1a9a3f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -39,6 +39,30 @@ jobs: - name: Run tests run: | tests/runtests.sh + build_dist: + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - architecture: 'x64' + compiler: 'gcc' + configure_options: '' + steps: + - uses: actions/checkout@v4 + - name: Install build dependencies + run: | + sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config + - name: Download test data + run: | + if test -x "synctestdata.sh"; then ./synctestdata.sh; fi + - name: Building from source + env: + CC: ${{ matrix.compiler }} + run: | + tests/build.sh ${{ matrix.configure_options }} + - name: Run tests + run: | + make distcheck coverage_ubuntu: runs-on: ubuntu-22.04 strategy: @@ -51,7 +75,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -72,6 +96,7 @@ jobs: (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \ done - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: name: linux-${{ matrix.architecture }}-gcc-no-optimization + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/build_freebsd.yml b/.github/workflows/build_freebsd.yml index 53b87c8..b0b664c 100644 --- a/.github/workflows/build_freebsd.yml +++ b/.github/workflows/build_freebsd.yml @@ -6,7 +6,7 @@ jobs: build_freebsd: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Building from source id: build_freebsd uses: vmactions/freebsd-vm@v1 diff --git a/.github/workflows/build_shared.yml b/.github/workflows/build_shared.yml index d0bff2f..44031f0 100644 --- a/.github/workflows/build_shared.yml +++ b/.github/workflows/build_shared.yml @@ -17,7 +17,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config diff --git a/Makefile.am b/Makefile.am index 893e033..8e2fede 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,8 +41,15 @@ EXTRA_DIST = \ $(PKGCONFIG_FILES) \ $(SPEC_FILES) -MAINTAINERCLEANFILES = \ - Makefile.in +DISTCLEANFILES = \ + config.status \ + config.cache \ + config.log \ + libcpath.pc \ + libcpath.spec \ + Makefile \ + Makefile.in \ + po/Makevars pkgconfigdir = $(libdir)/pkgconfig @@ -63,15 +70,3 @@ library: cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS) cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS) -distclean: clean - -rm -f Makefile - -rm -f config.status - -rm -f config.cache - -rm -f config.log - -rm -f libcpath.pc - -rm -f libcpath.spec - @for dir in ${subdirs}; do \ - (cd $$dir && $(MAKE) distclean) \ - || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" - diff --git a/common/Makefile.am b/common/Makefile.am index 2433a75..18c6783 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = \ + -I../include -I../include -I$(top_srcdir)/include EXTRA_DIST = \ byte_stream.h \ @@ -15,11 +16,9 @@ EXTRA_DIST = \ types.h.in \ wide_string.h -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + config.h \ + types.h \ + Makefile \ Makefile.in -distclean: clean - -rm -f config.h - -rm -f types.h - -rm -f Makefile - diff --git a/configure.ac b/configure.ac index 16f5193..8b5ca90 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libcpath], - [20240326], + [20240414], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/include/Makefile.am b/include/Makefile.am index ec6a695..10d722f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -15,13 +15,11 @@ EXTRA_DIST = \ libcpath/features.h.in \ libcpath/types.h.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + libcpath.h \ + libcpath/definitions.h \ + libcpath/features.h \ + libcpath/types.h \ + Makefile \ Makefile.in -distclean: clean - -rm -f libcpath.h - -rm -f libcpath/definitions.h - -rm -f libcpath/features.h - -rm -f libcpath/types.h - -rm -f Makefile - diff --git a/libcpath/Makefile.am b/libcpath/Makefile.am index 766ceb3..8feed1f 100644 --- a/libcpath/Makefile.am +++ b/libcpath/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @@ -36,14 +36,12 @@ EXTRA_DIST = \ libcpath.rc \ libcpath.rc.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + libcpath_definitions.h \ + libcpath.rc \ + Makefile \ Makefile.in -distclean: clean - -rm -f libcpath_definitions.h - -rm -f libcpath.rc - -rm -f Makefile - sources-local: $(BUILT_SOURCES) splint-local: diff --git a/m4/libcerror.m4 b/m4/libcerror.m4 index 87af3e1..e9abcdb 100644 --- a/m4/libcerror.m4 +++ b/m4/libcerror.m4 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20240314 +dnl Version: 20240413 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -169,7 +169,7 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LOCAL], ]) ]) - ac_cv_libcerror_CPPFLAGS="-I../libcerror"; + ac_cv_libcerror_CPPFLAGS="-I../libcerror -I\$(top_srcdir)/libcerror"; ac_cv_libcerror_LIBADD="../libcerror/libcerror.la"; ac_cv_libcerror=local diff --git a/m4/libclocale.m4 b/m4/libclocale.m4 index 2410981..bd5a10e 100644 --- a/m4/libclocale.m4 +++ b/m4/libclocale.m4 @@ -1,6 +1,6 @@ dnl Checks for libclocale required headers and functions dnl -dnl Version: 20240314 +dnl Version: 20240413 dnl Function to detect if libclocale is available dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -223,7 +223,7 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LOCAL], AX_LIBCLOCALE_CHECK_FUNC_LANGINFO_CODESET - ac_cv_libclocale_CPPFLAGS="-I../libclocale"; + ac_cv_libclocale_CPPFLAGS="-I../libclocale -I\$(top_srcdir)/libclocale"; ac_cv_libclocale_LIBADD="../libclocale/libclocale.la"; ac_cv_libclocale=local diff --git a/m4/libcsplit.m4 b/m4/libcsplit.m4 index dc3ed8b..1ac7b9f 100644 --- a/m4/libcsplit.m4 +++ b/m4/libcsplit.m4 @@ -1,6 +1,6 @@ dnl Checks for libcsplit required headers and functions dnl -dnl Version: 20240314 +dnl Version: 20240413 dnl Function to detect if libcsplit is available dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -181,7 +181,7 @@ dnl Function to detect if libcsplit dependencies are available AC_DEFUN([AX_LIBCSPLIT_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libcsplit_CPPFLAGS="-I../libcsplit"; + ac_cv_libcsplit_CPPFLAGS="-I../libcsplit -I\$(top_srcdir)/libcsplit"; ac_cv_libcsplit_LIBADD="../libcsplit/libcsplit.la"; ac_cv_libcsplit=local diff --git a/m4/libuna.m4 b/m4/libuna.m4 index bb02abd..996ac60 100644 --- a/m4/libuna.m4 +++ b/m4/libuna.m4 @@ -1,6 +1,6 @@ dnl Checks for libuna or required headers and functions dnl -dnl Version: 20240314 +dnl Version: 20240413 dnl Function to detect if a specific libuna definition is available. AC_DEFUN([AX_LIBUNA_CHECK_DEFINITION], @@ -976,7 +976,7 @@ dnl Function to detect if libuna dependencies are available AC_DEFUN([AX_LIBUNA_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libuna_CPPFLAGS="-I../libuna"; + ac_cv_libuna_CPPFLAGS="-I../libuna -I\$(top_srcdir)/libuna"; ac_cv_libuna_LIBADD="../libuna/libuna.la"; ac_cv_libuna=local diff --git a/manuals/Makefile.am b/manuals/Makefile.am index 331918b..b0e60ff 100644 --- a/manuals/Makefile.am +++ b/manuals/Makefile.am @@ -4,9 +4,7 @@ man_MANS = \ EXTRA_DIST = \ libcpath.3 -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/msvscpp/Makefile.am b/msvscpp/Makefile.am index 3a8d425..7dafada 100644 --- a/msvscpp/Makefile.am +++ b/msvscpp/Makefile.am @@ -13,9 +13,7 @@ MSVSCPP_FILES = \ EXTRA_DIST = \ $(MSVSCPP_FILES) -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/synclibs.sh b/synclibs.sh index 02574c7..ab2f502 100755 --- a/synclibs.sh +++ b/synclibs.sh @@ -1,7 +1,7 @@ #!/bin/sh # Script that synchronizes the local library dependencies # -# Version: 20231023 +# Version: 20240414 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -95,10 +95,11 @@ endif d } -/distclean: clean/ { +/DISTCLEANFILES = / { n - N - d + /${LOCAL_LIB}_definitions.h/ { + d + } }"; echo "${SED_SCRIPT}" >> ${LOCAL_LIB}-$$.sed; sed -i'~' -f ${LOCAL_LIB}-$$.sed ${LOCAL_LIB_MAKEFILE_AM}; @@ -140,7 +141,7 @@ SED_SCRIPT="/^$/ { then if ! test -f "m4/libuna.m4"; then - sed -i'~' 's?@LIBUNA_CPPFLAGS@?-I$(top_srcdir)/libuna?' ${LOCAL_LIB_MAKEFILE_AM}; + sed -i'~' 's?@LIBUNA_CPPFLAGS@?-I../libuna -I$(top_srcdir)/libuna?' ${LOCAL_LIB_MAKEFILE_AM}; fi fi diff --git a/tests/Makefile.am b/tests/Makefile.am index ba540cb..7b3bfb5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @@ -67,9 +67,7 @@ cpath_test_system_string_LDADD = \ ../libcpath/libcpath.la \ @LIBCERROR_LIBADD@ -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/tests/test_library.sh b/tests/test_library.sh index d6c72b5..f240bc5 100755 --- a/tests/test_library.sh +++ b/tests/test_library.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests library functions and types. # -# Version: 20231007 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -141,12 +141,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then diff --git a/tests/test_manpage.sh b/tests/test_manpage.sh index 4abb656..b5fafd7 100755 --- a/tests/test_manpage.sh +++ b/tests/test_manpage.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests man pages. # -# Version: 20230410 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -45,12 +45,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then