pkgsrc-WIP-discuss archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
observations about wip/heirloom-sh
Hi,
being in need of an ancient UNIX shell I found wip/heirloom-sh and all the
other wip/heirloom-* packages. Below are some observations about this
set of packages.
When I first saw it, I didn't like using PREFIX/heirloom but on second
thought it seems like the best solution. The programs will be used
similarly to the GNU programs but there is no established program prefix
like "g" for them, so there would probably be some collisions,
especially for people having PREFIX=/usr.
On the other hand I do not think PREFIX/heirloom/var/* is a good idea.
PREFIX may be mounted read-only over NFS which would not allow writing
to PREFIX/heirloom/var. Better to use VARBASE/* or VARBASE/heirloom/*.
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
and then overriding the values in makefile in the pkgsrc Makefile
MAKE_FLAGS+= ROOT=${DESTDIR:Q}
MAKE_FLAGS+= SV3BIN=${PREFIX:Q}/heirloom/bin
This way, the changes are not intrusive enough to prevent the package
from building on other platforms, yet they serve the purposes of pkgsrc
well enough.
For details, see the attached changes for wip/heirloom-sh.
ciao
Klaus
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 12 May 2007 15:19:22 -0000
@@ -10,26 +10,28 @@
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+= ROOT=${DESTDIR:Q}
+MAKE_FLAGS+= SV3BIN=${PREFIX:Q}/heirloom/bin
+MAKE_FLAGS+= MANDIR=${PREFIX:Q}/heirloom/man
+MAKE_FLAGS+= UCBINST=${INSTALL:Q}
+MAKE_FLAGS+= LARGEF=
+MAKE_FLAGS+= CPPFLAGS=${CPPFLAGS:Q}
+
+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 12 May 2007 15:19:22 -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) = 4989e458692cf395834fe820a83375128de76453
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 12 May 2007 15:19:22 -0000
@@ -1,69 +1,61 @@
$NetBSD$
---- makefile.orig 2005-07-06 13:59:57.000000000 +0300
+--- makefile.orig 2005-07-06 12:59:57.000000000 +0200
+++ makefile
@@ -2,17 +2,17 @@
# Root directory. Mainly useful for package building; leave empty for
# normal installation.
#
-ROOT=
-+#ROOT=
++ROOT?=
#
# The destination directory for the "sh" and "jsh" binaries.
#
-SV3BIN=/usr/5bin
-+SV3BIN=${DESTDIR}/heirloom/bin
++SV3BIN?=/usr/5bin
#
# Location for manual pages (with man1 below).
#
-MANDIR=/usr/share/man/5man
-+MANDIR=${DESTDIR}/heirloom/man
++MANDIR?=/usr/share/man/5man
#
# 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?=/usr/ucb/install
#
# The strip command that is used at installation time.
-@@ -44,26 +44,26 @@ LNS=ln -s
+ #
+-STRIP=strip
++STRIP?=strip
+
+ #
+ # A command to create the link from "jsh" to "sh".
+@@ -44,17 +44,17 @@ LNS=ln -s
#
# Compiler flags.
#
-CFLAGS=-O
-+#CFLAGS=-O
++CFLAGS?=-O
#
# Flags for the C preprocessor.
#
-CFLAGS=-D_GNU_SOURCE
-+#CFLAGS=-D_GNU_SOURCE
++CPPFLAGS?=-D_GNU_SOURCE
#
# A define for large file support, if necessary.
#
-LARGEF=-D_FILE_OFFSET_BITS=64L
-+#LARGEF=-D_FILE_OFFSET_BITS=64L
++LARGEF?=-D_FILE_OFFSET_BITS=64L
#
# The compiler warning options.
- #
--WERROR=-Werror
--WARN = -Wchar-subscripts -Wformat -Wno-format-y2k -Wimplicit \
-- -Wmissing-braces -Wsequence-point -Wreturn-type -Wtrigraphs \
-- -Wunused-function -Wunused-label -Wunused-variable -Wunused-value \
-- -Wuninitialized -Wmultichar -Wpointer-arith $(WERROR)
-+#WERROR=-Werror
-+#WARN = -Wchar-subscripts -Wformat -Wno-format-y2k -Wimplicit \
-+# -Wmissing-braces -Wsequence-point -Wreturn-type -Wtrigraphs \
-+# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value \
-+# -Wuninitialized -Wmultichar -Wpointer-arith $(WERROR)
- WARN=
-
- #
-------------------------------------------------------------------------
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