X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id C4312DC010E for ; Wed, 30 Sep 2015 14:53:02 +0000 (UTC) Received: from lithium.8pit.net (lithium.8pit.net [141.101.32.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 4A937DC00F4 for ; Wed, 30 Sep 2015 14:53:01 +0000 (UTC) Received: from localhost (ip5f5ac8fc.dynamic.kabel-deutschland.de [95.90.200.252]); by lithium.8pit.net (OpenSMTPD) with ESMTPSA id dd62c782; TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; for ; Wed, 30 Sep 2015 16:52:59 +0200 (CEST) Date: Wed, 30 Sep 2015 16:52:59 +0200 From: =?iso-8859-1?Q?S=F6ren?= Tempel To: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/csync2: some cleanups in strlcpy patch. post-install generate required certificate and setup inetd service Message-ID: <20150930145259.GA8636@francium.lan> References: <1443623356-1595-1-git-send-email-valery.kartel@gmail.com> X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1443623356-1595-1-git-send-email-valery.kartel@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Virus-Scanned: ClamAV using ClamSMTP On 30.09.15, Valery Kartel wrote: > --- a/testing/csync2/APKBUILD > +++ b/testing/csync2/APKBUILD > @@ -4,22 +4,21 @@ > # Maintainer: Natanael Copa > pkgname=3Dcsync2 > pkgver=3D2.0 > -pkgrel=3D1 > +pkgrel=3D2 > pkgdesc=3D"Cluster synchronization tool" > url=3D"http://oss.linbit.com/csync2/" > arch=3D"all" > -license=3D"GPL2+" > -depends=3D"" > -depends_dev=3D"" > -makedepends=3D"librsync-dev gnutls-dev sqlite-dev mysql-dev postgresql-d= ev" > -install=3D"$pkgname.post-upgrade" > +license=3D"GPL-2+" > +makedepends=3D"autoconf automake librsync-dev gnutls-dev sqlite-dev mysq= l-dev postgresql-dev" > subpackages=3D"$pkgname-compare $pkgname-doc" > source=3D"http://oss.linbit.com/$pkgname/$pkgname-$pkgver.tar.gz > longlong-format.patch > - rsync-strlcpy-disable.patch > + have-strlcpy.patch > $pkgname.initd" > +install=3D"$pkgname.post-install $pkgname.post-upgrade" > =20 > _builddir=3D"$srcdir"/$pkgname-$pkgver > + > prepare() { > cd "$_builddir" > for i in $source; do > @@ -27,6 +26,7 @@ prepare() { > *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; > esac > done > + autoreconf --install --force > } > =20 > build() { > @@ -45,31 +45,26 @@ build() { > package() { > cd "$_builddir" > make DESTDIR=3D"$pkgdir" install || return 1 > - cp doc/* "$pkgdir"/usr/share/doc/$pkgname/ || return 1 > - > - install -m755 -D "$srcdir"/$pkgname.initd \ > - "$pkgdir"/etc/init.d/$pkgname || return 1 > + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname > + cp doc/* "$pkgdir"/usr/share/doc/$pkgname/ > } > =20 > compare() { > subpkgdesc=3D"csync2 compare script" > arch=3D"noarch" > - depends=3D"bash perl-digest-md5" > - > + depents=3D"bash perl-digest-md5" > mkdir -p "$subpkgdir"/usr/sbin > - mv "$pkgdir"/usr/sbin/$pkgname-compare \ > - "$subpkgdir"/usr/sbin/ || return 1 > + mv "$pkgdir"/usr/sbin/$pkgname-compare "$subpkgdir"/usr/sbin/ > } This only seems to undo changes I explicitly committed in b5ec9730c022a6686955a4648329868cfdd598af for instance you readded your `depents` typo in the compare subpackage. > --- /dev/null > +++ b/testing/csync2/csync2.post-install > @@ -0,0 +1,24 @@ > +#!/bin/sh > + > +SSL=3D"/etc/csync2/csync2_ssl_" > +SERV=3D"/etc/services" > +INETD=3D"/etc/inetd.conf" > + > +if [ ! -f ${SSL}key.pem -o ! -f ${SSL}cert.pem ]; then > + openssl genrsa -out ${SSL}key.pem 1024 >/dev/null 2>&1 > + yes '' | openssl req -new -key ${SSL}key.pem -out ${SSL}cert.csr= >/dev/null 2>&1 > + openssl x509 -req -days 3600 -in ${SSL}cert.csr -out ${SSL}cert.= pem -signkey ${SSL}key.pem >/dev/null 2>&1 > + rm ${SSL}cert.csr > +fi > + > +if [ ! -f ${SERV} ]; then > + touch ${SERV} > +fi > +grep -q csync2 ${SERV} || echo -e "csync2\t\t30865/tcp" >> ${SERV} > + > +if [ ! -f ${INETD} ]; then > + touch ${INETD} > +fi > +grep -q csync2 ${INETD} || echo "csync2 stream tcp nowait root /usr/sbin= /csync2 csync2 -i" >> ${INETD} > + > +exit 0 The post-install script was removed by me for two reason: 1) You modify existing configuration files in a post-install script thus .apk-new files won't be created but you will write to the file directly therefore changing user configuration even if the users doesn't want to have a csync entry in his/her inetd.conf. 2) You create an openssl certificate without a configuration file passed to openssl using `-config` since you pipe it through yes(1) it will use the default values for all fields which I dislike. Take a look at main/dovecot to see how to do this correctly. > index 0000000..4f2278b > --- /dev/null > +++ b/testing/csync2/have-strlcpy.patch > @@ -0,0 +1,41 @@ > +--- old/config.h.in > ++++ new/config.h.in > +@@ -1,5 +1,8 @@ > + /* config.h.in. Generated from configure.ac by autoheader. */ > + > ++/* Define to 1 if you have the `strlcpy' function. */ > ++#undef HAVE_STRLCPY > ++ > + /* Define to 1 if you have the `fchmod' function. */ > + #undef HAVE_FCHMOD > + > +--- old/configure.ac > ++++ new/configure.ac > +@@ -43,7 +43,7 @@ > + > + > + dnl inspired by rsync's configure.ac > +-AC_CHECK_FUNCS(fchmod setmode open64 mkstemp64) > ++AC_CHECK_FUNCS(strlcpy fchmod setmode open64 mkstemp64) > + AC_CACHE_CHECK([for secure mkstemp],csync_cv_HAVE_SECURE_MKSTEMP,[ > + AC_TRY_RUN([#include > + #include > +--- old/rsync.c > ++++ new/rsync.c > +@@ -38,7 +38,7 @@ > + #include > + #endif > + > +- > ++#ifndef HAVE_STRLCPY > + /* This has been taken from rsync:lib/compat.c */ > + > + /** > +@@ -61,6 +61,7 @@ > + } > + return ret; > + } > ++#endif > + > + /* splits filepath at the last '/', if any, like so: > + * dirname basename filepath=20 > \ No newline at end of file > diff --git a/testing/csync2/rsync-strlcpy-disable.patch b/testing/csync2/= rsync-strlcpy-disable.patch > deleted file mode 100644 > index 5d28e1d..0000000 > --- a/testing/csync2/rsync-strlcpy-disable.patch > +++ /dev/null > @@ -1,20 +0,0 @@ > ---- old/rsync.c > -+++ new/rsync.c > -@@ -48,7 +48,7 @@ > - * @param bufsize is the size of the destination buffer. > - * > - * @return index of the terminating byte. > -- **/ > -+ * disabled > - static size_t strlcpy(char *d, const char *s, size_t bufsize) > - { > - size_t len =3D strlen(s); > -@@ -61,7 +61,7 @@ > - } > - return ret; > - } > -- > -+ **/ > - /* splits filepath at the last '/', if any, like so: > - * dirname basename filepath > - * "/" "" "/" The patches look ok, please submit them without your APKBULID and post-install script changes. S=F6ren. --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---