From owner-freebsd-ports@FreeBSD.ORG Mon Feb 7 19:05:46 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA7D216A4CE for ; Mon, 7 Feb 2005 19:05:46 +0000 (GMT) Received: from phoenix.buildlink.org (buildlink.org [69.20.59.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6789B43D45 for ; Mon, 7 Feb 2005 19:05:46 +0000 (GMT) (envelope-from jlam@buildlink.org) Received: by phoenix.buildlink.org (Postfix, from userid 1002) id 01FE740F178; Mon, 7 Feb 2005 19:05:46 +0000 (GMT) Resent-From: jlam@buildlink.org Resent-Date: Mon, 7 Feb 2005 19:05:45 +0000 Resent-Message-ID: <20050207190545.GA86501@phoenix.buildlink.org> Resent-To: freebsd-ports@freebsd.org Message-ID: <4207B227.3070600@NetBSD.org> Date: Mon, 07 Feb 2005 13:23:35 -0500 From: "Johnny C. Lam" Organization: The NetBSD Project User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Boris Kovalenko References: <42075175.20603@ntmk.ru> <42078CC1.6080709@NetBSD.org> <42079BB9.1020101@ntmk.ru> In-Reply-To: <42079BB9.1020101@ntmk.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: We need new feature for pkg_create? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 19:05:46 -0000 Boris Kovalenko wrote: > Johnny Lam wrote: > >> Boris Kovalenko wrote: > >> You can install the rc.d script somewhere under ${PREFIX} and then >> write a +INSTALL script copy it into place. The +INSTALL script is >> invoked with PKG_PREFIX set to the correct package prefix, so copying >> ${PKG_PREFIX}/share/quagga/quagga${RC_SUFX} to /etc/rc.d/quagga will >> always work correctly. There would need to be a corresponding action >> in the +DEINSTALL script to remove the rc.d script. > > > Hmm... still misunderstand You.. May You give a quick example? You can create a .../quagga/INSTALL file that looks like (there's more to making a nice INSTALL script but the idea is there): #!/bin/sh case $2 in POST-INSTALL) [ -f /etc/rc.d/quagga ] || cp ${PKG_PREFIX}/share/quagga/quagga.sh /etc/rc.d/quagga ;; esac and then also a DEINSTALL script that looks like: #!/bin/sh case $w in DEINSTALL) [ -f /etc/rc.d/quagga ] && rm -f /etc/rc.d/quagga ;; esac When this package is added with pkg_add, then the INSTALL script will be invoked as per the pkg_add man page, and will copy the rc.d script into place at post-install time. The DEINSTALL script will remove it during deinstallation. I hope this helps! Cheers, -- Johnny Lam