From owner-freebsd-pkg@freebsd.org Wed Apr 5 12:15:01 2017 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDB5D2C3C4 for ; Wed, 5 Apr 2017 12:15:01 +0000 (UTC) (envelope-from atma@convalesco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840FEF03 for ; Wed, 5 Apr 2017 12:15:01 +0000 (UTC) (envelope-from atma@convalesco.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 454BD20A0A for ; Wed, 5 Apr 2017 08:15:00 -0400 (EDT) Received: from web2 ([10.202.2.212]) by compute5.internal (MEProxy); Wed, 05 Apr 2017 08:15:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=convalesco.org; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=hE6eXi2kToHTgTvnVwq1C3f0Rpa3+fBU+ImU4nzMKz4=; b=Qxerz qIaWQtRPiS+IeSm+q9Tm+BxaBCxhzgqtRgRjVJ5KmiOHmtIG5Hp609vIWsrJcAob WGPWIiXTOYbtMsSLdXGzrZswUHFjjKFVW4nYhnT2kFBSAXg5fc5Cm5dYKEQG08GF yvzlZtLcUsL9BKn2DGe79t9hkPlkIhGHBN50mk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=hE6eXi2kToHTgTvnVwq1C3f0Rpa3+ fBU+ImU4nzMKz4=; b=qqjqLlhDjtUvG0MXVmDZLP7oyQw9JQJy5U2dm03+WTk0P aKrvBJSrqwr/URV58Fwl20AX3Hg5tEFjklPmQpS4eQe35hAXkddHzuxm1fY4LNyd KS12yCq7zPlb0IFfTPHCEYwN6Wuo8bJG43Per07vZDuCkwlQJezLPKvP1siVMh+R jig1L7b0qP2oUPiMYbGMDn7NMKRr9KIHlKNYo05XUy/Wjn0SsxPCWHFEQrJYyDt/ Aj86vBE81hBf74xptgxqsWncAnVFQY276aPhK+axjPYGgkGL5oGaBCHcXqiCXjSA XZC+lj7lTZSYqbgvtWpStv/mV4FrYRO/Nz5R525hQ== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 27CB562737; Wed, 5 Apr 2017 08:15:00 -0400 (EDT) Message-Id: <1491394500.3816517.934922544.712A7743@webmail.messagingengine.com> From: Panagiotis Atmatzidis To: freebsd-pkg@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-8e6aa83c Date: Wed, 05 Apr 2017 15:15:00 +0300 Subject: FreeBSD pkg versioning X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 12:15:01 -0000 Hi, I need to create FreeBSD packages of a commercial command line application. I am using "pkg-create". I have created two versions, however "pkg" doesn't handle the updates. First I checked the versioning scheme to make sure "pkg" understands: -------- root@fbsd11:~ # pkg version -t 3.0.1879 3.99.2311 < -------- "pkg" understands which version is newer, apparently. However: -------- root@fbsd11:~ # ls myapp* myapp-3.0.1879.tgz myapp-3.99.2311.tgz root@fbsd11:~ # pkg add myapp-3.0.1879.tgz Installing myapp-3.0.1879... Extracting myapp-3.0.1879: 100% root@fbsd11:~ # pkg add myapp-3.99.2311.tgz Installing myapp-3.99.2311... the most recent version of myapp-3.0.1879 is already installed -------- I am creating a PLIST file which contains commands to be executed along with a list of files to be packed and a manifest which look like this: -------- $ cat pkg/+MANIFEST name: myapp version: 3.0.1879 origin: sysutils/myapp users: [myapp] groups: [myapp] comment: "descriptive comment" categories: [sysutils] prefix: /opt/myapp arch: amd64 www: https://myapp.com maintainer: support@myapp.org licenselogic: single licenses: [commercial] desc: "long description" $ head -n 6 pkg/PLIST @owner myapp @group myapp echo "@preexec sh -c 'if ! finger myapp|grep -iq login; then pw useradd -n myapp -c myapp -s /usr/sbin/nologin -d /opt/myapp;fi'" >> $plist @postexec cp /opt/myapp/share/myapp/init/myapp /etc/rc.d/myapp @postexec chown -R myapp:myapp /opt/myapp bin/myapp -------- The same script creates the manifest for the newer version, so only the ${version} variable changes.=20 My first problem is how to make pkg run upgrades smoothly when a new pkg is out? Please note that our original naming scheme was like: "myapp-1.2.1234-fbsd11.tgz" because we'd like to specify the major release version. Second question that came up is how to handle upgrades for configuration files. Now, upon installation I place a sample config as "myapp.conf.sample". The admin needs to configure the app anyway, as defaults will not match anyone's use case, so I figured that it's not a big deal renaming the file. Is there a better way? For example there is a "%config(noreplace)" for RPMs and a similar flag for DEBs. I didn't see any mention about special handling of configuration files in pkg-create manual page. Thanks! --=20 Panagiotis (atmosx) Atmatzidis email: atma@convalesco.org URL: http://www.convalesco.org GnuPG ID: 0x1A7BFEC5 gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5 "Everyone thinks of changing the world, but no one thinks of changing himself.=E2=80=9D - Leo Tolstoy