On Fri, Jan 08, 2010 at 04:36:56PM -0800, Jason thus spake:
On Fri, Jan 08, 2010 at 10:09:36AM +0000, Florent Thoumie thus spake:
On Wed, Jan 6, 2010 at 8:26 PM, Jason <[email protected]> wrote:
Hi,

I am new to building ports, however I have started to get the hang of
things.

I am not building any ports that I intend on submitting to FreeBSD, yet,
however maybe that isn't too far off :)

I've used a guide I found to create a local ports repository that is working
out wonderfully with the existing ports tree under /usr/ports

My tree is under /usr/ports/local, and I found a way to integrate a local
UIDs and GIDs file, by setting this variable in my Makefile:

UID_FILES:=${PORTSDIR}/local/UIDs

When I go to install my port it installs the user as expected, however it
fails on the ${INSTALL_PROGRAM} function. I understand this is just using
"install" with the appropriate flags. Obviously, the port doesn't install.

If I run it again, the user is already on the system, and the port installs
successfully.

I was wondering if there is a way to have the port install the user using
the native USERS or GROUPS directives in the do-install phase with the
INSTALL macros, or if there is a more suggested, or conventional, way of
doing this operation.

Would you mind putting the files somewhere and showing us the error
log? I am aware of one caveat at the moment, which is that you can't
use users/groups created with USERS/GROUPS in pkg-plist. Every typical
use case with directives contained in Makefile should be fine AFAIK.

--
Florent Thoumie
[email protected]
FreeBSD Committer


I've uploaded to pastebin, and hope this is enough to go on. Please let me
know if it is not, and I will make the information needed available.

http://freebsd.pastebin.com/m359b2c91

I will attach the text of the pastebin for convenience.

Thanks, again!
Jason
[jhelf...@walrus /usr/ports/local/testport]$ sudo make install
===>  Vulnerability check disabled, database not found
=> testport-0.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://xxxx/pub/ports/.
testport-0.0.tar.gz                           100% of  165  B 1811 kBps
===>  Extracting for testport-0.0
=> MD5 Checksum OK for testport-0.0.tar.gz.
=> SHA256 Checksum OK for testport-0.0.tar.gz.
===>  Patching for testport-0.0
===>  Configuring for testport-0.0
===>  Installing for testport-0.0
===>   Generating temporary packing list
===>  Checking if local/testport already installed
Creating user `testuser' with uid `1099'.
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
*** Error code 64

Stop in /usr/ports/local/testport.

[jhelf...@walrus /usr/ports/local/testport]$ sudo make install
===>  Installing for testport-0.0
===>   Generating temporary packing list
===>  Checking if local/testport already installed
Using existing user `testuser'.
install  -o root -g wheel -m 555 /usr/ports/local/testport/work/test.sh 
/usr/local/bin
===>   Registering installation for testport-0.0

[jhelf...@walrus /usr/ports/local/testport]$ ls -al /usr/local/bin/test.sh 
-r-xr-xr-x  1 root  wheel  33 Jan  8 16:26 /usr/local/bin/test.sh

[jhelf...@walrus /usr/ports/local/testport]$ cat Makefile 
PORTNAME=       testport
PORTVERSION=    0.0
CATEGORIES=     local
VALID_CATEGORIES=       local
MASTER_SITES=   ftp://xxxx/pub/ports/
DISTFILES=      ${PORTNAME}-${PORTVERSION}.tar.gz
MAINTAINER=     [email protected]
COMMENT=        This is a test port
USERS=          testuser

WRKSRC=         ${WRKDIR}
NO_BUILD=       YES

do-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/test.sh ${PREFIX}/bin

UID_FILES:=${PORTSDIR}/local/UIDs

.include <bsd.port.mk>

[jhelf...@walrus /usr/ports/local/testport]$ pkg_info |grep test
testport-0.0        This is a test port

[jhelf...@walrus /usr/ports/local/testport]$ id testuser
uid=1099(testuser) gid=65534(nobody) groups=65534(nobody)

[jhelf...@walrus /usr/ports/local/testport]$ grep testuser ../UIDs 
testuser:*:1099:65534:testuser:/na:/bin/sh
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"

Reply via email to