cfengine: Bump to 3.20.0

This commit is contained in:
Tee KOBAYASHI 2022-11-14 21:20:53 +09:00 committed by xtkoba
parent e153ffb5d1
commit ecfaa38aa5
4 changed files with 45 additions and 65 deletions

View File

@ -2,42 +2,60 @@ TERMUX_PKG_HOMEPAGE=https://cfengine.com/
TERMUX_PKG_DESCRIPTION="CFEngine is a configuration management technology"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@craigcomstock"
TERMUX_PKG_VERSION=1:3.18.0
TERMUX_PKG_REVISION=6
TERMUX_PKG_SRCURL=(https://github.com/cfengine/core/archive/${TERMUX_PKG_VERSION:2}.zip
https://github.com/cfengine/masterfiles/archive/12b52c25e03439341aa7a6a5c7917efa06826f8d.zip
https://github.com/cfengine/libntech/archive/118d6e4bf5ae2611236fe3883b422d50f10da45c.zip)
TERMUX_PKG_SHA256=(846f4cf2a6154817c730b847cacc6f9aacd32c51abc00c137f56650d85e47134
9372e0c65322dc85c5f6f95be175ac0858c94d5ffb54317e8e332ddac634657a
49e03c1daf913bbe370a56aac03b0d2a7250d108c91b39780487304b3e6ac047)
TERMUX_PKG_DEPENDS="liblmdb, openssl, libandroid-glob, pcre, libyaml, libxml2"
TERMUX_PKG_VERSION=1:3.20.0
TERMUX_PKG_SRCURL=https://github.com/cfengine/core.git
TERMUX_PKG_GIT_BRANCH=${TERMUX_PKG_VERSION#*:}
TERMUX_PKG_DEPENDS="libandroid-glob, liblmdb, libxml2, libyaml, openssl, pcre"
# core doesn't work with out-of-tree builds
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-workdir=$TERMUX_PREFIX/var/lib/cfengine --without-pam --without-selinux-policy --without-systemd-service --with-lmdb=$TERMUX_PREFIX --with-openssl=$TERMUX_PREFIX --with-yaml=$TERMUX_PREFIX --with-pcre=$TERMUX_PREFIX --with-prefix=$TERMUX_PREFIX --with-libxml2=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-workdir=$TERMUX_PREFIX/var/lib/cfengine
--without-pam
--without-selinux-policy
--without-systemd-service
--with-lmdb=$TERMUX_PREFIX
--with-openssl=$TERMUX_PREFIX
--with-yaml=$TERMUX_PREFIX
--with-pcre=$TERMUX_PREFIX
--with-prefix=$TERMUX_PREFIX
--with-libxml2=$TERMUX_PREFIX
"
termux_step_post_get_source() {
# commit-based zips from github include the commit sha so rename to normalize for later steps
mv masterfiles-* masterfiles
rm -rf libntech
mv libntech-* libntech
local _MASTERFILES_VERSION=${TERMUX_PKG_VERSION#*:}
local _MASTERFILES_SRCURL=https://github.com/cfengine/masterfiles/archive/${_MASTERFILES_VERSION}.zip
local _MASTERFILES_SHA256=094f9361f693ad5949d7f9c7634d47104225e08589c72f54f3743e74b41ee4d2
local _MASTERFILES_FILE=${TERMUX_PKG_CACHEDIR}/masterfiles-${_MASTERFILES_VERSION}.zip
termux_download \
${_MASTERFILES_SRCURL} \
${_MASTERFILES_FILE} \
${_MASTERFILES_SHA256}
local d=$(unzip -qql ${_MASTERFILES_FILE} | \
head -n1 | tr -s ' ' | cut -d' ' -f5-)
unzip -q ${_MASTERFILES_FILE}
mv ${d} masterfiles
}
termux_step_pre_configure() {
export EXPLICIT_VERSION=${TERMUX_PKG_VERSION:2}
export LDFLAGS+=" -landroid-glob"
NO_CONFIGURE=1 ./autogen.sh $TERMUX_PKG_EXTRA_CONFIGURE_ARGS --prefix=$TERMUX_PREFIX/var/lib/cfengine --bindir=$TERMUX_PREFIX/bin
export EXPLICIT_VERSION=${TERMUX_PKG_VERSION#*:}
export LDFLAGS+=" -landroid-glob"
NO_CONFIGURE=1 ./autogen.sh
}
cd masterfiles
./autogen.sh --prefix=$TERMUX_PREFIX/var/lib/cfengine --bindir=$TERMUX_PREFIX/bin
make install
termux_step_post_make_install() {
cd masterfiles
./autogen.sh \
--prefix=$TERMUX_PREFIX/var/lib/cfengine \
--bindir=$TERMUX_PREFIX/bin
make install
}
termux_step_create_debscripts() {
cat << EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
# Generate a host key
if [ ! -f $TERMUX_PREFIX/var/lib/cfengine/ppkeys/localhost.priv ]; then
$TERMUX_PREFIX/bin/cf-key >/dev/null || :
fi
EOF
cat <<-EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
# Generate a host key
if [ ! -f $TERMUX_PREFIX/var/lib/cfengine/ppkeys/localhost.priv ]; then
$TERMUX_PREFIX/bin/cf-key >/dev/null || :
fi
EOF
}

View File

@ -1,12 +0,0 @@
diff --git a/cfe_internal/update/update_policy.cf b/cfe_internal/update/update_policy.cf
index 6c71dc577..db0965b5b 100644
--- a/masterfiles/cfe_internal/update/update_policy.cf
+++ b/masterfiles/cfe_internal/update/update_policy.cf
@@ -453,7 +453,7 @@ body perms u_mo(p,o)
# @param p Desired file owner (username or uid)
{
mode => "$(p)";
- !windows::
+ !(windows|termux)::
owners => {"$(o)"};
}

View File

@ -1,13 +0,0 @@
--- ./configure.ac.orig 2022-02-16 15:51:34.491053439 +0530
+++ ./configure.ac 2022-02-16 15:52:01.251053429 +0530
@@ -471,10 +471,6 @@
#endif
]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR(This release of CFEngine requires OpenSSL >= 0.9.7)])
- if test "x$ac_cv_lib_crypto_RSA_generate_key_ex" = "xyes" ; then
- AC_DEFINE(OPENSSL_NO_DEPRECATED, 1, [Define if non deprecated API is available.])
- fi
-
if test "x$ac_cv_lib_crypto_RSA_generate_key_ex" = "xno" && \
test "x$ac_cv_lib_crypto_RSA_generate_key" = "xno" ; then
AC_MSG_ERROR(Cannot find OpenSSL)

View File

@ -1,13 +0,0 @@
--- ./libntech/configure.ac.orig 2022-02-16 15:23:38.630146433 +0530
+++ ./libntech/configure.ac 2022-02-16 15:24:51.014566664 +0530
@@ -385,10 +385,6 @@
#endif
]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR(This release of CFEngine requires OpenSSL >= 0.9.7)])
- if test "x$ac_cv_lib_crypto_RSA_generate_key_ex" = "xyes" ; then
- AC_DEFINE(OPENSSL_NO_DEPRECATED, 1, [Define if non deprecated API is available.])
- fi
-
if test "x$ac_cv_lib_crypto_RSA_generate_key_ex" = "xno" && \
test "x$ac_cv_lib_crypto_RSA_generate_key" = "xno" ; then
AC_MSG_ERROR(Cannot find OpenSSL)