When installing groff for the very first time it tries to guess the default paper size. It does this by reading /etc/resolv.conf, or running domainname and hostname in order to find the top-level domain. From GROFF_PAGE in aclocal.m4: # If the top-level domain is two letters and it's not `us' or `ca' # then they probably use A4 paper. This means that many (or most?) users in the US or Canada end up with 'papersize a4' rather than 'papersize letter' in /usr/share/groff/1.18.1/font/devps/DESC Perhaps /etc/localtime could be used to determine where we are, then PAGE=a4 or PAGE=letter could be passed to configure? Or at least a pkg_postinst warning issued?
eh? are you sure? I would think !us && !ca == a4 from that statement, which makes sense
if (length(top-level) == 2 && top-level != 'us' && top-level != 'ca') { papersize = A4 } That's what the comment says... makes sense to me! That means that .com, .org, .net and .edu would default to letter. /etc/localtime might be a better method, but not THAT much better. Much better would be to have default papersize set in /etc/rc.conf and have packages inherit from there (preferably at run-time)
Ha! :) I knew something screwy was going on with groff, but you've both made me look for the reason why. The configure script *should* always be following the above logic, but it doesn't always. I've noticed that those outside the US or Canada often default to letter papersize on a first install, whilst those in the US or Canada default to A4 on each subsequent install. :/ When checking for a default papersize, the configure script first checks to see if we already have a DESC file. Since we don't have this on the first install, the the configure script then checks /etc/resolv.conf or runs domainname/hostname in order to find the top-level domain: dom=`awk '($1 == "dom" || $1 == "search") { print $2; exit}' \ /etc/resolv.conf 2>/dev/null` if test -z "$dom"; then dom=`(domainname) 2>/dev/null | tr -d '+'` if test -z "$dom" \ || test "$dom" = '(none)'; then dom=`(hostname) 2>/dev/null | grep '\.'` fi fi Since the domainname and hostname are set later on in the install process, only parsing /etc/resolv.conf for occurences of 'dom' or 'search' may actually produce usuable results. Finally we check the top-level domain: case "$dom" in *.[Uu][Ss]|*.[Cc][Aa]) ;; *.[A-Za-z][A-Za-z]) PAGE=A4 ;; esac This means the vast majority of people around the world will default to 'letter' papersize. BUT, whenever we reinstall groff, there will be an DESC file that we can check for paperlength and papersize: if test -n "$descfile"; then if grep '^paperlength[ ]\+841890' $descfile >/dev/null 2>&1; then PAGE=A4 elif grep '^papersize[ ]\+[aA]4' $descfile \ >/dev/null 2>&1; then PAGE=A4 fi fi I think the missing "\" at the end of "if grep '^paperlength[ ]\+841890' $descfile" means everyone will now default to A4. :/
0.19.1 seems to have this fixed ... if test -n "$descfile"; then if grep '^paperlength[ ]\+841890' $descfile >/dev/null 2>&1; then PAGE=A4 elif grep '^papersize[ ]\+[aA]4' $descfile >/dev/null 2>&1; then PAGE=A4 fi