Commit dd914f02 authored by Olivier Mauras's avatar Olivier Mauras Committed by Natanael Copa

testing/cfengine: Update to 3.7.2

parent 973a7bd6
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer:
pkgname=cfengine
pkgver=3.7.2
pkgrel=0
pkgdesc="A systems administration tool for networks"
url="http://www.cfengine.org/"
arch="all"
license="GPLv3"
depends=""
depends_dev=""
makedepends="$depends_dev lmdb-dev openssl-dev bison flex-dev
acl-dev pcre-dev linux-headers"
install=""
subpackages="$pkgname-doc $pkgname-masterfiles"
source="https://cfengine-package-repos.s3.amazonaws.com/tarballs/$pkgname-$pkgver.tar.gz
https://cfengine-package-repos.s3.amazonaws.com/tarballs/$pkgname-masterfiles-$pkgver.tar.gz"
_builddir="$srcdir"/cfengine-${pkgver%_p*}
_builddirmasterfiles="$srcdir"/cfengine-masterfiles-${pkgver%_p*}
prepare() {
local i
cd "$_builddir"
update_config_sub || return 1
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
# Also extract masterfiles
cd $srcdir
tar xf $pkgname-masterfiles-$pkgver.tar.gz
}
build() {
cd "$_builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
--with-pic \
--prefix=/usr \
--enable-fhs \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-lmdb \
|| return 1
make || return 1
}
package() {
cd "$_builddir"
make install DESTDIR="$pkgdir" || return 1
}
masterfiles() {
pkgdesc="Cfengine default masterfiles"
arch="noarch"
depends="cfengine"
cd "$_builddirmasterfiles"
./configure \
--prefix=/var/lib/cfengine \
|| return 1
#make install DESTDIR="$pkgdir/../$pkgname-masterfiles" || return 1
make install DESTDIR="$subpkgdir" || return 1
}
md5sums="aff92abe87a5424680afd285d0384bef cfengine-3.7.2.tar.gz
48335259f199c87c2d7652ed8405f21c cfengine-masterfiles-3.7.2.tar.gz"
sha256sums="aad9ae260864acbdf2aa441c208365460f9a8ecaa53618bbdb465e37aef4ade5 cfengine-3.7.2.tar.gz
ed2026d0deca24e9094ec1d0e84a9488eebd470cc23fec940eadbb7106515bc5 cfengine-masterfiles-3.7.2.tar.gz"
sha512sums="8b4d0dac81cb3734489e3e1d60a034c3074d710f35a6c2ab35cffe9c066a63c3214b062ef4116ff3ef46461c8ce53ebb02c6513cb49f9edf2c9a81f4679066e6 cfengine-3.7.2.tar.gz
e2a6ceba4db90e6b2cd4f30fc2c276012660aca8a76fbd5bbc3debd8e6226cd5f8f270f5936b38e1ccd36cee706fd697bfde5c96739bde38d8c11f4ef3f0f86b cfengine-masterfiles-3.7.2.tar.gz"
# Contributor: Franz Bettag <franz@bett.ag>
# Maintainer:
pkgname=cfengine
pkgver=3.4.4
pkgrel=0
pkgdesc="CFEngine Configuration Management"
url="http://cfengine.com/"
arch="all"
license="GPLv3"
depends=""
makedepends="tokyocabinet-dev openssl-dev pcre-dev acl-dev"
install=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://cfengine.com/source-code/download?file=$pkgname-$pkgver.tar.gz
alpinelinux.patch"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
./configure --prefix=/usr \
--localstatedir=/var \
--enable-fhs \
|| return 1
make all || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
}
md5sums="81d574a6d68f3f0a91f0803349a8b8f5 cfengine-3.4.4.tar.gz
29767a17f46a943bdaebcf8aa0631da9 alpinelinux.patch"
sha256sums="6572609851724ec8fc58c60474742e5907989462020e6c246111c2731adb6a37 cfengine-3.4.4.tar.gz
e294dc92633b2c90cb8f02d86d2269af9150a1333b4134cf9dd1f03500f9da17 alpinelinux.patch"
sha512sums="986070122a0a0d3e15f50181700cbf230c8a91a5458f0b998d32bf10fdacda016e565ec710e589341bc094dd44dcd5da77abfbf90263b6ed51898e0ddbefde21 cfengine-3.4.4.tar.gz
0d182dba55bc65a8680747d91615369795d5b6dad8ace4b3c8f5cc394ea2592c892729f142009cc3f92aea7d6b63a0575a22565fddf1a9066397a3c0ecd70172 alpinelinux.patch"
diff --git a/masterfiles/libraries/cfengine_stdlib.cf b/masterfiles/libraries/cfengine_stdlib.cf
index 13d554f..24529e8 100644
--- a/masterfiles/libraries/cfengine_stdlib.cf
+++ b/masterfiles/libraries/cfengine_stdlib.cf
@@ -2047,6 +2047,31 @@ package_update_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --need
##
+body package_method alpinelinux
+{
+ package_changes => "individual";
+
+ package_list_command => "/sbin/apk info -v";
+
+ # Remember to escape special characters like |
+
+ package_list_name_regex => "([^\s]+)-.*";
+ package_list_version_regex => "[^\s]+-([^\s]+).*";
+
+ package_name_regex => "([^\s]+)-.*";
+ package_version_regex => "[^\s]+-([^\s]+).*";
+
+ package_installed_regex => ".*";
+
+ package_name_convention => "$(name)-$(version)";
+
+
+ package_add_command => "/sbin/apk add";
+ package_delete_command => "/sbin/apk del";
+}
+
+##
+
# Single bundle for all the similar managers simplifies promises
body package_method generic
@@ -2186,6 +2211,18 @@ archlinux::
package_add_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --needed";
package_delete_command => "/usr/bin/pacman -Rs --noconfirm";
package_update_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --needed";
+
+alpinelinux::
+ package_changes => "individual";
+ package_list_command => "/sbin/apk info -v";
+ package_list_name_regex => "([^\s]+)-.*";
+ package_list_version_regex => "[^\s]+-([^\s]+).*";
+ package_name_regex => "([^\s]+)-.*";
+ package_version_regex => "[^\s]+-([^\s]+).*";
+ package_installed_regex => ".*";
+ package_name_convention => "$(name)-$(version)";
+ package_add_command => "/sbin/apk add";
+ package_delete_command => "/sbin/apk del";
}
##
diff --git a/src/sysinfo.c b/src/sysinfo.c
index 557f449..56046ba 100644
--- a/src/sysinfo.c
+++ b/src/sysinfo.c
@@ -819,6 +819,12 @@ void OSClasses(void)
SetFlavour("UnitedLinux");
}
+ if (cfstat("/etc/alpine-release", &statbuf) != -1)
+ {
+ CfOut(cf_verbose, "", "This appears to be an AlpineLinux system.\n");
+ SetFlavour("alpinelinux");
+ }
+
if (cfstat("/etc/gentoo-release", &statbuf) != -1)
{
CfOut(cf_verbose, "", "This appears to be a gentoo system.\n");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment