Subject: simplifying an installation of examples and doc files
To: None <tech-pkg@NetBSD.org>
From: Aleksey Cheusov <cheusov@tut.by>
List: tech-pkg
Date: 10/20/2007 22:57:09
pkgsrc has tons of package/Makefile's that contain section like the
following:

    DOCDIR=         ${PREFIX}/share/doc/${PKGBASE}
    EGDIR=

    DOCFILES=      README COPYRIGHT NEWS ChangeLog
    EGFILES=       example1.conf example2.conf

    INSTALLATION_DIRS+=   ${DOCDIR} ${EGDIR}

    post-install:
    .for i in ${DOCFILES}
         ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCDIR}
    .endfor
    .for i in ${EGFILES}
         ${INSTALL_DATA} ${WRKSRC}/${i} ${EGDIR}
    .endfor

How about introducing two special variables for simplifying the above code?

    PKG_DOC_FILES=        README COPYRIGHT NEWS ChangeLog
    PKG_EXAMPLE_FILES=    example1.conf example2.conf

-- 
Best regards, Aleksey Cheusov.