Index: ossp-pkg/shtool/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/shtool/ChangeLog,v rcsdiff -q -kk '-r1.126' '-r1.127' -u '/v/ossp/cvs/ossp-pkg/shtool/ChangeLog,v' 2>/dev/null --- ChangeLog 2000/06/18 11:30:56 1.126 +++ ChangeLog 2000/06/30 16:27:41 1.127 @@ -9,7 +9,10 @@ ChangeLog - Changes between 1.4.9 and 1.4.10 (16-Apr-2000 to 18-Jun-2000): + Changes between 1.4.9 and 1.5.0 (16-Apr-2000 to 30-Jun-2000): + + *) Completely rewrote `shtool version': + [Ralf S. Engelschall] *) Don't print `failed: 0/17' after a successful `make test' because it confused people too often. Index: ossp-pkg/shtool/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/shtool/Makefile.in,v co -q -kk -p'1.39' '/v/ossp/cvs/ossp-pkg/shtool/Makefile.in,v' | diff -u /dev/null - -L'ossp-pkg/shtool/Makefile.in' 2>/dev/null --- ossp-pkg/shtool/Makefile.in +++ - 2024-05-15 02:24:01.637176560 +0200 @@ -0,0 +1,176 @@ +## +## Makefile for GNU shtool +## Copyright (c) 1999-2000 Ralf S. Engelschall +## +## This file is part of shtool and free software; you can redistribute +## it and/or modify it under the terms of the GNU General Public +## License as published by the Free Software Foundation; either version +## 2 of the License, or (at your option) any later version. +## +## This file is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +## USA, or contact Ralf S. Engelschall . +## + +@SET_MAKE@ + +TOP = . +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ +datadir = @datadir@ +aclocaldir = $(datadir)/aclocal +pkgdatadir = $(datadir)/shtool + +SHELL = /bin/sh +PERL = @PERL@ +POD2MAN = @POD2MAN@ +RM = rm -f +RMDIR = rmdir +TRUE = true +CP = cp +LS = ls + +USER_NAME = gnu +GROUP_NAME = shtool + +SCRIPTS = \ + sh.echo \ + sh.mdate \ + sh.table \ + sh.prop \ + sh.move \ + sh.install \ + sh.mkdir \ + sh.mkln \ + sh.mkshadow \ + sh.fixperm \ + sh.tarball \ + sh.guessos \ + sh.arx \ + sh.slo \ + sh.scpp \ + sh.version \ + sh.path + +all: shtool shtool.1 shtoolize.1 + +shtool: $(SCRIPTS) sh.common shtoolize + @$(SHELL) sh.echo -e "%BBuilding shtool program:%b" + ./shtoolize -o shtool all + +shtool.1: shtool.pod + @$(SHELL) sh.echo -e "%BBuilding shtool.1 manual page:%b" + V1=`$(SHELL) sh.version -l txt -d short VERSION`; \ + V2=`$(SHELL) sh.version -l txt -d long VERSION`; \ + D=`$(SHELL) sh.version -l txt -d long VERSION | sed -e 's;.*(;;' -e 's;).*;;'`; \ + $(POD2MAN) --section=1 --center="GNU Portable Shell Tool" \ + --release="$$D" --date="shtool $$V1" shtool.pod |\ + sed -e "s;SHTOOL_VERSION_STR;$$V2;" >shtool.1 + +shtoolize.1: shtoolize.pod + @$(SHELL) sh.echo -e "%BBuilding shtoolize.1 manual page:%b" + V1=`$(SHELL) sh.version -l txt -d short VERSION`; \ + V2=`$(SHELL) sh.version -l txt -d long VERSION`; \ + D=`$(SHELL) sh.version -l txt -d long VERSION | sed -e 's;.*(;;' -e 's;).*;;'`; \ + $(POD2MAN) --section=1 --center="GNU Portable Shell Tool" \ + --release="$$D" --date="shtool $$V1" shtoolize.pod |\ + sed -e "s;SHTOOL_VERSION_STR;$$V2;" >shtoolize.1 + +check: test +test: all + @$(SHELL) sh.echo -e "%BRunning test suite:%b" + @$(SHELL) test.sh + +install: all + ./shtool mkdir -f -p -m 755 $(prefix) + ./shtool mkdir -f -p -m 755 $(bindir) + ./shtool mkdir -f -p -m 755 $(mandir)/man1 + ./shtool mkdir -f -p -m 755 $(aclocaldir) + ./shtool mkdir -f -p -m 755 $(pkgdatadir) + ./shtool install -c -m 755 shtool $(bindir)/shtool + ./shtool install -c -m 755 shtoolize $(bindir)/shtoolize + ./shtool install -c -m 644 shtool.1 $(mandir)/man1/shtool.1 + ./shtool install -c -m 644 shtoolize.1 $(mandir)/man1/shtoolize.1 + ./shtool install -c -m 644 shtool.m4 $(aclocaldir)/shtool.m4 + @for script in sh.common $(SCRIPTS); do \ + echo "./shtool install -c -m 644 $$script $(pkgdatadir)/$$script"; \ + ./shtool install -c -m 644 $$script $(pkgdatadir)/$$script; \ + done + +uninstall: + @for script in sh.common $(SCRIPTS); do \ + echo "$(RM) $(pkgdatadir)/$$script"; \ + $(RM) $(pkgdatadir)/$$script; \ + done + $(RM) $(aclocaldir)/shtool.m4 + $(RM) $(mandir)/man1/shtoolize.1 + $(RM) $(mandir)/man1/shtool.1 + $(RM) $(bindir)/shtoolize + $(RM) $(bindir)/shtool + $(RMDIR) $(aclocaldir) >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(pkgdatadir) >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(datadir) >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(mandir)/man1 >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(mandir) >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(bindir) >/dev/null 2>&1 || $(TRUE) + $(RMDIR) $(prefix) >/dev/null 2>&1 || $(TRUE) + +clean: + $(RM) shtool shtool.1 shtoolize.1 + +distclean: clean + $(RM) Makefile shtoolize + $(RM) config.cache config.status config.log + +# (not intended to be run by end users) +dist: distclean + $(SHELL) sh.fixperm -v *; \ + V=`$(SHELL) sh.version -l txt -d short VERSION`; \ + $(SHELL) sh.tarball -o shtool-$${V}.tar.gz -d shtool-$${V} \ + -u $(USER_NAME) -g $(GROUP_NAME) \ + -e 'CVS,\.cvsignore,\.[ao]$$,^\.' \ + -c 'gzip --best' .; \ + $(LS) -l shtool-$$V.tar.gz + +# (not intended to be run by end users) +snap: distclean + @$(SHELL) sh.fixperm -v *; \ + V=`$(SHELL) sh.version -l txt -d short VERSION`; \ + $(SHELL) sh.tarball -o shtool-$${V}-SNAP.tar.gz -d shtool-$${V}-SNAP \ + -u $(USER_NAME) -g $(GROUP_NAME) \ + -e 'CVS,\.cvsignore,\.[ao]$$,^\.' \ + -c 'gzip --best' .; \ + $(LS) -l shtool-$$V-SNAP.tar.gz + +# (not intended to be run by end users) +new-version: + @echo "Setting new version information:"; \ + V="$(VERSION)"; \ + if [ ".$$V" != . ]; then \ + OPT="-s$$V"; \ + else \ + OPT="-e"; \ + fi; \ + $(SHELL) ./sh.version -l txt -n "GNU shtool" -p shtool $$OPT VERSION; \ + V=`$(SHELL) ./sh.version -l txt -d long VERSION`; \ + sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README; \ + V=`$(SHELL) ./sh.version -l txt -d short VERSION`; \ + sed -e "s/%define ver .*/%define ver $$V/g" shtool.spec.n && mv shtool.spec.n shtool.spec + +update-version: + @echo "Updating date in version information"; \ + V=`$(SHELL) ./sh.version -l txt -d short VERSION`;\ + $(SHELL) ./sh.version -l txt -n "GNU shtool" -p shtool -s $$V VERSION;\ + V=`$(SHELL) ./sh.version -l txt -d long VERSION`;\ + sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README;\ + V=`$(SHELL) ./sh.version -l txt -d short VERSION`;\ + sed -e "s/%define ver .*/%define ver $$V/g" shtool.spec.n && mv shtool.spec.n shtool.spec + Index: ossp-pkg/shtool/README RCS File: /v/ossp/cvs/ossp-pkg/shtool/README,v rcsdiff -q -kk '-r1.65' '-r1.66' -u '/v/ossp/cvs/ossp-pkg/shtool/README,v' 2>/dev/null --- README 2000/06/18 10:48:38 1.65 +++ README 2000/06/30 16:27:41 1.66 @@ -10,7 +10,7 @@ http://www.gnu.org/software/shtool/ ftp://ftp.gnu.org/gnu/shtool/ - Version 1.4.10 (18-Jun-2000) + Version 1.5.0 (30-Jun-2000) The GNU shtool program is a compilation of small but very stable and portable shell scripts into a single shell tool. All ingredients Index: ossp-pkg/shtool/VERSION RCS File: /v/ossp/cvs/ossp-pkg/shtool/VERSION,v rcsdiff -q -kk '-r1.50' '-r1.51' -u '/v/ossp/cvs/ossp-pkg/shtool/VERSION,v' 2>/dev/null --- VERSION 2000/06/18 10:48:38 1.50 +++ VERSION 2000/06/30 16:27:41 1.51 @@ -1,3 +1,6 @@ - This is GNU shtool, Version 1.4.10 (18-Jun-2000) + VERSION -- Version Information for GNU shtool (syntax: Text) + [automatically generated and maintained by GNU shtool] + + This is GNU shtool, Version 1.5.0 (30-Jun-2000) Index: ossp-pkg/shtool/sh.version RCS File: /v/ossp/cvs/ossp-pkg/shtool/sh.version,v rcsdiff -q -kk '-r1.21' '-r1.22' -u '/v/ossp/cvs/ossp-pkg/shtool/sh.version,v' 2>/dev/null --- sh.version 2000/06/14 19:01:26 1.21 +++ sh.version 2000/06/30 16:27:41 1.22 @@ -1,5 +1,5 @@ ## -## version -- Generate and maintain a version information file +## version -- Maintain a version information file ## Copyright (c) 1994-2000 Ralf S. Engelschall ## Originally written for ePerl ## @@ -20,150 +20,118 @@ ## str_tool="version" -str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " -arg_spec="1+" -opt_spec="l:n:p:s:i:d:" +str_usage="[-l] [-n] [-p] [-s] [-e] [-i] [-d] " +arg_spec="1=" +opt_spec="l:n:p:s:i:e.d:" opt_l="txt" -opt_n="unknown" -opt_p="unknown" -opt_s="unknown" -opt_i="P" -opt_d="NO" -gen_tmpfile=yes +opt_n="" +opt_p="" +opt_s="" +opt_e="no" +opt_i="" +opt_d="short" . ./sh.common -LANGUAGE="$opt_l" -NAME="$opt_n" -PREFIX="$opt_p" -FULLVERSION="$opt_s" -INCREASE="$opt_i" -REPORT="$opt_d" -FILE="$1" - -# determine language -if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - *.py) LANGUAGE=python ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac -fi +file="$1" # determine prefix from name and vice versa -if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" - fi +name="$opt_n" +prefix="$opt_p" +if [ ".$prefix" = . -a ".$name" != . ]; then + prefix="$name" fi -if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi +if [ ".$name" = . -a ".$prefix" != . ]; then + name="$prefix" fi -# determine version -date=unknown -version=0 -revision=0 -bplevel=0 -if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc +# determine current version +triple="$opt_s" +if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + exit 1 fi + V=`echo $triple |\ + sed -e 's;\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*;\1:\2:\3:\4;'` + ver=`echo $V | awk -F: '{ print $1 }'` + rev=`echo $V | awk -F: '{ print $2 }'` + typ=`echo $V | awk -F: '{ print $3 }'` + lev=`echo $V | awk -F: '{ print $4 }'` + tim=calc +elif [ -r $file ]; then + # determine triple from given file + V=`grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + head -1 | sed -e 's;.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*;\1:\2:\3:\4:\5;'` + ver=`echo $V | awk -F: '{ print $1 }'` + rev=`echo $V | awk -F: '{ print $2 }'` + typ=`echo $V | awk -F: '{ print $3 }'` + lev=`echo $V | awk -F: '{ print $4 }'` + tim=`echo $V | awk -F: '{ print $5 }'` else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi -# determine hex value of version -case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; -esac +# determine new version in batch +if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + exit 1 + ;; + esac + tim=calc +fi -# determine libtool version -case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; -esac +# determine new version interactively +if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid version entered: \`$triple'" 1>&2 + continue + fi + break + done + V=`echo $triple |\ + sed -e 's;\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*;\1:\2:\3:\4;'` + ver=`echo $V | awk -F: '{ print $1 }'` + rev=`echo $V | awk -F: '{ print $2 }'` + typ=`echo $V | awk -F: '{ print $3 }'` + lev=`echo $V | awk -F: '{ print $4 }'` + tim=calc +fi -# determine string out of filename -# (don't try to optimize this in any way - portability!) -FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` +# determine hexadecimal and libtool value of version +case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=9; levnum=99 ;; # snapshots are special +esac +hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%d%02d%1d%02d", $1, $2, $3, $4); }'` +ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $2); }'` # determine date -if [ ".$date" = .calc ]; then +if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -188,129 +156,141 @@ 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi -if [ .$REPORT != .NO ]; then - case $REPORT in +# perform result actions +mode=show +if [ ".$opt_i" != . ]; then + mode=edit +elif [ ".$opt_e" = .yes ]; then + mode=edit +elif [ ".$opt_s" != . ]; then + mode=edit +fi +if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in long ) - echo "$version.$revision$bptype$bplevel ($date)" + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 -fi - -# create the version file according the the selected language -echo "new version: $version.$revision$bptype$bplevel ($date)" -case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) - -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by GNU shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id$"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif - -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by GNU shtool] -## - -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id$/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - python ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by GNU shtool] -## - -@PREFIX@_Version = 0x@HEX@ -@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" -@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_RCSIdentID = "$Id$" -@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" -@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" +else + # update the version file -EOT - ;; -esac - -# now create the version file -rm -f $FILE >/dev/null 2>&1 -sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE -rm -f $tmpfile >/dev/null 2>&1 -exit 0 + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id${name} ${triple} ${tim} \$" + + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefix}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif _${filestr}_" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + perl ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "my ${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + exit 1 + ;; + esac +fi Index: ossp-pkg/shtool/shtool.pod RCS File: /v/ossp/cvs/ossp-pkg/shtool/shtool.pod,v rcsdiff -q -kk '-r1.42' '-r1.43' -u '/v/ossp/cvs/ossp-pkg/shtool/shtool.pod,v' 2>/dev/null --- shtool.pod 2000/06/18 10:48:38 1.42 +++ shtool.pod 2000/06/30 16:27:41 1.43 @@ -266,7 +266,7 @@ =item B -Generate and maintain a version information file in either text, C or Perl +Maintain a version information file in either text, C/C++, Perl or Python format. =item B @@ -698,31 +698,34 @@ return 0; } -=item B [B<-l> I] [B<-n> I] [B<-p> I] [B<-s> I] [B<-i> I] [B<-d> I] I +=item B [B<-l> I] [B<-n> I] [B<-p> I] [B<-s> I] [B<-e>] [B<-i> I] [B<-d> I] I -This command generates and maintains a version information file I -for program name I in either textual (I="C"), ANSI -C (I="c", Perl (I="perl") or Python (I="python") -language. The version is always described with a triple -EI,I,IE and is +This command generates and maintains a version information file I for +program name I in either textual (I="C"), ANSI C +(I="c") or Perl (I="perl") language. The version is always +described with a triple EI,I,IE and is represented by a string which always matches the regular expression -``C<[0-9]+\.[0-9]+[.abps][0-9]+>''. When the option ``B<-s>'' is given, -the contents of I is overridden with the specified I. +``C<[0-9]+\.[0-9]+[sabp.][0-9]+>''. When the option ``B<-s>'' is given, the +contents of I is overridden with the specified I. -When option ``B<-i>'' is used the version ingredients in I are updated -by adjusting one I of the version where I can be one of the -following: ``C'', ``C'', ``C

'', ``C

'' and ``C'' just increase -the alpha/beta/patch/snap level by 1 (and set the separator character between -version and the level position). ``C'' increases the revision by 1 and sets -the alpha/beta/patch/snap level to 0. ``C'' increases the version by 1 and -sets both the revision and alpha/beta/patch/snap level to 0. - -When option ``B<-d>'' is given the current version in I is displayed -either in short (I="short") or long (I="long") texual format or in -a format suitable for use with GNU libtool (I="libtool") or in a -hexadecimal format (I="hex"). - -When no option is given at all, ``C<-i P>'' is assumed. +When option ``B<-i>'' is used, the current version in I is updated +by increasing one element of the version where I can be one of +the following: ``C'' for increasing the version by 1 (and resetting +revision and level to 0), ``C'' for increasing the revision by 1 (and +resetting level to 0) or ``C'' for increasing the level by 1. Option +``B<-e>'' can be used to interactively enter a new version. + +Unless option ``B<-e>'', ``B<-i>'' or ``B<-s>'' is specified, the performed +action is to display the current version. Option ``B<-d>'' then can be used +to control the display type: "C" for a short version display, "C" +for a longer version display, "C" for a hexadecial display of the version +and "C" for a format suitable for use with GNU libtool. + +The hexadecimal format for a version C is C where C +and C directly correspond to C and C, C encodes the level +type as C<9>, C<2>, C<1>, C<0> (representing C, C

/C<.>, C, C +in this order) and C is either directly corresponding to C or set +to C<99> if level type is C. Example: Index: ossp-pkg/shtool/shtool.spec RCS File: /v/ossp/cvs/ossp-pkg/shtool/shtool.spec,v co -q -kk -p'1.4' '/v/ossp/cvs/ossp-pkg/shtool/shtool.spec,v' | diff -u /dev/null - -L'ossp-pkg/shtool/shtool.spec' 2>/dev/null --- ossp-pkg/shtool/shtool.spec +++ - 2024-05-15 02:24:01.659754996 +0200 @@ -0,0 +1,77 @@ +## +## shtool.spec -- RPM specification for shtool package +## Copyright (c) 2000 Ralf S. Engelschall +## +## This file is part of shtool and free software; you can redistribute +## it and/or modify it under the terms of the GNU General Public +## License as published by the Free Software Foundation; either version +## 2 of the License, or (at your option) any later version. +## +## This file is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +## USA, or contact Ralf S. Engelschall . +## + +# This is a specification file for the RedHat Package Manager (RPM). +# It is part of the Shtool source tree and this way directly included +# in Shtool distribution tarballs. This way one can use a simple `rpm +# -tb shtool-1.X.Y.tar.gz' command to build binary RPM packages from a +# Shtool distribution tarball. + +%define prefix /usr +%define ver 1.5.0 +%define rel 1 + +Name: shtool +Version: %{ver} +Release: %{rel} +Group: Development/Tools +Copyright: GPL +URL: http://www.gnu.org/software/shtool/ +Summary: GNU shtool - The GNU Portable Shell Tool + +Source: ftp://ftp.gnu.org/gnu/shtool/shtool-%{ver}.tar.gz +BuildArch: noarch +BuildRoot: /tmp/shtool-%{ver}-root + +%description +GNU shtool is a compilation of small but very stable and portable shell +scripts into a single shell tool. All ingredients were in successful use +over many years in various free software projects. The compiled shtool +program is intended to be used inside the source tree of other free +software packages. There it can overtake various (usually non-portable) +tasks related to the building and installation of such a package. It +especially can replace the old mkdir.sh, install.sh and related scripts. + +%prep + +%setup + +%build +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} +make +make test + +%install +rm -rf $RPM_BUILD_ROOT +make install prefix=$RPM_BUILD_ROOT%{prefix} + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc AUTHORS COPYING ChangeLog INSTALL README THANKS +%{prefix}/bin/shtool +%{prefix}/bin/shtoolize +%{prefix}/man/man1/shtool.1 +%{prefix}/man/man1/shtoolize.1 +%{prefix}/share/aclocal/shtool.m4 +%{prefix}/share/shtool/ +