Selasa, 03 Oktober 2006

Installing Screen Port with Remote FreeBSD Ports Tree

I don't like to keep ports trees on all of my FreeBSD systems. I prefer to install packages whenever possible. Upgrading those packages requires the ports tree, however. To use Portupgrade I NFS mount /usr/ports from a single system that keeps an up-to-date ports tree.

The major problem with this plan involves the sysutils/screen port. No package is created, and you can't build one yourself.


poweredge:/usr/ports/sysutils/screen# make package
===> screen-4.0.2_4 may not be packaged: Tends to loop using 100% CPU when used from
package - perhaps it hard-codes information about the build host.

Is there a way to build Screen without installing the ports tree?

First I tried just NFS mounting /usr/ports and trying to build the port. Here, poweredge is th box with the ports tree and mwmicro needs to run screen.

mwmicro:/root# mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s1f on /home (ufs, local, soft-updates)
/dev/ad0s1g on /tmp (ufs, local, soft-updates)
/dev/ad0s1d on /usr (ufs, local, soft-updates)
/dev/ad0s1e on /var (ufs, local, soft-updates)
10.1.13.2:/usr/ports on /usr/ports (nfs)

Note that poweredge already installed Screen using the ports tree.

mwmicro:/usr/ports/sysutils/screen# make
mwmicro:/usr/ports/sysutils/screen# make install
mwmicro:/usr/ports/sysutils/screen# which screen
screen: Command not found.

That didn't work. Why? It's because poweredge, the box exporting the ports tree, already installed Screen. There's a "work" directory already built. I can't issue a "make clean" command here.

mwmicro:/usr/ports/sysutils/screen# make clean
===> Cleaning for screen-4.0.2_4
===> /usr/ports/sysutils/screen/work not writable, skipping

Ok, maybe I can issue "make clean" on poweredge and continue?

poweredge:/usr/ports/sysutils/screen# make clean
===> Cleaning for screen-4.0.2_4

Now back to mwmicro:

mwmicro:/usr/ports/sysutils/screen# make
===> Vulnerability check disabled, database not found
===> Extracting for screen-4.0.2_4
=> MD5 Checksum OK for screen-4.0.2.tar.gz.
=> SHA256 Checksum OK for screen-4.0.2.tar.gz.
mkdir: /usr/ports/sysutils/screen/work: Permission denied
*** Error code 1

Stop in /usr/ports/sysutils/screen.

Oh, that's right. /usr/ports is mounting read-only. I probably don't want to overwrite the ports tree anyway by exporting it read-write. Luckily I read FreeBSD Handbook after fzzzt in #freebsd suggested changing the work directory. I found the directive to change the location of the work directory and used it thus:

mwmicro:/usr/ports/sysutils/screen# make WRKDIRPREFIX=/tmp
===> Vulnerability check disabled, database not found
===> Extracting for screen-4.0.2_4
=> MD5 Checksum OK for screen-4.0.2.tar.gz.
=> SHA256 Checksum OK for screen-4.0.2.tar.gz.
===> Patching for screen-4.0.2_4
===> Applying FreeBSD patches for screen-4.0.2_4
===> Configuring for screen-4.0.2_4
configure: WARNING: you should use --build, --host, --target
this is screen version 4.0.2
checking for i386-portbld-freebsd6.1-gcc... cc
checking for C compiler default output... a.out
...edited...
mwmicro:/usr/ports/sysutils/screen# make install WRKDIRPREFIX=/tmp
===> Installing for screen-4.0.2_4
===> Generating temporary packing list
...edited...
mwmicro:/usr/ports/sysutils/screen# rehash
mwmicro:/usr/ports/sysutils/screen# which screen
/usr/local/bin/screen

Note that I used WRKDIRPREFIX=/tmp for both make and make install. Using that directive automatically made appropriate directories in /tmp:

mwmicro:/tmp/usr/ports/sysutils/screen/work# ls
.PLIST.flattened .configure_done.screen._usr_local
.PLIST.mktmp .extract_done.screen._usr_local
.PLIST.objdump .install_done.screen._usr_local
.PLIST.setuid .patch_done.screen._usr_local
.PLIST.writable screen-4.0.2
.build_done.screen._usr_local

I plan to use this system whenever I need to build an application using the ports tree and cannot make a package to share on other systems.

Update: If you try to build from a remote ports tree but the distfile for the desired port hasn't been downloaded, use 'make fetch' on the NFS server:

poweredge:/usr/ports/sysutils/screen# make fetch
=> screen-4.0.3.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.uni-erlangen.de/pub/utilities/screen/.
fetch: ftp://ftp.uni-erlangen.de/pub/utilities/screen/screen-4.0.3.tar.gz:
Service not available, closing control connection
=> Attempting to fetch from http://komquats.com/distfiles/.
screen-4.0.3.tar.gz 100% of 820 kB 52 kBps 00m00s

The continue with the steps shown above.

0 komentar:

Posting Komentar