Illegal group name

SirDice said:
What are the user and group names you're trying to add?


I'm trying to add @mcspigot, I've added it in /usr/ports/GIDs and in /usr/ports/UIDs

This is my Makefile

Code:
# Created by: Name
# $FreeBSD$

PORTNAME=       spigot
PORTVERSION=    1.7.2R0.4
CATEGORIES=     games java
MASTER_SITES=   http://ci.md-5.net/view/Spigot/job/Spigot/lastStableBuild/artifact/Spigot-Server/target/
DISTNAME=       spigot-1.7.2-R0.4-SNAPSHOT.jar
EXTRACT_SUFX=
EXTRACT_ONLY=

MAINTAINER=     email@provider.tld
COMMENT=        High performance Server for the block building game Minecraft

LICENSE=        GPLv3

RUN_DEPENDS=    tmux:${PORTSDIR}/sysutils/tmux

NO_WRKSUBDIR=   yes
NO_BUILD=       yes
USE_JAVA=       yes
JAVA_VERSION=   1.7
USERS=          mcspigot
GROUPS=         mcspigot
USE_RC_SUBR=    spigot
SUB_FILES=      pkg-deinstall \
                pkg-message

PLIST_FILES=    share/spigot-1.7.2-R0.4-SNAPSHOT.jar

do-install:
        ${INSTALL_DATA} ${DISTDIR}/spigot-1.7.2-R0.4-SNAPSHOT.jar ${STAGEDIR}${PREFIX}/share/spigot-1.7.2-R0.4-SNAPSHOT.jar
        ${CHOWN} -R ${USERS}:${GROUPS} ${DATADIR}

post-install:
        ${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>
 
Last edited by a moderator:
That should be the correct way, I was wondering if the names perhaps had any characters that were not allowed. What UID and GID did you pick? Maybe that's the conflicting part.
 
Your do-install target is now changing the ownership on the actual system and not on the stage directory. This should work better:

Code:
do-install:
        ${INSTALL_DATA} ${DISTDIR}/spigot-1.7.2-R0.4-SNAPSHOT.jar ${STAGEDIR}${PREFIX}/share/spigot-1.7.2-R0.4-SNAPSHOT.jar
        ${CHOWN} -R ${USERS}:${GROUPS} ${STAGEDIR}${DATADIR}

However, I'm not sure if the setting of owner/group should be actually postponed to pkg-plist. The documentation (http://www.freebsd.org/doc/en/books/porters-handbook/users-and-groups.html) suggests that the users and groups are not created until make install is performed or the package is installed.
 
I'm pretty sure that is too a non-supported way. What I've gathered is that all user/group/mode changes should be done in pkg-plist so that make install and installing the package do exactly the same steps.
 
I don't have time to test this but something like this:

Code:
@owner mcspigot
@group mcspigot
%%DATADIR%%
%%DATADIR%%/foobar
....
@owner
@group

Of course you have the tedious task of generating the entries for all files installed by your port but the new staging system is really strict about missing and extra files. There's a tool that can help you auto-generate a skeleton pkg-plist, make makeplist.
 
kpa said:
There's a tool that can help you auto-generate a skeleton pkg-plist, make makeplist.
For work I've made a couple of custom packages and I noticed that the makeplist target doesn't exist if there's NO_STAGE in the Makefile. You'd have to generate it the old fashioned way in that case.
 
Oh and one thing more, get rid of the ${CAT} ${PKGMESSAGE} stuff in post-install, showing the message won't work with staging that way and it's done automatically on install now anyway.
 
SirDice said:
kpa said:
There's a tool that can help you auto-generate a skeleton pkg-plist, make makeplist.
For work I've made a couple of custom packages and I noticed that the makeplist target doesn't exist if there's NO_STAGE in the Makefile. You'd have to generate it the old fashioned way in that case.

make -DNO_STAGE makeplist ? :e
 
SirDice said:
That should be the correct way, I was wondering if the names perhaps had any characters that were not allowed. What UID and GID did you pick? Maybe that's the conflicting part.

These are last rows of /usr/ports/GIDs and /usr/ports/UIDs

Code:
[...]
unifi:*:975:
minetest:*:976:
mcspigot:*:978:
nogroup:*:65533:
nobody:*:65534:

Code:
[...]
unifi:*:975:975::0:0:Unifi Wireless Controller:/nonexistent:/usr/sbin/nologin
minetest:*:976:976::0:0:& server:/nonexistent:/usr/sbin/nologin
tests:*:977:65534::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
mcspigot:*:978:978::0:0:Spigot Server:/nonexistent:/bin/sh
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin

With make install I've the same error, I'll try with the pkg-plist.
 
Thank you guys, with the @kpa's solution it works! :D

Doing port test (or after normal installation with make deinstall) I've this error ( port test example):

Code:
pkg-static: unlink(/tmp/spigot-1.7.2R0.4/share/spigot/): Operation not permitted
 
Last edited by a moderator:
Back
Top