linux-f10-nss_ldap: my first port - be gentle :)

Da Rock freebsd-ports at herveybayaustralia.com.au
Wed Jan 11 00:48:10 UTC 2012


On 01/11/12 07:11, Alexander Leidinger wrote:
> On Mon, 09 Jan 2012 15:55:48 +1000 Da Rock
> <freebsd-ports at herveybayaustralia.com.au>  wrote:
>
>> Now my Makefile looks like this:
>>
>> # New ports collection makefile for:    linux-f10-nss_ldap
>> # Date created:                         2012-01-04
>> # Whom:                                 da porta
>> port_maintainer at herveybayaustralia.com.au
>> #
>> # $FreeBSD$
>> #
>>
>> PORTNAME=        nss_ldap
>> PORTVERSION=    0.01
> The PORTVERSION looks a little bit off to me. I would use something
> like ${NSS_LDAP_VERSION} or ${NSS_LDAP_VERSION}.${RPMVERSION} (the
> later may look a little bit strange... or not) to make it easy to
> compare what is installed on a system with what is available on linux.
Yeah, I'm still stuck on that - trying to find more info on what to use 
there. I've checked the handbook cover to cover, but still haven't 
discovered anything. I've left it till last to work out.
>> CATEGORIES=        net linux
>> MASTER_SITES=
>> ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/updates/testing/10/i386/
>> \
>>
>> http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/
>> \
>>                   http://herveybayaustralia.com.au/ports/distfiles/
> I can't remember if we have the fedora archives in bsd.sites.mk (if
> not, it would be worth to add it), and I'm too lazy ATM to search for
> it. If we have them (and they are OK), it would be better to use the
> bsd.sites.mk shortcodes for them. This would change automatically the
> master sites for this port if they are changed/improved in bsd.sites.mk.
I'm not 100% sure about the fedora archives, but I don't think they're 
exactly right. I keep getting (in most linux ports) a hunt through the 
MASTER_SITES for the file, starting with the archives.

The other pbone.net is definitely not in the sites list. I did check 
that file thoroughly using grep and by manual sighting.

One thing to note though is that when I tried with MASTER_SITES set to 
the FEDORA_LINUX set it failed to find the files. Also the files I need 
are only on pbone.net- they are more recent than the original. Or can I 
set the rpm version to "float" a bit?
>> PKGNAMEPREFIX=    linux-f10-
>> DISTNAME=        ${PORTNAME}-${NSS_LDAP_VERSION}-${RPMVERSION}
>>
>> MAINTAINER=        port_maintainer at herveybayaustralia.com.au
>> COMMENT=        RFC 2307 NSS Module (Linux Fedora 10)
>>
>> LICENSE=        GPLv2
>>
>> NSS_LDAP_VERSION=264
>>
>> USE_LINUX_RPM=  yes
>> USE_LINUX_PREFIX=yes
> Hmmm... I would expect that USE_LINUX_RPM automatically sets
> USE_LINUX_PREFIX... to be verified.
Possibly. I just wanted to be sure. I'll try it with it removed once I 
get it working correctly.
>> LINUX_DIST_VER= 10
>> RPMVERSION=     6.fc10
>> USE_LDCONFIG=    yes
>>
>> PLIST_FILES=    usr/lib/libnss_ldap.so.2 usr/lib/libnss_ldap.so
>> usr/lib/libnss_ldap-264.so
>> DOCSDIR=
>> ${PREFIX}/usr/share/doc/${PKGNAMEPREFIX}-${PORTNAME}-${PORTVERSION}
>> PORTDOCS=        COPYING NEWS README THANKS TODO
>> DESCR=            ${.CURDIR}/../${PORTNAME}/pkg-descr
>>
>> post-extract:
>>                   .if !defined(WITH_PAM)
>>                       @if [ -f ${WRKDIR}/lib/security/pam_ldap.so ];
>> then \ rm -rf ${WRKDIR}/lib/
>>                       fi
>>                       @if [ -f
>> ${WRKDIR}/usr/share/doc/nss_ldap-264/COPYING.pam_ldap ]; then \
>>                           rm -rf
>> ${WRKDIR}/usr/share/doc/nss_ldap-264/*.pam* fi
>>                   .else
>>                       PLIST_FILES+=lib/security/pam_ldap.so \
>>                           usr/share/doc/nss_ldap-264/AUTHORS.pam_ldap \
>>                           usr/share/doc/nss_ldap-264/COPYING.LIB.pam_ldap
>> \ usr/share/doc/nss_ldap-264/COPYING.pam_ldap \
>>                           usr/share/doc/nss_ldap-264/ChangeLog.pam_ldap
>> \ usr/share/doc/nss_ldap-264/NEWS.pam_ldap \
>>                           usr/share/doc/nss_ldap-264/README.pam_ldap \
>>                           usr/share/doc/nss_ldap-264/ldap.conf.pma_ldap
>>                   .endif
>>                   @if [ -f ${WRKDIR}/etc/ldap.conf ]; then \
>>                       ${MV} -p ${WRKDIR}/etc/ldap.conf
>> ${WRKDIR}/etc/ldap.conf.dist;
>>                   fi
>>                   PLIST_FILES+=usr/share/doc
>>
>> post-install:
>>                   @${CAT} ${PKGMESSAGE}
>>
>> .include<bsd.port.mk>
>> The man pages under the linux chroot, but the docs I thought would go
>> into the /usr/share/doc/as linux-f10-nss_ldap?
> If you are talking about the FreeBSD location /usr/share/doc and not
> the linux location /compat/linux/usr/share/doc:
> Linux ports are special to this. In the linux base we do not "bend the
> install" to put some stuff outside of /compat/linux.
>
> If you talk about the linux location: we do not bend the stuff
> inside /compat/linux to complay to the FreeBSD hier-man-page.
>
> Or short: let the RPM install the files where it wants to have them. Do
> not move them around.
Ok, ok, I'll leave them alone :) I did mention that I was over-thinking 
things before... I am pedantic enough to stick by the rules though.
>> On an aside I noticed that there is a better site to use straight up
>> for linux dist rpms- see the MASTER_SITES list in the Makefile. Might
>> be a good idea to update the list under MASTER_SITE_FEDORA_LINUX to
>> include these first? The others seem rather empty.
> My comment above for bsd.sites.mk was something like you suggest here,
> just that it should be MASTER_SITE_FEDORA_LINUX_ARCHIVE or similar (I
> hope that the MASTER_SITE_FEDORA_LINUX could be useful as it is for an
> hypothetic (= nobody works on something like this ATM) update of the
> default linux_base port).
My last problem is with the define knobs. I have an .if 
defined(WITH_PAM) .else ... .endif statement, but it keeps giving me 
trouble. I can't quite figure what I've got wrong. The statement looks 
like this:

PLIST_FILES=    usr/lib/libnss_ldap.so.2 usr/lib/libnss_ldap.so 
usr/lib/libnss_ldap-264.so
DOCSDIR=        
${PREFIX}/usr/share/doc/${PKGNAMEPREFIX}-${PORTNAME}-${PORTVERSION}
PORTDOCS=        usr/share/doc/nss_ldap-264/ANNOUNCE.nss_ldap \
                 usr/share/doc/nss_ldap-264/AUTHORS.nss_ldap \
                 usr/share/doc/nss_ldap-264/COPYING.nss_ldap \
                 usr/share/doc/nss_ldap-264/ChangeLog.nss_ldap \
                 usr/share/doc/nss_ldap-264/NEWS.nss_ldap \
                 usr/share/doc/nss_ldap-264/README.nss_ldap \
                 usr/share/doc/nss_ldap-264/README.TLS \
                 usr/share/doc/nss_ldap-264/ldap.conf.nss_ldap \
                 usr/share/doc/nss_ldap-264/ldapns.schema \
                 usr/share/doc/nss_ldap-264/ns-pwd-policy.schema \
                 usr/share/doc/nss_ldap-264/nsswitch.ldap
MAN5=            usr/share/man/man5/nss_ldap.5.gz
DESCR=            ${.CURDIR}/../${PORTNAME}/pkg-descr

pre-fetch:
                 @${ECHO_MSG} "Use WITH_PAM if you require more advanced 
ldap support in the linuxulator"

post-extract:
                 .if defined(WITH_PAM)
                     PLIST_FILES+=lib/security/pam_ldap.so
                     PORTDOCS+=usr/share/doc/nss_ldap-264/AUTHORS.pam_ldap \
                         usr/share/doc/nss_ldap-264/COPYING.LIB.pam_ldap \
                         usr/share/doc/nss_ldap-264/COPYING.pam_ldap \
                         usr/share/doc/nss_ldap-264/ChangeLog.pam_ldap \
                         usr/share/doc/nss_ldap-264/NEWS.pam_ldap \
                         usr/share/doc/nss_ldap-264/README.pam_ldap \
                         usr/share/doc/nss_ldap-264/ldap.conf.pma_ldap \
                         usr/share/doc/nss_ldap-264/pam.d/chfn \
                         usr/share/doc/nss_ldap-264/pam.d/kde \
                         usr/share/doc/nss_ldap-264/pam.d/passwd \
                         usr/share/doc/nss_ldap-264/pam.d/rlogin    \
                         usr/share/doc/nss_ldap-264/pam.d/vlock \
                         usr/share/doc/nss_ldap-264/pam.d/chsh \
                         usr/share/doc/nss_ldap-264/pam.d/linuxconf \
                         usr/share/doc/nss_ldap-264/pam.d/pop \
                         usr/share/doc/nss_ldap-264/pam.d/rsh \
                         usr/share/doc/nss_ldap-264/pam.d/xdm \
                         usr/share/doc/nss_ldap-264/pam.d/ftp \
                         usr/share/doc/nss_ldap-264/pam.d/linuxconf-pair \
                         usr/share/doc/nss_ldap-264/pam.d/poweroff \
                         usr/share/doc/nss_ldap-264/pam.d/samba \
                         usr/share/doc/nss_ldap-264/pam.d/xlock \
                         usr/share/doc/nss_ldap-264/pam.d/gdm \
                         usr/share/doc/nss_ldap-264/pam.d/login \
                         usr/share/doc/nss_ldap-264/pam.d/ppp \
                         usr/share/doc/nss_ldap-264/pam.d/shutdown \
                         usr/share/doc/nss_ldap-264/pam.d/xscreensaver \
                         usr/share/doc/nss_ldap-264/pam.d/halt \
                         usr/share/doc/nss_ldap-264/pam.d/mcserv    \
                         usr/share/doc/nss_ldap-264/pam.d/reboot \
                         usr/share/doc/nss_ldap-264/pam.d/ssh \
                         usr/share/doc/nss_ldap-264/pam.d/xserver \
                         usr/share/doc/nss_ldap-264/pam.d/imap \
                         usr/share/doc/nss_ldap-264/pam.d/other \
                         usr/share/doc/nss_ldap-264/pam.d/rexec \
                         usr/share/doc/nss_ldap-264/pam.d/su
                     PLIST_DIRS+=@dirrmtry usr/share/doc/pam.d
                     MAN5+=usr/share/man/man5/pam_ldap.5.gz
                 .else
                     @if [ -f ${WRKDIR}/lib/security/pam_ldap.so ]; then \
                         ${RM} ${WRKDIR}/lib/security/pam_ldap.so
                         ${DIRRM} ${WRKDIR}/lib/;
                     fi
                     @if [ -f 
${WRKDIR}/usr/share/doc/nss_ldap-264/COPYING.pam_ldap ]; then \
                         ${RM} ${WRKDIR}/usr/share/doc/nss_ldap-264/*pam*;
                     fi
                     @if [ -f ${WRKDIR}/usr/share/man/man5/pam_ldap.5.gz 
]; then \
                         ${RM} ${WRKDIR}/usr/share/man/man5/pam_ldap.5.gz;
                     fi
                 .endif
                 @if [ -f ${WRKDIR}/etc/ldap.conf ]; then \
                     ${MV} -p ${WRKDIR}/etc/ldap.conf 
${WRKDIR}/etc/ldap.conf.dist;
                 fi

The errors are unexpected "(". What am I doing wrong?

Only one more thing: do I need USE_LDCONFIG?


More information about the freebsd-ports mailing list