mail/courier build failures on newer FreeBSD versions

Scot Hetzel swhetzel at gmail.com
Mon May 26 15:57:52 UTC 2014


On Mon, May 26, 2014 at 2:45 AM, Scot Hetzel <swhetzel at gmail.com> wrote:
>  On Mon, May 26, 2014 at 12:04 AM, Milan Obuch <freebsd-ports at dino.sk> wrote:
>> On Mon, 26 May 2014 03:29:55 +0200
>> Matthias Andree <matthias.andree at gmx.de> 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 <file>.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.


More information about the freebsd-ports mailing list