pkgsrc-WIP-discuss archive

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

Re: observations about wip/heirloom-sh



> Another point I noticed was patch-aa for heirloom-sh (and some other
> patches in the set). When creating packages it is best practice,
> IMO, to not only think: "How do I get it to build and run?" but also
> "would the patches be acceptable by the upstream author(s)?"

> In the case of wip/heirloom-sh ignoring the original variable for
> building packages (they call it ROOT instead of the usual DESTDIR)
> and simply patching makefile with the values pkgsrc needs is probably
> not the way to go.
> I would propose to do it like this:

>   -ROOT=
>   +ROOT?=
>   ...
>   -SV3BIN=/usr/5bin
>   +SV3BIN?=/usr/5bin

This looks fine for BSD make but it doesn't work on standard make
(or at least it doesn't work on Solaris).

         0 tmp>cat 1.mk
         VAR?=1123445

         all:
         echo VAR=$(VAR)

         0 tmp>bmake -f 1.mk
         echo VAR=1123445
         VAR=1123445

         0 tmp>make -f 1.mk
         echo VAR=
         VAR=

         0 tmp>which make
         /usr/xpg4/bin/make

         0 tmp>uname -a
         SunOS sol120 5.10 Generic_118833-03 sun4u sparc SUNW,Sun-Fire-V240

         0 tmp>

So, suggestions itself is good but I think upstream will decline this.
As far as understand they are interested in max portability and don't
want to require BSD or GNU make.

> For details, see the attached changes for wip/heirloom-sh.
Applied partially with my modifications. USE_DESTDIR=yes works perfectly.
Thanks for the patch and suggestion.
Feel free to test it.

? destdir.patch
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/heirloom-sh/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile    7 Jan 2007 14:04:15 -0000       1.2
+++ Makefile    19 May 2007 14:23:47 -0000
@@ -10,26 +10,27 @@
 HOMEPAGE=              http://heirloom.sourceforge.net/
 COMMENT=               Traditional Unix shell derived from OpenSolaris code
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 .include "../../mk/bsd.prefs.mk"
 
-CFLAGS.Linux+=         -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64L
+CPPFLAGS.Linux+=       -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64L
 
 PKGDOCDIR=             ${PREFIX}/share/doc/${PKGBASE}
 INSTALLATION_DIRS+=    ${PKGDOCDIR}
 
 DOC_FILES=     CHANGES CALDERA.LICENSE OPENSOLARIS.LICENSE README
 
-do-build:
-       cd ${WRKSRC} && \
-       env ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
-               DESTDIR=${PREFIX:Q} -f makefile
-
-do-install:
-       cd ${WRKSRC} && \
-       env ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
-               DESTDIR=${PREFIX:Q} -f makefile install
+MAKE_FILE=     makefile
+MAKE_FLAGS+=   PREFIX=${PREFIX:Q}
+MAKE_FLAGS+=   ROOT=${DESTDIR:Q}
+MAKE_FLAGS+=   UCBINST=${INSTALL_DATA:Q}
+MAKE_FLAGS+=   UCBINST_PROG=${INSTALL_PROGRAM:Q}
+MAKE_FLAGS+=   STRIP=true
+
+post-install:
 .for i in ${DOC_FILES}
-       ${INSTALL_DATA} ${WRKSRC}/${i} ${PKGDOCDIR}
+       ${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PKGDOCDIR}
 .endfor
 
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/heirloom-sh/distinfo,v
retrieving revision 1.1
diff -u -r1.1 distinfo
--- distinfo    9 Sep 2006 15:28:16 -0000       1.1
+++ distinfo    19 May 2007 14:23:47 -0000
@@ -3,4 +3,4 @@
 SHA1 (heirloom-sh-050706.tar.bz2) = 0ce709c21e09ef183986347cf1ed80d5884aa12d
 RMD160 (heirloom-sh-050706.tar.bz2) = 584458f73e7cd2376b333de2a5fd8a13f364d516
 Size (heirloom-sh-050706.tar.bz2) = 82725 bytes
-SHA1 (patch-aa) = bfaad247630476343f0d1de6d856ce45c8d40985
+SHA1 (patch-aa) = 16e849b56ca694cf1942936a373ed01c552a5eda
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/heirloom-sh/patches/patch-aa,v
retrieving revision 1.1
diff -u -r1.1 patch-aa
--- patches/patch-aa    9 Sep 2006 15:28:16 -0000       1.1
+++ patches/patch-aa    19 May 2007 14:23:47 -0000
@@ -13,25 +13,31 @@
  # The destination directory for the "sh" and "jsh" binaries.
  #
 -SV3BIN=/usr/5bin
-+SV3BIN=${DESTDIR}/heirloom/bin
++SV3BIN=${PREFIX}/heirloom/bin
  
  #
  # Location for manual pages (with man1 below).
  #
 -MANDIR=/usr/share/man/5man
-+MANDIR=${DESTDIR}/heirloom/man
++MANDIR=${PREFIX}/heirloom/man
  
  #
  # Enable this definition if spell checking should be done for the
-@@ -23,7 +23,7 @@ MANDIR=/usr/share/man/5man
+@@ -23,12 +23,12 @@ MANDIR=/usr/share/man/5man
  #
  # A BSD-compatible install command.
  #
 -UCBINST=/usr/ucb/install
-+UCBINST=install
++#UCBINST=install
  
  #
  # The strip command that is used at installation time.
+ #
+-STRIP=strip
++#STRIP=strip
+ 
+ #
+ # A command to create the link from "jsh" to "sh".
 @@ -44,26 +44,26 @@ LNS=ln -s
  #
  # Compiler flags.
@@ -67,3 +73,12 @@
  WARN=
  
  #
+@@ -93,7 +93,7 @@ sh.1.out: sh.1
+ 
+ install: all
+       test -d $(ROOT)$(SV3BIN) || mkdir -p $(ROOT)$(SV3BIN)
+-      $(UCBINST) -c -m 755 sh $(ROOT)$(SV3BIN)/sh
++      $(UCBINST_PROG) -c -m 755 sh $(ROOT)$(SV3BIN)/sh
+       $(STRIP) $(ROOT)$(SV3BIN)/sh
+       rm -f $(ROOT)$(SV3BIN)/jsh
+       cd $(ROOT)$(SV3BIN) && $(LNS) sh jsh
-- 
Best regards, Aleksey Cheusov.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index