I wanted to get a new version of the Unix command file(1) to install locally on our workstation at work.
It was quite a job finding it, let me tell you. (The fact that "file" is a common word didn't help, either.) It's not a GNU project, so it's not on any of their servers. It popped up in a couple of distributions, but as an RPM, which I can't read on a Hockey-PUX machine. I found a source archive (.tar.bz2) at a Cygnus mirror, but it required autoconf and stuff like that, which I (a) didn't have and (b) didn't want to download just for this. I found a reference on the Linux-from-scratch project but I preferred something from "the horse's mouth", as far as I could determine that.
Finally, after a bit of googling (now including a little tagline from the package description), I saw a pointer at Freshmeat which pointed to what looked like an authoritative distribution source at ftp.gw.com: http://freshmeat.net/releases/90188/ . This was also a newer release (3.39) than the ones I had previously found (typically 3.37). So, I downloaded this version.
...and it also required automake. WTF? Pretty much all software I had downloaded previously which used automake had a ready-make configure while which did all the stuff for you, so the poor chap downloading the archive doesn't have need any extra modules.
However, there was also a file called "Makefile.std" which looked like one of the good old "here, customize this Makefile to suit your system" files. So I did exactly that.
Compiling brought out a bunch of errors, mostly casts between "char *" and "unsigned char *". Hey, if you're going to mix the two, please cast explicitly, OK? (Or better still, make a design decision and use the one that is correct in a given place. Most of this was when calling private subroutines rather than C library ones.) And one warning baffled me ("casting pointer to integer") since it looked like an integer to me... but it was hidden behind a couple of layers of macros. Still, it compiled, so I ignored it (and it was in the ELF code, which I probably shan't need too often on the Hockey-PUX machine). During compiling, I also incrementally added some -DHAS_FOO macros to the Makefile as needed to prevent the header file from defining stuff my system already had.
And finally I had a brand sparkling new file! I installed it in ~/bin (and ~/etc/magic and ~/man/man/*) and now am set to go. I hope :)
Noooooo! I knew it! All this work was for nothing. Argg! *tears hair out*
I thought I'd post a little addendum to this entry saying "I wonder if this utility was already available pre-compiled for HPUX systems -- nah, probably not". But then I had a look. Took a couple of searches till I had the HP-UX Porting and Archive Centre, but then, there it was -- http://hpux.asknet.de/hppd/hpux/Editors/file-3.38/ . Ready-made for easy installation into /opt/file. *sniff*
Still -- at least I have a newer version. Still, a minor consolation only. Oh, sigh. Now I'm peeved.