From owner-freebsd-ports@FreeBSD.ORG Mon Oct 28 05:16:34 2013 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 ESMTP id 2EA3816D for ; Mon, 28 Oct 2013 05:16:34 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 032292216 for ; Mon, 28 Oct 2013 05:16:33 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id e14so10501228iej.36 for ; Sun, 27 Oct 2013 22:16:33 -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=fxGhww/u74sETGQNVkbN9rJG4Dh0IjFBWH5dNXEspLM=; b=He/Pk9VpJUWi7fKK3kockL5OE3iI2m+D2fpZfvVDI+fCTKI4Ce2SuQYGnk6IWpqdaO P6fv/jaCMIymzGmIIHat8rcDIKWhrdvY6iS8a9rHeJ8VNMgq81u8NWLL/oN6ysE8BW+h UXrdMH2alJ5f7p8v/QdE9EvEOOZLgtPSnk9tl/1ztVmKYjNjzQZvx1g9qlKGSo2FcDMk NFjOz011gIVAmqD/BvWXkZaDIjEysPaN5o8t+40lVBKZvE018sr34cFYyoBHDnUxu2xM oUVESPEdqXWlaESNI6g9/JZTQAuvw0mbJ4OBApYLwkMhE6Mx1BA9OH1MYzSsr7ea6bze w4KQ== MIME-Version: 1.0 X-Received: by 10.50.13.104 with SMTP id g8mr7191289igc.30.1382937393228; Sun, 27 Oct 2013 22:16:33 -0700 (PDT) Received: by 10.50.62.178 with HTTP; Sun, 27 Oct 2013 22:16:33 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Oct 2013 00:16:33 -0500 Message-ID: Subject: Re: How to reference /var/foo in pkg-plist? From: Scot Hetzel To: Christian Weisgerber Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2013 05:16:34 -0000 On Fri, Oct 25, 2013 at 3:06 PM, Christian Weisgerber wrote: > For a crufty port of mine that I'm converting to staging, I'm trying > this in pkg-plist: > > @exec mkdir -pm 770 /var/spool/bsmtp; chown uucp:uucp /var/spool/bsmtp > @dirrmtry /var/spool/bsmtp > > Alas, it doesn't package: > > ===> Building package for bsmtp-1.02_5 > pkg-static: lstat(/usr/ports/mail/bsmtp/work/stage/var/spool/bsmtp/): > No such file or directory > > This isn't meant to reference ${STAGEDIR}/var/spool/bsmtp, I really > want the absolute path /var/spool/bsmtp. Adding @cwd / doesn't > help. > > What's the correct way to handle this? > The correct way to handle this is to have the port create ${STAGEDIR}/var/spool/bsmtp. This could be created in the post-install target or in the ${WRKSRC}/Makefile (if it supports DESTDIR). I had a look at the ${WRKSRC}/Makefile.in and the generated ${WRKSRC}/Makefile, but I didn't see support for DESTDIR in the install section. You will need to fix that so that the port will be able to properly install into the STAGEDIR. You can consider that STAGEDIR is similar to a chroot. When the package is created by either pkg or pkg_create, the files/directories will be relative to / (not to STAGEDIR). -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.