newbie porter questions

Ion-Mihai Tetcu itetcu at people.tecnik93.com
Sat Aug 21 17:51:31 PDT 2004


On Sat, 21 Aug 2004 17:17:00 -0700
David Syphers <dsyphers at u.washington.edu> wrote:

> Hi,
> 
> I'm trying to make my first port, and I have a few questions that I
> don't see answers to in the Porter's Handbook.
> 
> First, I have a script that does the installation. I call it with a
> do-install in the Makefile, '@(cd ${SCRIPTDIR} && ./mod_install)'. 

Is this really necessarily ?

> portlint is complaining that I'm using absolute pathnames.
> Unfortunately, it's right. How do I avoid that? The variables
> $LOCALBASE, etc. aren't defined in my script. When I've looked at
> other ports that use scripts, these variables just seem to show up
> magically (they don't define them, but they can use them). How do I
> use these variables?

In makefile pass them as 
./my_install foo bat
and access them as $1, $2 etc. in the script

> Second, the program I'm installing claims it needs its own user. I'm
> trying to figure out if that's really true, but if it is, how should I
> go about installing a user from a port?

Take a look at security/clamav and man pw.

>  The only port I could think of off the top of my head that did that 
>  is apache, but they have a benefit of having a standard user with a
>  reserved userid, 80. Is there some way of figuring out which is the
>  next available userid, or should I give up and ask people to run
>  adduser themselves?

There is a list of reserved uids in Porter Handbook; when submitting
your port you should also add a diff to that.

> This is a real user, that needs to be able to log  in.

If so your port must either be interactive or you create the account and
disable it by default and tell the user to change its password and
enable it.

> Lastly, I've modified the install scripts that come with the program
> so that they're no longer interactive. However, they become
> interactive if there's a failure - rather than just fail, they try to
> get useful input from the user so they can continue. In this case,
> should I define IS_INTERACTIVE? If I do, but want to enable package
> builds, what's the right way of doing:
> 
> .if (!defined(PACKAGE_BUILDING))
>        IS_INTERACTIVE= yes
> .endif
> 
> The code is wrong, of course, but I don't know what the right way is.
> I assume it's obvious to humans what I'm trying to do, if not
> computers...

Should work without parenthesis. On the other hand it shouldn't fail :)

> Oh yeah, one last thing. The program's install manual keeps asking me
> to do 'cat /[path]/[file] | zcat | tar -xpf - '. Is there any reason
> that's preferable to 'tar -xzpf - /[path]/[file]' ? 

I don't see any. On some platform tar doesn't know all it knows on
FreeBSD, perhaps that's the reason.

> And what does the '-' by itself do? I couldn't seem to find an answer
> in tar's manpage.

It is there. The last `f' means the file to read from and `-' is
standard input.


What port is it ? 

-- 
IOnut
Unregistered ;) FreeBSD "user"



More information about the freebsd-ports mailing list