From 17fe998955da708ba7730acb352fee528a0d1795 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 5 Nov 2006 09:09:20 +0000 Subject: Removed the pkgsrc portability book, as editing DocBook XML is no fun at all. The contents has been moved to the NetBSD wiki at: http://wiki.aydogan.net/index.php/The_pkgsrc_portability_guide --- doc/portability-book/DESCR | 3 - doc/portability-book/Makefile | 93 -------------- doc/portability-book/distinfo | 5 - doc/portability-book/files/Makefile | 27 ---- doc/portability-book/files/chapters.ent | 10 -- doc/portability-book/files/devices.xml | 10 -- doc/portability-book/files/functions.xml | 94 -------------- doc/portability-book/files/headers.xml | 9 -- doc/portability-book/files/intro.xml | 22 ---- doc/portability-book/files/libraries.xml | 9 -- doc/portability-book/files/portability.xml | 59 --------- doc/portability-book/files/utilities.xml | 200 ----------------------------- 12 files changed, 541 deletions(-) delete mode 100644 doc/portability-book/DESCR delete mode 100644 doc/portability-book/Makefile delete mode 100644 doc/portability-book/distinfo delete mode 100644 doc/portability-book/files/Makefile delete mode 100644 doc/portability-book/files/chapters.ent delete mode 100644 doc/portability-book/files/devices.xml delete mode 100644 doc/portability-book/files/functions.xml delete mode 100644 doc/portability-book/files/headers.xml delete mode 100644 doc/portability-book/files/intro.xml delete mode 100644 doc/portability-book/files/libraries.xml delete mode 100644 doc/portability-book/files/portability.xml delete mode 100644 doc/portability-book/files/utilities.xml diff --git a/doc/portability-book/DESCR b/doc/portability-book/DESCR deleted file mode 100644 index ac2394f239e..00000000000 --- a/doc/portability-book/DESCR +++ /dev/null @@ -1,3 +0,0 @@ -The pkgsrc portability book covers many of the platform-specific issues -that are useful when writing programs that are portable to a great -number of UNIX-like operating systems. diff --git a/doc/portability-book/Makefile b/doc/portability-book/Makefile deleted file mode 100644 index 04af909a284..00000000000 --- a/doc/portability-book/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2006/10/07 09:28:23 rillig Exp $ -# - -DISTNAME= portability-book-${TODAY} -CATEGORIES= # empty -MASTER_SITES= ${MASTER_SITE_LOCAL} -DISTFILES= htdocs-share-20061007.tar.gz - -MAINTAINER= rillig@NetBSD.org -#HOMEPAGE= http://www.NetBSD.org/Documentation/pkgsrc/ -COMMENT= The pkgsrc portability book - -TODAY!= date '+%Y%m%d' -DIST_SUBDIR= pkgsrc-guide -NO_MTREE= yes -USE_LANGUAGES= # none - -PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC -DOCDIR= ${PREFIX}/share/doc/pkgsrc-portability -HTDOCSDIR?= ${.CURDIR}/../../../htdocs - -BUILD_DEFS+= OUTPUTS -OUTPUTS?= lint html html-split ascii pdf - -.if defined(OUTPUTS) -. if !empty(OUTPUTS:Mascii) -# the html is needed to build the ascii version. -OUTPUTS+= html -. endif - -# only override the Makefile.common default if it is explicitly set -_GUIDE_OUTPUTS= ${OUTPUTS} -.endif - -DEPENDS+= netbsd-doc-print>=1.2:../../meta-pkgs/netbsd-doc-print - -# The source files are only symlinked into the WRKSRC, so that they can -# be easily modified, should the "lint" phase fail. -pre-extract: - ${MKDIR} ${WRKSRC} - ${LN} -s ${FILESDIR}/* ${WRKSRC} - ln -s ${PKGSRCDIR}/doc/guide/files/share ${WRKSRC}/ - -do-build: -.for _output_ in ${OUTPUTS} - @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${_output_} -.endfor - -post-build: - @${RM} -f ${WRKSRC}/portability.tmp.html - -do-install: - ${INSTALL_DATA_DIR} ${DOCDIR} -.if !empty(OUTPUTS:Mhtml) || !empty(OUTPUTS:Mhtml-split) - ${INSTALL_DATA} ${WRKSRC}/*.html ${DOCDIR} - ${INSTALL_DATA} ${WRKDIR}/htdocs/NetBSD.css ${DOCDIR} -.endif -.if !empty(OUTPUTS:Mascii) - ${INSTALL_DATA} ${WRKSRC}/portability.txt ${DOCDIR} -.endif -.if !empty(OUTPUTS:Mpdf) - ${INSTALL_DATA} ${WRKSRC}/portability.ps ${DOCDIR} - ${INSTALL_DATA} ${WRKSRC}/portability.pdf ${DOCDIR} -.endif - -post-install: - ${FIND} ${DOCDIR} \( -type f -o -type l \) -print \ - | ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \ - >> ${PLIST_SRC} - ${FIND} ${DOCDIR} -type d -print \ - | ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \ - >> ${PLIST_SRC} - -do-lint: - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} lint - -DETAB_PROGRAM= \ - if (// .. /<\/programlisting>/) { \ - while (/(.*?)\t(.*)/s) { \ - my $$filler = " " x (8 - (length($$1) % 8)); \ - $$_ = "$$1$$filler$$2"; \ - } \ - } - -# remove tabulators from the tags. -# TeX does not like them. -.PHONY: detab -detab: - cd ${FILESDIR} && \ - perl -p -i".detab.tmp" -e '${DETAB_PROGRAM}' *.xml && \ - ${RM} -f *.xml.detab.tmp - -.include "../../mk/bsd.pkg.mk" diff --git a/doc/portability-book/distinfo b/doc/portability-book/distinfo deleted file mode 100644 index 88dd9527b93..00000000000 --- a/doc/portability-book/distinfo +++ /dev/null @@ -1,5 +0,0 @@ -$NetBSD: distinfo,v 1.2 2006/10/07 09:28:23 rillig Exp $ - -SHA1 (pkgsrc-guide/htdocs-share-20061007.tar.gz) = b8a57eb2b7d2ae4bc632dca9e2d97ab278010e3a -RMD160 (pkgsrc-guide/htdocs-share-20061007.tar.gz) = 6a135fea1cf25ff83dd53ded17c908911a01d2c3 -Size (pkgsrc-guide/htdocs-share-20061007.tar.gz) = 94100 bytes diff --git a/doc/portability-book/files/Makefile b/doc/portability-book/files/Makefile deleted file mode 100644 index 2d65f090115..00000000000 --- a/doc/portability-book/files/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# $NetBSD: Makefile,v 1.1.1.1 2006/10/06 21:10:41 rillig Exp $ - -DOC= portability - -SRCS= portability.xml -SRCS+= chapters.ent -SRCS+= intro.xml -SRCS+= utilities.xml -SRCS+= headers.xml -SRCS+= functions.xml -SRCS+= devices.xml - -# Make deeper TOC: -XSL_DBX_WITH_TOC_SECTION_DEPTH?= 2 - -# Avoid extra normalization -NO_TIDY?= yes - - -all: # doing this as depends doesn't work - ${MAKE} html-split - ${MAKE} html - ${MAKE} ascii - ${MAKE} pdf - -WEB_PREFIX= ${.CURDIR}/../htdocs -.include "../htdocs/share/mk/doc.docbook.mk" diff --git a/doc/portability-book/files/chapters.ent b/doc/portability-book/files/chapters.ent deleted file mode 100644 index 579ea165245..00000000000 --- a/doc/portability-book/files/chapters.ent +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/doc/portability-book/files/devices.xml b/doc/portability-book/files/devices.xml deleted file mode 100644 index 2f3f98b0b42..00000000000 --- a/doc/portability-book/files/devices.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - -Device files - -This chapter lists the device files that are available on the -platforms and whether they are compatible to other platform's -devices. - - diff --git a/doc/portability-book/files/functions.xml b/doc/portability-book/files/functions.xml deleted file mode 100644 index 5fb9c5f3366..00000000000 --- a/doc/portability-book/files/functions.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - -C/C++: functions - -This chapter contains the requirements for using certain functions -in C and C++ code. - - -Feature test macros - -When writing code that conforms to a specific standard, some -programmers may want to check that really only features from that -standard are used. For that purpose there exist a number of so-called -feature test macros that can be defined on the command line to the -compiler or in C and C++ source files before including any of the -standard include files. - - -Documentation of the feature test macros - - -PlatformLocation - - -SunOS-*-*standards(5) -NetBSD-*-*/usr/include/sys/featuretest.h -Linux-*-*/usr/include/features.h - - -
- -
- - -Functions on various platforms - - -asprintf - -Solaris 10 does not have this function. But it has -snprintf, which can be used as a good replacement. - - - - -getopt - -Solaris provides the getopt function in three -of the standard headers: <stdio.h>, <stdlib.h> and -<unistd.h>, but the latter definition depends on other feature -test macros than the first two. Additionally, since Solaris 5.10, there -is also <getopt.h>, which provides -getopt_long, but not getopt. -The exact behavior also depends on the compiler. While SUNpro is quite -strict and requires the feature test macros, gcc finds the definition -without any of these macros. (TODO: Investigate further.) - - - - - Platform - Library - Headers - Feature test macros - - - - - NetBSD-*-* - c - unistd.h - _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE >= 4 || defined(_NETBSD_SOURCE) - - - SunOS-5.10-* - c - unistd.h - (_XOPEN_SOURCE && _XOPEN_VERSION == 4) || __EXTENSIONS__ - - - - - - - - -nanosleep - -On Solaris, the rt library is needed. - - - -
diff --git a/doc/portability-book/files/headers.xml b/doc/portability-book/files/headers.xml deleted file mode 100644 index a191558058b..00000000000 --- a/doc/portability-book/files/headers.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -C/C++: Header files - -This chapter provides information about which header files are -available on which platform. - - diff --git a/doc/portability-book/files/intro.xml b/doc/portability-book/files/intro.xml deleted file mode 100644 index 2b9c243ba8c..00000000000 --- a/doc/portability-book/files/intro.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - -Introduction - -Writing programs that are portable to a wide range of platforms -isn't easy. Maybe some platforms are lacking your favorite tool, while -others implemented it, but with arbitrary limitations. Some don't have -such useful functions like snprintf or -strlcpy. - -This book provides information about which features are -not on the platforms, since the features that -are available are already documented quite well. It -also explains how portable shell programs look like, since that's also a -topic that hasn't spread wide yet. - -Since pkgsrc uses the POSIX tools quite a lot, and the packages -using all other features, it's good to know on which platforms a certain -program will not work without further work. - - diff --git a/doc/portability-book/files/libraries.xml b/doc/portability-book/files/libraries.xml deleted file mode 100644 index ffffac29fbf..00000000000 --- a/doc/portability-book/files/libraries.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -C/C++: libraries - -This chapter provides information about which libraries are -available on which platform. - - diff --git a/doc/portability-book/files/portability.xml b/doc/portability-book/files/portability.xml deleted file mode 100644 index e180eb6c772..00000000000 --- a/doc/portability-book/files/portability.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - %man-refs.ent; - - %misc.ent; - - %chapters; - - -]> - - - - The pkgsrc portability book - - - - Roland - Illig - - -
rillig@NetBSD.org
-
-
- - The pkgsrc Developers - -
- - - 2006 - - The NetBSD Foundation, Inc. - - - 2006-10-01 - - - - pkgsrc is a package management system that has been ported - to various POSIX-like operating systems. These systems differ in - a lot of small details that are all nice to know when writing - code that will later run on as many of these platforms as - possible. This book collects some of the limitations, bugs and - other characteristics of the pkgsrc platforms. - - -
- - &chap.intro; - &chap.utilities; - &chap.headers; - &chap.functions; - &chap.libraries; - &chap.devices; -
diff --git a/doc/portability-book/files/utilities.xml b/doc/portability-book/files/utilities.xml deleted file mode 100644 index f63819651ad..00000000000 --- a/doc/portability-book/files/utilities.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - -Command line utilities - -This chapter collects the various bugs and peculiarities of the -POSIX-like -utilities on the platforms. - - -ls - -On MacOS X, ls does not return an error -code when the file to be listed does not exist. On some other platforms, -it does. - - - - -sh - - -Non-standard extensions - -The variable RANDOM is an addition of -ksh, and bash can do it as -well. - -The command [[ is an addition of -ksh, and bash can do it as -well. - - - - -NetBSD - -On NetBSD, have a look at the -various PRs to see what's wrong with the shell. - - - - -Solaris - -On Solaris, /bin/sh is missing some features -that POSIX requires -for the sh utility: - - - $ if ! false; then echo ok; fi - !: not found - - $ echo ${PWD%/} - bad substitution - - $ foo=$(true) - syntax error: `foo=$' unexpected - - -There is another sh implementation in -/usr/xpg4/bin, which implements these features. -However, many shell scripts and other programs have /bin/sh -hard-coded. - -Another incompatibility is this: - - - $ set -- foo bar baz; echo "before: $#"; set --; echo "after: $#" - before: 3 - after: 3 - - -All(?) other shells, including /usr/xpg4/bin/sh, -reply with after: 0. - -On Solaris, both /bin/sh and -/usr/xpg4/bin/sh cannot handle empty for loops. - - - $ for i in ; do echo "i=$i"; done - syntax error: `;' unexpected - - -The work-around is either to add some dummy arguments or to save -the list of things in a variable. Looping over empty lists is no -problem. But note that the various parameter expansions that are applied -here differ in this case. - - - $ things=""; for i in $things; do echo "i=$i"; done - - - -Globbing problems with quoting and hidden files - - - rm -rf "testdir" - mkdir "testdir" - touch "testdir/.file" - - x="." - y=".file" - echo "=== x and y quoted" - ls "$x"/*/"$y" - echo "=== only x quoted" - ls "$x"/*/$y - echo "=== nothing quoted" - ls $x/*/$y - - -The result of running this code with /bin/sh -is that in the first case, the result of the globbing expansion is -./*/.file, while in the two other -cases, it is the correct -./testdir/.file. This does only happen -when y starts with a dot, that is, for hidden files. - - - - - - -test - - -Supported options - -It is expected that the test utility fully -supports the POSIX standard. Any deviations from it are recorded in the -Unsupported column. - - -Supported options of the <emphasis>test</emphasis> utility - - -PlatformUnsupportedSupportedExtensions - - -AIX-4.3-powerpcbcdefghLnprstuwxzk -IRIX-6.5-mipsebbcdefghLnprstuwxzk -Linux-2.6.*-*bcdefgLnprSstuwxzGkO nt ot ef -NetBSD-3.0-*bcdefgLnprSstuwxzGkO nt ot ef -SunOS-5.10-* /bin/sheSbcdfghLnprstuwzk -SunOS-5.10-* /bin/testbcdefgLnprSstuwxzaGkOo nt ot ef - - -
- -Remarks: - - - -On Solaris-5.10-*, the behavior of the --f operator depends on the value of the environment -variable PATH. - -On Solaris-5.10-*, /usr/ucb/test -behaves like the builtin command in /bin/sh. On the -other hand, /usr/bin/test conforms to -POSIX. - - - -
- - -Non-standard extensions - -The Bourne Again Shell (bash) allows the binary operator -== to be used as an alias for =. -This leads to problems when programs using this feature are ported to -other platforms. By the way, not even the GNU coreutils have that -feature, it's really only Bash that does. After all, -there is no apparent benefit for having two names for the same -operator. - - - - -Bugs - -On NetBSD upto X.Y (see PR 34646), the &man.test.1; utility cannot -handle the following: - - - test ! = foo - - -POSIX requires -that when test is called with three arguments, the second operand is -checked first to see whether it is a binary operator. On NetBSD, the -unary ! operator takes precedence. - - -
-
-- cgit v1.2.3