Skip to content

Commit

Permalink
Merge pull request #327 from Kegeruneku/ust_4798/int/4799_upgrade_to_…
Browse files Browse the repository at this point in the history
…cfengine_3_6

Fixes #4798: Switch to CFEngine 3.6.0rc1 for Rudder
  • Loading branch information
Kegeruneku committed May 28, 2014
2 parents 8686d44 + 36a9a58 commit 24803bf
Show file tree
Hide file tree
Showing 16 changed files with 117 additions and 746 deletions.
31 changes: 12 additions & 19 deletions rudder-agent/SOURCES/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,32 @@
.DEFAULT_GOAL := localdepends

RUDDER_VERSION_TO_PACKAGE = <put Rudder version or version-snapshot here>
CFENGINE_RELEASE = 3.5.3
CFENGINE_RELEASE = 3.6.0rc1
FUSION_RELEASE = 2.3.6
TOKYOCABINET_RELEASE = 1.4.48
LMDB_RELEASE = 0.9.11
TMP_DIR := $(shell mktemp -dq /tmp/rudder.XXXXXX)
WGET := $(if $(PROXY), http_proxy=$(PROXY) ftp_proxy=$(PROXY)) /usr/bin/wget -q
PATCH := /usr/bin/patch
FIND := /usr/bin/find

localdepends: ./initial-promises ./detect_os.sh ./files ./fusioninventory-agent ./tokyocabinet-source ./cfengine-source ../debian/rudder-agent.init ../debian/rudder-agent.default ./rudder-agent.cron ../debian/rudder-agent.cron.d
localdepends: ./initial-promises ./detect_os.sh ./files ./fusioninventory-agent ./lmdb-source ./cfengine-source ../debian/rudder-agent.init ../debian/rudder-agent.default ./rudder-agent.cron ../debian/rudder-agent.cron.d
rm -rf $(TMP_DIR)

./cfengine-source: /usr/bin/wget
# Original URL: http://cfengine.com/source-code/download?file=cfengine-$(CFENGINE_RELEASE).tar.gz
$(WGET) -O $(TMP_DIR)/cfengine.tgz http://www.normation.com/tarball/cfengine-$(CFENGINE_RELEASE).tar.gz
tar xzf $(TMP_DIR)/cfengine.tgz -C $(TMP_DIR)
mv $(TMP_DIR)/cfengine-$(CFENGINE_RELEASE) ./cfengine-source
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0001-add-support-for-openvz.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0002-cfengine-report-on-package-removal.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0003-dont-remove-blank-line-in-templates.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0004-partially-revert-a-change-intended-to-alter-the-log.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0005-tiny-optimization-in-safe-open.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0006-fix-failure-to-open-paths-ending-in-a-slash.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0007-fix-incorrect-return-value-for-empty-string-in-safe.patch
$(PATCH) -d ./cfengine-source -p1 < ./patches/cfengine/0008-make-safe-open-treat-trailing-slashes-like-open.patch

./tokyocabinet-source: /usr/bin/wget
# Original URL: http://fallabs.com/tokyocabinet/tokyocabinet-${TOKYOCABINET_RELEASE}.tar.gz
$(WGET) -O $(TMP_DIR)/tokyocabinet.tgz http://www.normation.com/tarball/tokyocabinet-${TOKYOCABINET_RELEASE}.tar.gz
tar xzf $(TMP_DIR)/tokyocabinet.tgz -C $(TMP_DIR)
mv $(TMP_DIR)/tokyocabinet-$(TOKYOCABINET_RELEASE) ./tokyocabinet-source
# No patches to apply

./lmdb-source: /usr/bin/wget
# Original URL: http://ftp.fr.debian.org/debian/pool/main/l/lmdb/lmdb_$(LMDB_RELEASE).orig.tar.xz
$(WGET) -O $(TMP_DIR)/lmdb.tgz http://www.normation.com/tarball/lmdb-$(LMDB_RELEASE).tar.gz
tar xzf $(TMP_DIR)/lmdb.tgz -C $(TMP_DIR)
mv $(TMP_DIR)/lmdb-$(LMDB_RELEASE) ./lmdb-source

./rudder-sources.tar.bz2:
$(WGET) -O rudder-sources.tar.bz2 http://www.rudder-project.org/archives/rudder-sources-${RUDDER_VERSION_TO_PACKAGE}.tar.bz2
$(WGET) -O rudder-sources.tar.bz2 http://www.rudder-project.org/archives/rudder-sources-$(RUDDER_VERSION_TO_PACKAGE).tar.bz2

./rudder-sources: ./rudder-sources.tar.bz2
tar -xjf rudder-sources.tar.bz2
Expand Down Expand Up @@ -140,7 +133,7 @@ localdepends: ./initial-promises ./detect_os.sh ./files ./fusioninventory-agent

localclean:
rm -rf ./cfengine-source
rm -rf ./tokyocabinet-source
rm -rf ./lmdb-source
rm -rf ./initial-promises
rm -rf ./detect_os.sh
rm -f ../debian/rudder-agent.init
Expand Down
4 changes: 2 additions & 2 deletions rudder-agent/SOURCES/filter-reqs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use IPC::Open2;

# This scripts takes at least 2 arguments:
# - 1) the string "true" or "false" to tell us whether to *not* exclude tokyocabinet from list of requires (ie, if argument == false, then exclude it)
# - 1) the string "true" or "false" to tell us whether to *not* exclude LMDB from list of requires (ie, if argument == false, then exclude it)
# - 2) The command and it's arguments to run to auto-detect requirements (original RPM behaviour)
my $dont_exclude_tc = $ARGV[0];
my @command = @ARGV[1 .. $#ARGV];
Expand All @@ -20,6 +20,6 @@
$list =~ s/^perl .*?$//mg;
$list =~ s/^\/opt\/rudder\/bin\/perl.*?$//mg;

$list =~ s/^.*tokyocabinet.*?$//mg unless ($dont_exclude_tc eq "true");
$list =~ s/^.*lmdb.*?$//mg unless ($dont_exclude_tc eq "true");

print $list;
Original file line number Diff line number Diff line change
@@ -1,73 +1,75 @@
diff -Naurw debian/control debian-new/control
--- debian/control 2014-05-02 17:06:59.654516718 +0200
+++ debian/control 2014-05-02 17:06:59.654516718 +0200
@@ -2,7 +2,7 @@ Source: rudder-agent
--- debian/control 2014-05-13 12:20:49.811777659 +0200
+++ debian/control 2014-05-13 12:19:51.151566236 +0200
@@ -2,7 +2,7 @@
Section: admin
Priority: extra
Maintainer: Rudder packaging team <rudder-packaging@rudder-project.org>
-Build-Depends: debhelper (>= 7), libssl-dev, bison, gcc, flex, libpcre3-dev, libtokyocabinet-dev
+Build-Depends: debhelper (>= 7), libssl-dev, bison, gcc, flex, libpcre3-dev, zlib1g-dev, libbz2-dev
-Build-Depends: debhelper (>= 7), libssl-dev, bison, gcc, flex, libpcre3-dev, libpam0g-dev
+Build-Depends: debhelper (>= 7), libssl-dev, bison, gcc, flex, libpcre3-dev, libpam0g-dev, liblmdb-dev
Standards-Version: 3.8.0
Homepage: http://www.rudder-project.org

diff -Naurw debian/postinst debian-new/postinst
--- debian/postinst 2014-05-02 17:06:59.654516718 +0200
+++ debian/postinst 2014-05-02 17:06:59.654516718 +0200
@@ -33,6 +33,9 @@ case "$1" in
fi
fi

+ # Reload library of ldd
+ if [ -e /etc/ld.so.conf.d/rudder.conf ]; then ldconfig; fi
+
# Copy new binaries to workdir, make sure daemons are stopped first

# Set a "lock" to avoid CFEngine being restarted during the upgrade process
diff -Naurw debian/rules debian-new/rules
--- debian/rules 2014-05-02 17:06:59.654516718 +0200
+++ debian/rules 2014-05-02 17:06:59.654516718 +0200
@@ -14,9 +14,16 @@
--- debian/rules 2014-05-13 14:00:36.748017941 +0200
+++ debian/rules 2014-05-13 12:19:51.151566236 +0200
@@ -14,17 +14,9 @@
configure: configure-stamp
configure-stamp:
dh_testdir
+ # dh_prep has been moved from 'install' target since we need to build tokyocabinet first
+ dh_prep
- # dh_prep has been moved from 'install' target since we need to build LMDB first
- dh_prep
# Add here commands to configure the package.
cd SOURCES && ./perl-prepare.sh
- cd SOURCES/cfengine-source && ./configure --prefix=/opt/rudder --with-workdir=/var/rudder/cfengine-community --enable-static=yes --enable-shared=no
+ # Compile Tokyocabinet library and install it in /opt/rudder/lib
+ cd SOURCES/tokyocabinet-source && ./configure --prefix=/opt/rudder
+ cd SOURCES/tokyocabinet-source && make
+ cd SOURCES/tokyocabinet-source && make install DESTDIR=$(CURDIR)/debian/tmp
+ # Prepare CFEngine 3.4.x build with defined path of tokyocabinet library
+ cd SOURCES/cfengine-source && ./configure --prefix=/opt/rudder --with-workdir=/var/rudder/cfengine-community --enable-static=yes --enable-shared=no --with-tokyocabinet=$(CURDIR)/debian/tmp/opt/rudder
- # Compile the LMDB library and install it in /opt/rudder
- # LMDB source code does not know how to create destination folders, do it ourselves
- for i in bin lib include man/man1; do mkdir -p $(CURDIR)/debian/tmp/opt/rudder/$$i; done
- cd SOURCES/lmdb-source/libraries/liblmdb && make
- cd SOURCES/lmdb-source/libraries/liblmdb && make install prefix=/opt/rudder DESTDIR=$(CURDIR)/debian/tmp
- # Prepare CFEngine 3.6.x build with defined path of LMDB
- cd SOURCES/cfengine-source && ./configure --prefix=/opt/rudder --with-workdir=/var/rudder/cfengine-community --enable-static=yes --enable-shared=no --with-lmdb=$(CURDIR)/debian/tmp/opt/rudder
+ cd SOURCES/cfengine-source && ./configure --prefix=/opt/rudder --with-workdir=/var/rudder/cfengine-community --enable-static=yes --enable-shared=no

touch configure-stamp

@@ -47,7 +54,6 @@ clean:
@@ -55,6 +47,7 @@
install: build
dh_testdir
dh_testroot
- dh_prep
+ dh_prep
dh_installdirs

# Add here commands to install the package into debian/tmp
@@ -79,6 +85,9 @@ binary-arch: install
@@ -86,9 +79,6 @@
dh_install --SOURCEDIR=$(CURDIR)/SOURCES initial-promises /opt/rudder/share
# Install an empty uuid.hive file before generating an uuid
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ uuid.hive /opt/rudder/etc/
+ # Install /etc/ld.so.conf.d/rudder.conf in order to use libraries contain
+ # in /opt/rudder/lib like tokyocabinet
+ dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder.conf /etc/ld.so.conf.d
- # Install /etc/ld.so.conf.d/rudder.conf in order to use libraries contain
- # in /opt/rudder/lib like LMDB
- dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder.conf /etc/ld.so.conf.d
# Install a verification script for cron
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ check-rudder-agent /opt/rudder/bin/
# Install script to get local processes on VZ systems
@@ -91,7 +100,7 @@ binary-arch: install
@@ -101,7 +91,7 @@
dh_compress
dh_fixperms
# dh_perl
-# dh_makeshlibs
+ dh_makeshlibs
- dh_makeshlibs
+# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol

diff -Naurw debian/control debian-new/control
--- debian/postinst 2014-05-13 14:12:43.838564255 +0200
+++ debian/postinst 2014-05-13 12:19:51.151566236 +0200
@@ -33,9 +33,6 @@
fi
fi

- # Reload the linker cache (to acknowledge LMDB's presence if needed)
- if [ -e /etc/ld.so.conf.d/rudder.conf ]; then ldconfig; fi
-
# Copy new binaries to workdir, make sure daemons are stopped first

# Set a "lock" to avoid CFEngine being restarted during the upgrade process

This file was deleted.

This file was deleted.

Loading

0 comments on commit 24803bf

Please sign in to comment.