From owner-freebsd-ports@FreeBSD.ORG Wed Oct 29 20:43:30 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75ABB266; Wed, 29 Oct 2014 20:43:30 +0000 (UTC) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (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 B3E092E2; Wed, 29 Oct 2014 20:43:29 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id gd6so2126414lab.34 for ; Wed, 29 Oct 2014 13:43:27 -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=vy69TlgpioxYlzlewhJ3inzsioUvS53fmzXU05qEt+o=; b=kL2wKzK2a8cw5HpQ46wQGeNuffQKmbhlRl7YLToGm953r0w7jpu2Y9I9ME+MUrspTj IbRxWN2NjPUuteDkFfVfa75TT5GtKzMP1nHLF6LhwQjixbk+JmXZNNkOEHxx0zhjZjE1 oAUtC9z3rtu2Q+caT3XrF1OhU9S05kUt77Ji+EJ/n6nsO0jdOCfpQ5X1cQVRmN1bJQ2p IoO6vZc2Ak+FtJ5wo0Jje87yhIdotTqOOA63UUxPXMllauFxbwHGleGVQQ7nSxB9Rjep i6wEOagHjSOtP5WlGLhVZcOXSmt1mkL6M+mmn1+iiNwNhQEC3E7wl+QvfLaUs/jG6QyD f6Rw== MIME-Version: 1.0 X-Received: by 10.152.234.136 with SMTP id ue8mr13971103lac.21.1414615407463; Wed, 29 Oct 2014 13:43:27 -0700 (PDT) Received: by 10.25.15.93 with HTTP; Wed, 29 Oct 2014 13:43:27 -0700 (PDT) In-Reply-To: <20141029200212.GE11033@ivaldir.etoilebsd.net> References: <20141029200212.GE11033@ivaldir.etoilebsd.net> Date: Wed, 29 Oct 2014 13:43:27 -0700 Message-ID: Subject: Re: pkgng "requirements" script equivalent From: Nick Rogers To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-ports@freebsd.org" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 20:43:30 -0000 On Wed, Oct 29, 2014 at 1:02 PM, Baptiste Daroussin wrote: > On Wed, Oct 29, 2014 at 12:44:21PM -0700, Nick Rogers wrote: > > Hello, > > > > I am in the process of upgrading some proprietary software that has > always > > been deployed via a "custom" package created by the old pkg_create. So > far > > I've been able to use "pkg create" to achieve what I want, but it seems > > that the "requirements" script is no longer a part of the new pkg > > framework. This used to be a script that you could include with a package > > that could halt the pkg add or remove process by returning a non-zero > exit > > code from the script. I've been using it with the old pkg tools as a way > to > > enforce some proprietary requirements logic that goes beyond requiring > > certain pkg dependencies, architecture, etc. One example is to make sure > a > > specific custom kernel is running by analyzing uname output. > > > > I am wondering if anyone has a suggestion as to how to interrupt the pkg > > add process in a similar way. It looks like the "requirements" script has > > been removed entirely, and from what I can tell a failure in the > > pre-install script does not halt pkg add. > > What is the requirement script you are speaking about? I never heard of it? > man pkg_create(1) https://www.freebsd.org/cgi/man.cgi?query=pkg_create&apropos=0&sektion=1&manpath=FreeBSD+8.3-RELEASE&arch=default&format=html -r rscript Set rscript to be the ``requirements'' procedure for the package. This can be any executable program (or shell script). It will be invoked automatically at installation/deinstallation time to determine whether or not installation/deinstallation should pro- ceed. To differentiate between installation and deinstallation, the keywords INSTALL and DEINSTALL are passed respectively, along with the package's name. > Explain me in detail the way you were producing the package with > pkg_create and > I'll explain you how to do the same with pkg(8). > I was running pkg_create with the following arguments: pkg_create -f plistfile -c -'comment' -d -description' -v -P 'list of dependency packages' -v -r requirements_script_file -i pre-install_script_file -I post-install-script_file -k pre-deinstall_script_file -K post-deinstall_script_file -s /space/build/trunk -D displayfile -p /space/rxg -o category/name pkg.tbz For the most part I've figured out the appropriate +MANIFEST file and manifest directory contents, except for the "requirements procedure" script. > > regards, > Bapt >