diff -ur Original/generic-build-script New/generic-build-script --- Original/generic-build-script 2004-02-24 18:13:02.000000000 -0600 +++ New/generic-build-script 2004-02-24 18:24:40.000000000 -0600 @@ -37,6 +37,27 @@ export BASEPKG=${PKG}-${VER} export FULLPKG=${BASEPKG}-${REL} +# Package maintainers: +# +# Note(s): +# (1) Adjust the following export constants to meet your page requirements, +# (2) Maintainers can use the routine 'hintfiledata' below to extract the following fields from the package's setup.hint +# file (if it exists) - hence these defaults: +# (a) setup.hint file's 'ldesc: "' == > 'SHORTDESC' (over multiple lines until closing " character found) +# (b) setup.hint file's 'prev: x-y' == > 'OLDERREL' (y part) +# (c) setup.hint file's 'prev: x-y' == > 'OLDERVER' (x part) + +export SHORTDESC="" +export OTHERRUNTIME=" " +export OTHERBUILD=" " +export OTHERPORT="" +export OLDERVER="${VER}" # Set the default to the "current" package's version number +export OLDERREL="${REL}" # Set the default to the "current" package's release number +export MAINTNAME="" +export MAINTEMAIL="" +# +# Package maintainers: + # determine correct decompression option and tarball filename export src_orig_pkg_name= if [ -e "${src_orig_pkg_name}" ] ; then @@ -83,6 +104,8 @@ MY_LDFLAGS= fi +export PkgReadMe="${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README" + export install_docs="\ ABOUT-NLS \ ANNOUNCE \ @@ -178,12 +201,12 @@ fi ;\ done &&\ if [ -d ${instdir}${prefix}/share/info ] ; then \ - find ${instdir}${prefix}/share/info -name "*.info" | xargs gzip -q ; \ + find ${instdir}${prefix}/share/info -name "*.info" | xargs -r gzip -q ; \ fi && \ if [ -d ${instdir}${prefix}/share/man ] ; then \ find ${instdir}${prefix}/share/man -name "*.1" -o -name "*.3" -o \ -name "*.3x" -o -name "*.3pm" -o -name "*.5" -o -name "*.6" -o \ - -name "*.7" -o -name "*.8" | xargs gzip -q ; \ + -name "*.7" -o -name "*.8" | xargs -r gzip -q ; \ fi && \ templist="" && \ for f in ${install_docs} ; do \ @@ -197,10 +220,10 @@ fi && \ if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then \ /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/${PKG}.README \ - ${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \ + "${PkgReadMe}" ; \ elif [ -f ${srcdir}/CYGWIN-PATCHES/README ] ; then \ /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \ - ${instdir}${prefix}/share/doc/Cygwin/${BASEPKG}.README ; \ + "${PkgReadMe}" ; \ fi && \ if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.sh ] ; then \ if [ ! -d ${instdir}${sysconfdir}/postinstall ]; then \ @@ -218,7 +241,7 @@ } strip() { (cd ${instdir} && \ - find . -name "*.dll" -or -name "*.exe" | xargs strip 2>&1 ; \ + find . -name "*.dll" -or -name "*.exe" | xargs -r strip 2>&1 ; \ true ) } list() { @@ -228,18 +251,150 @@ } depend() { (cd ${instdir} && \ - find ${instdir} -name "*.exe" -o -name "*.dll" | xargs cygcheck | \ - sed -e '/\.exe/d' -e 's,\\,/,g' | sort -bu | xargs -n1 cygpath -u \ - | xargs cygcheck -f | sed 's%^% %' ; \ + find ${instdir} -name "*.exe" -o -name "*.dll" | xargs -r cygcheck | \ + sed -e '/\.exe/d' -e 's,\\,/,g' | sort -bu | xargs -r -n1 cygpath -u \ + | xargs -r cygcheck -f | sed 's%^% %' ; \ true ) } +hintfiledata() { + HintFile="${srcdir}/CYGWIN-PATCHES/setup.hint" + if [ -f "${HintFile}" ] ; then + + # Reset export variables + export OLDERVER="${VER}" # Set the default to the "current" package's version number + export OLDERREL="${REL}" # Set the default to the "current" package's release number + export SHORTDESC="" + + # Open the 'setup.hint' file for reading on stdin, preserving all white-space. Start reading the file, and detect the + # 'ldesc: "' line (to set the SHORTDESC), and the 'prev: ' line to set the OLDERVER, and OLDERREL values. + exec 3<&0 < "${HintFile}" + while read LINE; do + case "${LINE}" in + 'ldesc: "'* ) + # Found the start of the LDESC line - use a sub-shell to extract the text from the right-side of the + # " character (the sub-shell allows for the resetting of the IFS field to the " character for splitting + # the string). + export SHORTDESC="$(IFS='"'; set -- ${LINE}; shift; echo $@ )" + + # Now continue to read the 'setup.hint' file, line-by-line until the routine detects the closing " + # character, closing off the ldesc value. For each line read, append the string to the short desc, and for the + # closing line, only append the text to the left of the closinf " character. + while read LINE; do + case "${LINE}" in + *'"'* ) + export SHORTDESC="${SHORTDESC}\n$(IFS='"'; set -- ${LINE}; echo $1 )\n" + break; + ;; + * ) + export SHORTDESC="${SHORTDESC}\n${LINE}" + ;; + esac + done + ;; + 'prev: '* ) + # Found the previous line (of the form: 'prev: x-y' + # First extract the x-y portion of line, using a similar sub-shell splitting mechansim used above + # Then extract the individal x ('OLDERVER'), and y ('OLDERREL') values, again using sub-shell splitting, + # only using the - character as the field seperator. + PrevLineVal="$(set -- ${LINE}; echo $2 )" + export OLDERVER="$(IFS="-"; set -- ${PrevLineVal}; echo $1 )" + export OLDERREL="$(IFS="-"; set -- ${PrevLineVal}; shift; echo $@ )" + ;; + esac + done + # Close the reading of the 'setup.hint' file, and complete the routine ... + exec 0<&3 3<&- + fi +} +readmelist() { + if [ -s "${PkgReadMe}" ] ; then + # Extract the setup.hint file data for the 'OLDERVER', 'OLDERREL', and 'SHORTDESC' values ... + hintfiledata + + # Create a temporary (unique) README file(s) to replace the templated text + # Currently only one file is needed, but exented functionality may require several passes + # prior to witing the final README. + + TmpRdMe1="$(mktemp /tmp/${BASEPKG}.README.1.XXXXXXXXXX )" || exit 1 # Use for the main bulk of the transformation + TmpRdMe2="$(mktemp /tmp/${BASEPKG}.README.2.XXXXXXXXXX )" || exit 1 # Use for the run-time requirements transformation + + # Transformation order: + # (a) README --> 'TmpRdMe1' + # (b) 'TmpRdMe1' --> 'TmpRdMe2' + # (c) 'TmpRdMe2' --> README (final version which gets packaged in the binary version) + + # + # The following find and sed commands do the following: + # + # 1/ Find and sort all the files and directories in '${instdir}', replacing the first two characters + # ('./') characters of each line with the string ' /', writing the new-line to stdout. For example, + # + # Original Line: './abc/def.ghi' + # Modified Line: ' /abc/def.ghi' + # + # 2/ Use the src package README file as the input file to sed, piping the stdout output to + # a temporary file '${TmpRdMe1}'. Moreover, the sed command reads the data piped from step 1/, above, in from its + # stdin. Additioanlly, the sed command does the following: + # (a) It replaces , , , etc. in the temporary README with the values + # obtained from this script. This mechanism saves maintainers from having to manually update the + # README with this file list. + # (b) It locates the line containing the text ''. Once located, the sed command executes the + # /usr/bin/cat command reading the data from stdin, and writing this to stdout, thus putting the + # the file list, obtained from step 1/, into the temporary README '${TmpRdMe1}' at the line where the string '' + # exists. + # (c) Finally it removes the placeholder '' after use, since this script no longer requires it. + # + # The following 'depend' and sed commands do the following: + # + # 3/ Executes the 'depend' function on the files in '${nstdir}', and sorts the results, and writing these results to stdout. + # + # 4/ Use the temporary README file '${TmpRdMe1}' as the input file to sed, piping the stdout output to + # a temporary file '${TmpRdMe2}'. Moreover, the sed command reads the data piped from step 3/, above, in from its + # stdin. Additioanlly, the sed command does the following: + # (a) It locates the line containing the text '...other Runtime req...'. Once located, the sed command executes the + # /usr/bin/cat command reading the data from stdin, and writing this to stdout, thus putting the + # the depends list, obtained from step 3/, into the temporary README '${TmpRdMe2}' at this line. + # exists. + # (c) Finally it removes this line placeholder after use, since this script no longer requires it. + # + # 4/ Rename the temporary README file '${TmpRdMe2}' to the correct binary release version of the README in the '${instdir}', + # and removes any intermediate temporary README files. + # + (cd ${instdir} && \ + find . -name "*" | sed 's%\./\(.*\)% /\1%' | sort -f | uniq | \ + sed -e "s%%${PKG}%g" \ + -e "s%%${VER}%g" \ + -e "s%%${REL}%g" \ + -e "s%%${PKG}%g" \ + -e "s%%${SHORTDESC}%g" \ + -e "s% %${OTHERBUILD}%g" \ + -e "s%%${OTHERPORT}%g" \ + -e "s%%${OLDERVER}%g" \ + -e "s%%${OLDERREL}%g" \ + -e "s%%${MAINTNAME}%g" \ + -e "s%%${MAINTEMAIL}%g" \ + -e '\%% e /usr/bin/cat -' \ + -e '\%% d' \ + "${PkgReadMe}" > \ + "${TmpRdMe1}" && \ + depend | sort -f | uniq | \ + sed -e '\% % e /usr/bin/cat -' \ + -e '\% % d' \ + "${TmpRdMe1}" > \ + "${TmpRdMe2}" && \ + rm -f "${TmpRdMe1}" && \ + mv -f "${TmpRdMe2}" \ + "${PkgReadMe}" && \ + true ) + fi +} pkg() { (cd ${instdir} && \ tar cvjf ${bin_pkg} * ) } mkpatch() { (cd ${srcdir} && \ - find . -name "autom4te.cache" | xargs rm -rf ; \ + find . -name "autom4te.cache" | xargs -r rm -rf ; \ unpack ${src_orig_pkg} && \ mv ${BASEPKG} ../${BASEPKG}-orig && \ cd ${topdir} && \ @@ -316,6 +471,7 @@ clean) clean ; STATUS=$? ;; install) install ; STATUS=$? ;; list) list ; STATUS=$? ;; + readmelist) readmelist ; STATUS=$? ;; depend) depend ; STATUS=$? ;; strip) strip ; STATUS=$? ;; package) pkg ; STATUS=$? ;; @@ -327,7 +483,7 @@ checksig) checksig ; STATUS=$? ;; first) mkdirs && spkg && finish ; STATUS=$? ;; all) checksig && prep && conf && build && install && \ - strip && pkg && spkg && finish ; \ + strip && readmelist && pkg && spkg && finish ; \ STATUS=$? ;; *) echo "Error: bad arguments" ; exit 1 ;; esac diff -ur Original/generic-readme New/generic-readme --- Original/generic-readme 2004-02-20 11:42:08.000000000 -0600 +++ New/generic-readme 2004-02-23 15:49:08.000000000 -0600 @@ -4,13 +4,13 @@ Runtime requirements: cygwin-1.5.7 or newer - + Build requirements: cygwin-1.5.7 or newer gcc-3.3.1-3 or newer binutils-20030901-1 or newer - + Canonical homepage: http://... @@ -37,24 +37,18 @@ Files included in the binary distribution: - /usr/bin/... - /usr/share/doc/Cygwin/-.README (this file) - /usr/share/doc/-/README - /usr/share/doc/-/... - /usr/share/man/man1/... - /usr/share/info/... - /etc/postinstall/.sh + ------------------ Port Notes: ---------- -- ----------- -Other information + ... ----------- --1 ----------- +---------- -- ----------- Initial release Cygwin port maintained by: