Subject: New pkg submit: pkgsrc/sysutils/logrotate
To: None <>
From: Brian A. Seklecki <>
List: tech-pkg
Date: 08/02/2003 02:59:42
There's a logrotate(8) (as seen in some GNU/Linux distros) that I
frequently use in place of newsyslog(8) for a number of flexibility
reasons. I normally source compile, but I figure I'd rather have someone
commit it to pkgsrc instead. And so here it is:

pkglink(8) checks out on it for sanity checks, but there are two serious
problems I need advice on:

The NetBSD pkg i've compiled is at:

Shall I submit it another way? perhaps send-pr(1) ?..pkgsrc-wip?

1) The name of the package is "logrotate-3.6.5" but the name of the
source distribution tarball is "logrotate_3.6.5.orig.tar.gz"

So I set:

DISTNAME=       ${PKGNAME:S/-/_/}.orig
PKGNAME=        logrotate-3.6.5

...based on some other package's Makefiles, but that isn't being useful
or more likely I'm using it wrong.  Plus I'm not sure how to use a
sed(1) regex to insert into a string, so maybe someone can offer some
insign there

The URL of the file is:

So I set:

MASTER_SITES=   ${MASTER_SITE_DEBIAN:=pool/main/l/logrotate/}

...and that seems to work.

2) I had to completely re-write the Makefile (included in my tar file as
./Makefile-logrotate_src) included with the original package tarball (to
the point where it would be silly to submit a patch file, it would make
more sense to have a "pre-build:" targate and ${CP} the working one from
${FILES}/Makefile to ${WRKDIR}/${DISTNAME}/Makefile and overwrite the
inclded one).  I also had to setup a "do-install:" target because the
Makefile would have been overkill.  

I was running into some ld(1) errors at that point, so I had to
statically pound -L/usr/pkg/lib into the CFLAGS variable (an obvious
error), but now I'm getting:

*** The above programs/libs will not find the listed shared libraries
    at runtime. Please fix the package (add -Wl,-R.../lib in the right
*** Error code 1

And indeed, the sbin/ binary is not linking properly:

# ldd /usr/pkg/sbin/logrotate 
         -lpopt.0 => not found
         -lintl.0 => /usr/lib/
         -lc.12 => /usr/lib/

...which seems odd that it would link to libintl but not lpopt.  So
maybe someone can enlighten me on the voodoo behind our ld(1) ?  I can
only assume statically setting $LDFLAGS would be further erroneous.  I
thought took care of setting all those environmentals!



NOTE: When replying to a mailing list post, please be sure to reply to
the /list/ and cc: or bcc: myself as I am unable to promise a timely