You are not logged in.

#1 2006-09-02 14:06:26

PingFloyd
Member
Registered: 2006-08-19
Posts: 25

Need a little bit of guidance

I need a little bit of guidance. 

My plan is to make a PKGBUILD, but I've ran into a few snags.  I'm trying to make PKGBUILD for ToME-223-src (Troubles of Middle Earth).  But first I want to compile and install it locally so I'll have a good idea of how to make the PKBUILD right and to test it for awhile.  So the PKGBUILD is something later on to worry about.

I have a bit of delimma.  For some reason, the developer(s) of this game have the binary for it to use suid (I'm not sure their reasoning since I'm not a very experience programmer).  Fortunately, in the makefile, it uses the variable OWNER=games by default.  This is what is responsible for setting the ownership of all of the files when "make install" is ran appearantly.  This presents a few challenges.

When you get to the point of where you make install it, it's install rule wants to recursively run chown on all the files being installed like a nice and tidy makefile does.  So if you're not logged in as root when  you do the "make install" it gets choked up a bit and doesn't copy/install all the files.  So a regular user account doesn't generally have needed privileges to run chown and it has to be assumed when someone is going to install my tentative package they won't either.

Another delimma is that since it wants to utilize suid, this creates the necessity of a regular user account to be the owner of these files (I don't like the idea of this game running with root privileges personally).  We don't want root ownership on whatever files have their suid bit set I would think.  So this will require the making of the appropriate user.  Again, this usually requires high enough privileges by the person building.

This of course could be solved by using useradd in the build function, and the having builder being logged on as root when they makepgk, but I really don't like that nor feel it's a very kosher approach.

Any idea of how I can come up with an elegant solution to this?  How is this sort of situation normally handled with ABS?

Offline

#2 2006-09-02 16:45:50

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Need a little bit of guidance

If a package needs chown on install, or a new user created, this is typically done in the .install script. When pacman installs the pakcage, the .install script is run as root.
Based purely on your description, my suggestion would be to skip the make install stage, and use install commands in the PKGBUILD to put the files in the right places. In the .install script, create the required user and associated permissions.
Here's a typical example.

Offline

#3 2006-09-04 03:22:59

PingFloyd
Member
Registered: 2006-08-19
Posts: 25

Re: Need a little bit of guidance

Thanks for the advice.

Offline

Board footer

Powered by FluxBB