Skip to content

Commit

Permalink
Merge pull request #1520 from larsewi/librsync
Browse files Browse the repository at this point in the history
ENT-12414: Added librsync to deps-packaging
  • Loading branch information
larsewi authored Dec 13, 2024
2 parents 7fb59d0 + 39139a0 commit df66392
Show file tree
Hide file tree
Showing 28 changed files with 56,947 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ File `install-dependencies` and the relevant subdirectories in `deps-packaging`
| [pthreads-w32](ftp://sourceware.org/pub/pthreads-win32/) | 2-9-1 | 2-9-1 | 2-9-1 | Windows Enterprise agent |
| [SASL2](https://cyrusimap.org/mediawiki/index.php/Downloads) | 2.1.28 | 2.1.28 | 2.1.28 | Solaris Enterprise agent |
| [zlib](http://www.zlib.net/) | 1.3.1 | 1.3.1 | 1.3.1 | |
| [librsync](https://github.com/librsync/librsync/releases) | | | 2.3.4 | |
| libgcc | | | | AIX and Solaris only |

### Enterprise Hub dependencies:
Expand Down
1 change: 1 addition & 0 deletions build-scripts/compile-options
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ esac

var_append DEPS "libxml2 libyaml"
var_append DEPS "diffutils"
var_append DEPS "librsync"

# LDAP functions in the agent
# and LDAP authentication functionality in Mission Portal
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ esac

P=$BUILDPREFIX

ARGS="--prefix=$P --libdir=$P/lib --with-workdir=$P --sysconfdir=/etc --with-openssl=$P --with-pcre2=$P --with-init-script"
ARGS="--prefix=$P --libdir=$P/lib --with-workdir=$P --sysconfdir=/etc --with-openssl=$P --with-pcre2=$P --with-librsync=$P --with-init-script"

if [ $EMBEDDED_DB = lmdb ]
then
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/configure-docs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

P=/var/cfengine

ARGS="--prefix=$P --with-openssl=$P --with-pcre2=$P --with-lmdb=$P --enable-docs=all"
ARGS="--prefix=$P --with-openssl=$P --with-pcre2=$P --with-librsync=$P --with-lmdb=$P --enable-docs=all"

cd $BASEDIR/core && env $OPTS ./configure $ARGS
3 changes: 3 additions & 0 deletions ci/cfengine-build-host-setup.cf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ bundle agent cfengine_build_host_setup
"mingw-w64";
(debian_10|debian_11).systemssl_build_host::
"libssl-dev";
debian.bootstrap_pr_host::
"librsync-dev"; # bootstrap_pr host needs this to run configure and make dist

# I attempted to arrange these packages in order of: generic (all versions) and then as if we gradually added them through time: rhel-6, 7, 8, 9...
suse|opensuse|sles|redhat|centos::
Expand Down Expand Up @@ -144,6 +146,7 @@ bundle agent cfengine_build_host_setup
any::
"mingw_build_host" expression => fileexists("/etc/cfengine-mingw-build-host.flag");
"systemssl_build_host" expression => fileexists("/etc/cfengine-systemssl-build-host.flag");
"bootstrap_pr_host" expression => fileexists("/etc/cfengine-bootstrap-pr-host.flag");
debian_9|ubuntu_16|redhat_6|centos_6::
"have_opt_jdk21" expression => fileexists("/opt/jdk-21.0.1");
(redhat|centos).!(redhat_6|centos_6|redhat_7|centos_7)::
Expand Down
151 changes: 151 additions & 0 deletions deps-packaging/librsync/0001-Added-autotools-build-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
From a0685398fbafaff6e3071df134dece4620cf817d Mon Sep 17 00:00:00 2001
From: Lars Erik Wik <lars.erik.wik@northern.tech>
Date: Thu, 7 Nov 2024 14:18:38 +0100
Subject: [PATCH 1/2] Added autotools build system

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
---
Makefile.am | 39 +++++++++++++++++++++++++++++++++++++
bootstrap.sh | 5 +++++
configure.ac | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
librsync.pc.in | 10 ++++++++++
4 files changed, 107 insertions(+)
create mode 100644 Makefile.am
create mode 100755 bootstrap.sh
create mode 100644 configure.ac
create mode 100644 librsync.pc.in

diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ad07dc6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,39 @@
+ACLOCAL_AMFLAGS = -I m4
+
+AM_CPPFLAGS = -Isrc/blake2
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = librsync.pc
+
+include_HEADERS = src/librsync.h src/librsync_export.h
+lib_LTLIBRARIES = librsync.la
+
+librsync_la_SOURCES = \
+ src/base64.c \
+ src/buf.c src/buf.h \
+ src/checksum.c src/checksum.h \
+ src/command.c src/command.h \
+ src/delta.c \
+ src/emit.c src/emit.h \
+ src/fileutil.c \
+ src/hashtable.c src/hashtable.h \
+ src/hex.c \
+ src/job.c src/job.h \
+ src/mdfour.c src/mdfour.h \
+ src/mksum.c \
+ src/msg.c \
+ src/netint.c src/netint.h \
+ src/patch.c \
+ src/prototab.c src/prototab.h \
+ src/rabinkarp.c src/rabinkarp.h \
+ src/readsums.c \
+ src/rollsum.c src/rollsum.h \
+ src/scoop.c src/scoop.h \
+ src/stats.c \
+ src/sumset.c src/sumset.h \
+ src/trace.c src/trace.h \
+ src/tube.c \
+ src/util.c src/util.h \
+ src/version.c \
+ src/whole.c src/whole.h \
+ src/blake2/blake2b-ref.c src/blake2/blake2.h src/blake2/blake2-impl.h
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..93c7b50
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+echo "$0: Running autoreconf ..."
+autoreconf --force --install -I m4 || exit
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..2c15a6a
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,53 @@
+# Copyright (C) 2024 Lars Erik Wik <lars.erik.wik@northern.tech>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63])
+AC_INIT([librsync], [2.3.5], [https://github.com/librsync/librsync/issues])
+AC_CONFIG_SRCDIR([src/librsync.h])
+AC_CONFIG_HEADERS([src/config.h:config.hin])
+AC_CONFIG_MACRO_DIR([m4])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+AM_PROG_AR
+
+LT_INIT
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([fcntl.h inttypes.h stdint.h sys/file.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+
+# Checks for library functions.
+AC_CHECK_FUNCS([memmove memset socket strchr strerror])
+
+AC_CONFIG_FILES([librsync.pc Makefile])
+AC_OUTPUT
diff --git a/librsync.pc.in b/librsync.pc.in
new file mode 100644
index 0000000..831fcfc
--- /dev/null
+++ b/librsync.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: librsync
+Description: A library for calculating and applying network deltas
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lrsync
+Cflags: -I${includedir}
--
2.43.0

Loading

0 comments on commit df66392

Please sign in to comment.