From owner-freebsd-ports@FreeBSD.ORG Mon May 26 15:57:52 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CE2B10D for ; Mon, 26 May 2014 15:57:52 +0000 (UTC) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5422209 for ; Mon, 26 May 2014 15:57:52 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id rp18so5995023iec.26 for ; Mon, 26 May 2014 08:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KxT2DjHBKlKf2iYCfqeXjiJ0NuZX/rRCvYCq/ryfY7A=; b=y7EJ9AT2LA7xzE1aZ1Tm67R3J+FQ160wxooqY5HUzdMGFjvr4CjJ1TqFJEQSQ0P0KR AbbKgaQWeUba1vIwsgQ07UxLK5e2SzEr9+yo4ndFI1VDHB9ZsZ5SaQ1Iaq7aO61URMAR 8MWtuvoif89xm7l0yFuWfZSpgWwVWqADpYLEBWkwhWBQN3/HzYDkkPwI40pli8vofXhN uy/PY8gFMcj+mXwTz4FauNM5+BMdPKJRs/+z3oSoSLRbVOPgD7kx7xvN6zOKiWfelxmm s9C8r4G4qKd8FkUYDqgFdBA6OSGdTzKMlCrTKxh6rnUATbQc9TFrXitKhEwj5mH67XqM se2Q== MIME-Version: 1.0 X-Received: by 10.42.50.68 with SMTP id z4mr3701470icf.70.1401119871449; Mon, 26 May 2014 08:57:51 -0700 (PDT) Received: by 10.50.189.169 with HTTP; Mon, 26 May 2014 08:57:51 -0700 (PDT) In-Reply-To: References: <20140525213854.0d952d1d@zeta.dino.sk> <20140525201008.GQ2341@home.opsec.eu> <20140525222726.47261ae9@zeta.dino.sk> <20140525204314.GR2341@home.opsec.eu> <20140525225151.227ea602@zeta.dino.sk> <20140525211955.GT2341@home.opsec.eu> <53829913.1050400@gmx.de> <20140526070435.1b82a448@zeta.dino.sk> Date: Mon, 26 May 2014 10:57:51 -0500 Message-ID: Subject: Re: mail/courier build failures on newer FreeBSD versions From: Scot Hetzel To: Milan Obuch Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:57:52 -0000 On Mon, May 26, 2014 at 2:45 AM, Scot Hetzel wrote: > On Mon, May 26, 2014 at 12:04 AM, Milan Obuch wrote: >> On Mon, 26 May 2014 03:29:55 +0200 >> Matthias Andree wrote: >> >> It does not take much time to revert, for me, at least in this case, >> unnecessary substitution, some times a bit comic, to >> >> Error: Orphaned: etc/courier/courierd >> Error: Orphaned: etc/courier/esmtpd >> Error: Orphaned: etc/courier/esmtpd-msa >> Error: Orphaned: etc/courier/esmtpd-ssl >> Error: Orphaned: etc/courier/imapd >> Error: Orphaned: etc/courier/imapd-ssl >> Error: Orphaned: etc/courier/ldapaddressbook >> Error: Orphaned: etc/courier/pop3d >> Error: Orphaned: etc/courier/pop3d-ssl >> Error: Orphaned: etc/courier/sqwebmaild >> Error: Orphaned: etc/courier/webmlmrc >> >> All these files are configuration files and all are handled this way: >> >> @unexec cmp -s %D/etc/courier/courierd %D/etc/courier/courierd.dist && >> rm -f %D/etc/courier/courierd 2>/dev/null || true >> etc/courier/courierd.dist >> @exec [ -f %D/etc/courier/courierd.dist ] && >> %%LOCALBASE%%/share/sysconftool/sysconftool %D/etc/courier/courierd.dist >> >> which does create them if they do not exist copying .dist as >> template on install and if they are still the same on unistall, they >> are deleted. This way user configuration does not get lost across >> upgrades, and sysconftool merges new configuration items when they are >> introduced. >> > The new way to specify sample configuration files is to use the > @sample keyword in the pkg-plist: > > @sample etc/courier/courierd.sample > @sample etc/courier/esmtpd.sample > @sample etc/courier/esmtpd-msa.sample > @sample etc/courier/esmtpd-ssl.sample > @sample etc/courier/imapd.sample > @sample etc/courier/imapd-ssl.sample > @sample etc/courier/ldapaddressbook.sample > @sample etc/courier/pop3d.sample > @sample etc/courier/pop3d-ssl.sample > @sample etc/courier/sqwebmaild.sample > @sample etc/courier/webmlmrc.sample > > Note: you would have to change the port to install the files with a > .sample suffix, instead of a .dist suffix. > After reviewing the source, @sample will not work for you. You'll need to create an @sysconftool keyword: ${PORTSDIR}/Keywords/sysconftool.yaml # $FreeBSD$ # # MAINTAINER: ? # # @sysconftool etc/somefile.conf.dist # # This will install/upgrade the somefile.conf using the somefile.conf.dist. # On deinstall it will remove the somefile.conf if it still matches the # dist file, otherwise it is kept. # # This replaces the old pattern: # @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.dist; then rm -f %D/etc/pkgtools.conf; fi # etc/pkgtools.conf.dist # @exec [ -f %D/etc/courier/courierd.dist ] && %%LOCALBASE%%/share/sysconftool/sysconftool %D/etc/courier/courierd.dist actions: [file] post-install: | dist_file="%D/%@" if [ -f "${dist_file}" ]; then %%LOCALBASE%%/share/sysconftool/sysconftool "${dist_file}" fi pre-deinstall: | dist_file="%D/%@" target_file="${dist_file%.dist}" if cmp -s "${target_file}" "${dist_file}"; then rm -f "${target_file}" fi The only ting I'm not sure of is how to deal with is LOCALBASE, as the sysconftool port could be installed in a location other than /usr/local. -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.