From owner-freebsd-ports@FreeBSD.ORG Fri Apr 3 08:41:10 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2B03106566B for ; Fri, 3 Apr 2009 08:41:10 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id 790DF8FC14 for ; Fri, 3 Apr 2009 08:41:10 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so612987yxm.13 for ; Fri, 03 Apr 2009 01:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :content-disposition:message-id; bh=1Ob+V5l0Hh19NbUL661U4S2QGZENN8I8PehAEXsRnC8=; b=tHvMOaDfXyJVMdyde1kvTgT2DVo2z/bnzWakTltsTVsGFCgICbiPt2S8+7G3ztn/AN hMjmdCTVqHXW+E4DDWdlN86N/sV8o/tyfJx6bDhEzBpLt1tJKlvOxZYJxdwrByGTUY1+ zjOfsDrB+3FSCjdNDZB/6RYh1sFOCOJ8yfTtE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=FQmORo+i31zUKf4TVLmTs38GBBt0ZMzC+rcr61jvrgoVk6AjLdRtL+t9FRRuzKqvk6 DQHV/gER5gddaHTn4GG9fZtP/YVOzwaGs0Nz0fRExYwVCh1qa5if34zfCfGrf7xWad+d zk/C9igMJHY9cNYykzSBgYKMzh882y7vt3tzY= Received: by 10.90.113.11 with SMTP id l11mr575357agc.74.1238746348369; Fri, 03 Apr 2009 01:12:28 -0700 (PDT) Received: from oleg.net.nevosoft.ru ([195.182.128.54]) by mx.google.com with ESMTPS id 20sm2721270agd.21.2009.04.03.01.12.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Apr 2009 01:12:27 -0700 (PDT) From: subbsd To: freebsd-ports@freebsd.org Date: Fri, 3 Apr 2009 12:12:18 +0400 User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.0; i386; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904031212.18475.subbsd@gmail.com> Subject: adding users in ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: subbsd@gmail.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 08:41:11 -0000 Hello maillist, I've planned porting some software to FreeBSD and currently generate Makefile for ports. My application required presence of some account in system. I've see many sample from current ports like "squid, cacti, avahi, mysql, pgsql, cups, distcc..." and many-many-many, they are using equally construction like: --- if ${PW} user show "${USER}" 2>/dev/null; then echo "You already have a user \"${USER}\", so I will use it." else if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ -d "/nonexistent" -s /usr/sbin/nologin -c "User user" then echo "Added user \"${USER}\"." else echo "Adding user \"${USER}\" failed..." exit 1 fi fi --- My question - why do not make this facility by generic (for example create add/del/check-existence procedure in some /usr/ports/Mk/bsd.users.mk file) ? Thanks