diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..f8c349b --- /dev/null +++ b/info.yml @@ -0,0 +1,23 @@ +name: ntp +description: Network Time Protocol implementation +version: 4.2.8p18 +revision: 3 +url: https://www.ntp.org/ +license: custom +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +keep: + - etc/ntp.conf +depends: + - libcap + - libedit + - openssl + - perl + - sysusers +downloads: + - url: https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${BPM_PKG_VERSION%.*}/ntp-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: cf84c5f3fb1a295284942624d823fffa634144e096cfc4f9969ac98ef5f468e5 diff --git a/pkg.info b/pkg.info deleted file mode 100644 index 5f47742..0000000 --- a/pkg.info +++ /dev/null @@ -1,10 +0,0 @@ -name: ntp -description: Network Time Protocol implementation -version: 4.2.8p18 -revision: 2 -url: https://www.ntp.org/ -license: custom -architecture: any -depends: ["libcap","libedit","openssl","perl","sysusers"] -keep: ["etc/ntp.conf"] -type: source diff --git a/source.sh b/recipe.sh similarity index 68% rename from source.sh rename to recipe.sh index 09de78f..5227888 100644 --- a/source.sh +++ b/recipe.sh @@ -1,18 +1,16 @@ -# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${BPM_PKG_VERSION%.*}/ntp-${BPM_PKG_VERSION}.tar.gz" -FILENAME="${DOWNLOAD##*/}" - # The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" + # Fix errors + sed -i 's/getclock/getclock memchr/' sntp/m4/ntp_libntp.m4 + sed -i 's/pthread_detach(NULL)/pthread_detach(0)/' sntp/m4/openldap-thread-check.m4 - # Fix pthread_detach configure error - sed -e "s;pthread_detach(NULL);pthread_detach(0);" -i "$BPM_SOURCE"/configure "$BPM_SOURCE"/sntp/configure + autoreconf -fi } # The build function is executed in the source directory @@ -29,12 +27,6 @@ build() { make } -# The check function is executed in the source directory -# This function is used to run tests to verify the package has been compiled correctly -check() { - make check -} - # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { diff --git a/source-files/ntp-4.2.8.p18-fix-build.patch b/source-files/ntp-4.2.8.p18-fix-build.patch new file mode 100644 index 0000000..1fc2df2 --- /dev/null +++ b/source-files/ntp-4.2.8.p18-fix-build.patch @@ -0,0 +1,16 @@ +diff -Nru a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4 +--- a/sntp/m4/openldap-thread-check.m4 2024-05-19 18:38:30 +0000 ++++ b/sntp/m4/openldap-thread-check.m4 2024-05-19 18:38:30 +0000 +@@ -262,10 +262,8 @@ + dnl save the flags + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include +-#ifndef NULL +-#define NULL (void*)0 +-#endif +-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no]) ++pthread_t thread; ++]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no]) + ]) + + if test $ol_cv_func_pthread_detach = no ; then