Intro
Handbook, ports(7) and numerous articles made a good work: ports system is completely described. However, consulting some FreeBSD newbies I met a few questions that are important in some cases, but they are not mentioned in various guides.Step by step
Lets start. First of all we should:# cd /usr/ports/security/freebsd-updateYou may use any port instead of security/freebsd-update, but please don't select long-building applications, because it will make these easy steps too long.
Please, make sure that you are familiar with ports(7).
The first step is to extract source from archive:# make extract => MD5 Checksum OK for freebsd-update-1.6.tar.gz. => SHA256 Checksum OK for freebsd-update-1.6.tar.gz. /usr/bin/sed -e "s#PREFIX=/usr/local#PREFIX=/usr/local#g" /usr/ports/security/freebsd-update/work/freebsd-update-1.6/freebsd-update > /usr/ports/security/freebsd-update/work/freebsd-update-1.6/freebsd-update.new /bin/mv /usr/ports/security/freebsd-update/work/freebsd-update-1.6/freebsd-update.new /usr/ports/security/freebsd-update/work/freebsd-update-1.6/freebsd-updateLets see work folder is created. It contains the source code and something interesting:# cd work # ls freebsd-update-1.6 pkg-messagefreebsd-update-1.6 is extracted source code. Where did they get pkg-message? Let see... Oh! Ports system just copied it from security/freebsd-update/files. However, usually pkg-message is situated one level above.
# ls -a . .extract_done.freebsd-update._usr_local pkg-message .. freebsd-update-1.6The file .extract_done.freebsd-update._usr_local means that make extract was finised successfully. Go to security/freebsd-update and try make extract again:# make extract #It doesn't make anything, because system knows that extraction was successfully finised.
Lets go faster:# make patch ===> Patching for freebsd-update-1.6_2 ===> Applying FreeBSD patches for freebsd-update-1.6_2 # ls -a work . .extract_done.freebsd-update._usr_local freebsd-update-1.6 .. .patch_done.freebsd-update._usr_local pkg-message.patch_done.freebsd-update._usr_local patches were applied.# makeor# make build ===> Configuring for freebsd-update-1.6_2 ===> Building for freebsd-update-1.6_2 cc -O2 -pipe -march=pentium4m -O3 -I lib -o freebsd-update-verify verify.c lib/hashtab.c lib/hash.c lib/fftlut.c lib/fft.c lib/smpa.c lib/numt.c lib/rsa.c # ls -a work . .build_done.freebsd-update._usr_local .extract_done.freebsd-update._usr_local freebsd-update-1.6 .. .configure_done.freebsd-update._usr_local .patch_done.freebsd-update._usr_local pkg-message.configure_done.freebsd-update._usr_local - configure done.
.build_done.freebsd-update._usr_local - build done.# make installInstalls files and writes information to the ports database.# ls -a work . .. .PLIST.flattened .PLIST.mktmp .PLIST.objdump .PLIST.setuid .PLIST.writable .build_done.freebsd-update._usr_local .configure_done.freebsd-update._usr_local .extract_done.freebsd-update._usr_local .install_done.freebsd-update._usr_local .patch_done.freebsd-update._usr_local freebsd-update-1.6 pkg-messageLook at .install_done.freebsd-update._usr_local - installation complete.
After some operation (make extract, make patch, make, make install) was performed, special file will be created. The system will not perform operation again until corresponding file exists, i.e. make extract will not work if .extract_done.freebsd-update._usr_local exists. You may check this easy:# cd /usr/ports/security/freebsd-update/ # make clean # mkdir work # touch work/.extract_done.freebsd-update._usr_local # make extract # # ls -a work . .extract_done.freebsd-update._usr_local ..So, make extract didn't make anything.
Please, note that .*_done.${PORTNAME}.${PREFIX:S/\//_/g} files have zero size. It means that these files do not provide any useful information except the fact of their presence. But .PLIST.* files really contain some useful information.
They are insteresting: .PLIST.flattened, .PLIST.mktmp, .PLIST.objdump, .PLIST.setuid, .PLIST.writeable.
So, lets go:.PLIST.mktmp - 'packing list' file.There are a few other files that ports system generates in work directory. To get more information you should look at /usr/ports/Mk directory.
.PLIST.setuid - 'setuid list' file. This list contains files that port installs with setuid bit set. In my case it is empty.
.PLIST.writable - 'writable files/directories list' file. This list contains files or directories that will be installed world-writable. In my case it is empty.
.PLIST.flattened
.PLIST.objdump - file contains result of objdump(1) execution with -R parameter.
Finally
How does it help? - IDK. I do not like any tricky port installations, because usually it leads to problems with dependencies and upgrades. However, this information of course will help you in various non-standard situations.
First of all you should know much about ports system. My general advise to FreeBSD users is to use standard tools. Unfortunately, installation of software is still the problem. It is general problem for all Linux, UNIX, UNIX-like systems. I do not remember a week without questions about software installation, for FreeBSD the problem is installation of software from sources without using ports system. My opinion is you should know much about the system to make installation of something by hands, otherwise you should be very lucky.
A few months ago I changed something in x11-servers/xorg-server port. Changing some files I do not like to make clean and then make again, because it at least spends my time. It is better to remove work/.build_done.xorg-server._usr_X11R6 and run make again. This will save a lot of time, because in this case make will rebuild affected modules only (in my case it was less than two seconds).
I will not try to mention all possible applications. You will meet your own situation ;)
Feel free to contact, e-mail <keyhell@keyhell.org>