pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: news/nn-6.7.3 (Re: non-DESTDIR status: 68 to go



Thanks obache San,

 I hope attached one enables user-destdir for nn.

Pkglint flags some points, say don't hide @${CP},etc.
but the attached one is for minimum difference from
existing Makefile.

The patch is also place as
 http://www.ki.nu/~makoto/pkgsrc/news/nn-6.7.3-1.diff
---
Makoto Fujiwara, 
Index: Makefile
===================================================================
RCS file: /e/cvsync/cvsync/pkgsrc/news/nn/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- Makefile    13 Mar 2010 05:05:51 -0000      1.37
+++ Makefile    5 Jun 2011 05:31:25 -0000
@@ -8,6 +8,7 @@
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://www.nndev.org/
 COMMENT=       NN newsreader
+PKG_DESTDIR_SUPPORT=   user-destdir
 
 PKG_SYSCONFSUBDIR=     nntp
 
@@ -39,16 +40,26 @@
 
 INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man8
 
+SUBST_CLASSES+=        nn
+SUBST_STAGE.nn=        pre-configure
+SUBST_FILES.nn= config.h
+SUBST_MESSAGE.nn= PATCH adjust for DESTDIR
+# attach DESTDIR onto  PKGMANDIR before @PREFIX@ is changed
+SUBST_SED.nn+= -e 's|@PREFIX@/@PKGMANDIR@|${DESTDIR}${PREFIX}/${PKGMANDIR}|'
+SUBST_SED.nn+= -e 's|@PREFIX@|${PREFIX}|'
+SUBST_SED.nn+= -e 's|BINDIR|${DESTDIR}${PREFIX}/bin|'
+SUBST_SED.nn+= -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|'
+SUBST_SED.nn+= -e 's|@BINOWN@|${BINOWN}|'
+SUBST_SED.nn+= -e 's|@BINGRP@|${BINGRP}|'
+SUBST_SED.nn+= -e 's|@MFILE@|${MFILE}|'
+SUBST_SED.nn+= -e 's|@SFILE@|${SFILE}|'
+# BIN_DIRECTORY
+SUBST_SED.nn+= -e 's|PREFIX "/bin"|"${DESTDIR}${PREFIX}/bin"|'
+# LIB_DIRECTORY
+SUBST_SED.nn+= -e 's|PREFIX "/share/nn"|"${DESTDIR}${PREFIX}/share/nn"|'
+
 post-patch:
-       @${SED} -e ' \
-           s#@PREFIX@#${PREFIX}#; \
-           s#@PKG_SYSCONFDIR@#${PKG_SYSCONFDIR}#; \
-           s#@PKGMANDIR@#${PKGMANDIR}#; \
-           s#@BINOWN@#${BINOWN}#; \
-           s#@BINGRP@#${BINGRP}#; \
-           s#@MFILE@#${MFILE}#; \
-           s#@SFILE@#${SFILE}#' \
-           <${WRKSRC}/config.h-dist >${WRKSRC}/config.h
+       @${CP} ${WRKSRC}/config.h-dist ${WRKSRC}/config.h
        @${CP} ${FILESDIR}/s-netbsd.h ${WRKSRC}/conf/s-netbsd.h
        @${CP} ${FILESDIR}/m-powerpc.h ${WRKSRC}/conf/m-powerpc.h
        @${CP} ${FILESDIR}/m-x86_64.h ${WRKSRC}/conf/m-x86_64.h



Home | Main Index | Thread Index | Old Index