Tue, 06 Jan 2009 23:45:10 +0100
Include well tested and long contributed C++ version logic as a patch.
shtool/shtool.patch | file | annotate | diff | comparison | revisions | |
shtool/shtool.spec | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/shtool/shtool.patch Tue Jan 06 23:45:10 2009 +0100 1.3 @@ -0,0 +1,132 @@ 1.4 +diff -Nau ChangeLog.orig ChangeLog 1.5 +--- ChangeLog.orig 2008-07-18 09:57:29.000000000 +0200 1.6 ++++ ChangeLog 2009-01-06 01:29:18.000000000 +0100 1.7 +@@ -114,6 +114,9 @@ 1.8 + 1.9 + Changes between 2.0.1 and 2.0.2 (11-Aug-2004 to 15-Jun-2005): 1.10 + 1.11 ++ *) Added ISO C++ language output to "shtool version". 1.12 ++ [Michael Schloh von Bennewitz <michael@schloh.com>] 1.13 ++ 1.14 + *) Fix insecure temporary file handling (CAN-2005-1751, CAN-2005-1759). 1.15 + [Eric Romang <eromang@zataz.net>, Ralf S. Engelschall] 1.16 + 1.17 +diff -Nau RATIONAL.orig RATIONAL 1.18 +--- RATIONAL.orig 2008-04-02 22:10:17.000000000 +0200 1.19 ++++ RATIONAL 2009-01-06 01:30:19.000000000 +0100 1.20 +@@ -6,8 +6,8 @@ 1.21 + 1.22 + GNU shtool -- The GNU Portable Shell Tool 1.23 + 1.24 +- RATIONAL 1.25 +- ======== 1.26 ++ RATIONALE 1.27 ++ ========= 1.28 + 1.29 + The Context 1.30 + 1.31 +diff -Nau sh.version.orig sh.version 1.32 +--- sh.version.orig 2008-04-02 22:10:17.000000000 +0200 1.33 ++++ sh.version 2009-01-06 01:32:32.000000000 +0100 1.34 +@@ -211,7 +211,7 @@ 1.35 + ;; 1.36 + c ) 1.37 + echo >>$file "/*" 1.38 +- echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" 1.39 ++ echo >>$file "** ${file} -- Version Information for ${name} (syntax: C)" 1.40 + echo >>$file "** [automatically generated and maintained by GNU shtool]" 1.41 + echo >>$file "*/" 1.42 + echo >>$file "" 1.43 +@@ -257,6 +257,65 @@ 1.44 + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" 1.45 + echo >>$file "" 1.46 + ;; 1.47 ++ cxx ) 1.48 ++ echo >>$file "//" 1.49 ++ echo >>$file "// ${file} -- Version Information for ${name} (syntax: ISO C++)" 1.50 ++ echo >>$file "// [automatically generated and maintained by GNU shtool]" 1.51 ++ echo >>$file "//" 1.52 ++ echo >>$file "" 1.53 ++ echo >>$file "#ifdef _${filestr}_AS_HEADER_" 1.54 ++ echo >>$file "" 1.55 ++ echo >>$file "#ifndef _${filestr}_" 1.56 ++ echo >>$file "#define _${filestr}_" 1.57 ++ echo >>$file "" 1.58 ++ echo >>$file "#define ${prefixupper}VERSION ${vHex}" 1.59 ++ echo >>$file "" 1.60 ++ echo >>$file "typedef class ${prefix}version_class {" 1.61 ++ echo >>$file "private:" 1.62 ++ echo >>$file " const int v_hex;" 1.63 ++ echo >>$file " const char *v_short;" 1.64 ++ echo >>$file " const char *v_long;" 1.65 ++ echo >>$file " const char *v_tex;" 1.66 ++ echo >>$file " const char *v_gnu;" 1.67 ++ echo >>$file " const char *v_web;" 1.68 ++ echo >>$file " const char *v_sccs;" 1.69 ++ echo >>$file " const char *v_rcs;" 1.70 ++ echo >>$file "public:" 1.71 ++ echo >>$file " ${prefix}version_class(void) : \\" 1.72 ++ echo >>$file " v_hex(${vHex}), \\" 1.73 ++ echo >>$file " v_short(\"${vShort}\"), \\" 1.74 ++ echo >>$file " v_long(\"${vLong}\"), \\" 1.75 ++ echo >>$file " v_tex(\"${vTeX}\"), \\" 1.76 ++ echo >>$file " v_gnu(\"${vGNU}\"), \\" 1.77 ++ echo >>$file " v_web(\"${vWeb}\"), \\" 1.78 ++ echo >>$file " v_sccs(\"${vSCCS}\"), \\" 1.79 ++ echo >>$file " v_rcs(\"${vRCS}\") \\" 1.80 ++ echo >>$file " {}" 1.81 ++ echo >>$file " const int getHex(void) {return (v_hex);};" 1.82 ++ echo >>$file " const char *getShort(void) {return (v_short);};" 1.83 ++ echo >>$file " const char *getLong(void) {return (v_long);};" 1.84 ++ echo >>$file " const char *getTex(void) {return (v_tex);};" 1.85 ++ echo >>$file " const char *getGnu(void) {return (v_gnu);};" 1.86 ++ echo >>$file " const char *getWeb(void) {return (v_web);};" 1.87 ++ echo >>$file " const char *getSccs(void) {return (v_sccs);};" 1.88 ++ echo >>$file " const char *getRcs(void) {return (v_rcs);};" 1.89 ++ echo >>$file "} ${prefix}version_t;" 1.90 ++ echo >>$file "" 1.91 ++ echo >>$file "extern ${prefix}version_t ${prefix}version;" 1.92 ++ echo >>$file "" 1.93 ++ echo >>$file "#endif // _${filestr}_" 1.94 ++ echo >>$file "" 1.95 ++ echo >>$file "#else // _${filestr}_AS_HEADER_" 1.96 ++ echo >>$file "" 1.97 ++ echo >>$file "#define _${filestr}_AS_HEADER_" 1.98 ++ echo >>$file "#include \"${file}\"" 1.99 ++ echo >>$file "#undef _${filestr}_AS_HEADER_" 1.100 ++ echo >>$file "" 1.101 ++ echo >>$file "${prefix}version_t ${prefix}version;" 1.102 ++ echo >>$file "" 1.103 ++ echo >>$file "#endif // _${filestr}_AS_HEADER_" 1.104 ++ echo >>$file "" 1.105 ++ ;; 1.106 + m4 ) 1.107 + echo >>$file "##" 1.108 + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" 1.109 +@@ -367,9 +426,9 @@ 1.110 + 1.111 + =item B<-l>, B<--language> I<lang> 1.112 + 1.113 +-Choose format of version file I<file>. I<lang>="C<txt>", ANSI C 1.114 +-(I<lang>="c"), M4 (I<lang>="m4"), Perl (I<lang>="perl") or Python 1.115 +-(I<lang>="python"). Default is C<txt>. 1.116 ++Choose format of version file I<file>. I<lang>="C<txt>", ISO C 1.117 ++(I<lang>="c"), ISO C++ (I<lang>="cxx"), M4 (I<lang>="m4"), Perl 1.118 ++(I<lang>="perl") or Python (I<lang>="python"). Default is C<txt>. 1.119 + 1.120 + =item B<-n>, B<--name> I<name> 1.121 + 1.122 +diff -Nau shtool.pod.orig shtool.pod 1.123 +--- shtool.pod.orig 2008-04-02 22:10:17.000000000 +0200 1.124 ++++ shtool.pod 2009-01-06 01:32:54.000000000 +0100 1.125 +@@ -161,8 +161,8 @@ 1.126 + 1.127 + =item B<version> 1.128 + 1.129 +-Maintain a version information file in either Text, C/C++, Perl or Python. 1.130 +-format. 1.131 ++Maintain a version information file in either Text, C, C++, M4, Perl or 1.132 ++Python. 1.133 + 1.134 + =item B<path> 1.135 +
2.1 --- a/shtool/shtool.spec Tue Jan 06 23:43:55 2009 +0100 2.2 +++ b/shtool/shtool.spec Tue Jan 06 23:45:10 2009 +0100 2.3 @@ -1,6 +1,7 @@ 2.4 ## 2.5 ## shtool.spec -- OpenPKG RPM Package Specification 2.6 -## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/> 2.8 +## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/> 2.9 ## 2.10 ## Permission to use, copy, modify, and distribute this software for 2.11 ## any purpose with or without fee is hereby granted, provided that 2.12 @@ -26,19 +27,20 @@ 2.13 Summary: GNU Portable Shell Tool 2.14 URL: http://www.gnu.org/software/shtool/ 2.15 Vendor: Ralf S. Engelschall 2.16 -Packager: OpenPKG Foundation e.V. 2.17 -Distribution: OpenPKG Community 2.18 +Packager: OpenPKG 2.19 +Distribution: OpenPKG 2.20 Class: CORE 2.21 Group: Building 2.22 License: GPL 2.23 Version: 2.0.8 2.24 -Release: 20080718 2.25 +Release: 20090105 2.26 2.27 # package options 2.28 %option with_shtoolize yes 2.29 2.30 # list of sources 2.31 Source0: ftp://ftp.gnu.org/gnu/shtool/shtool-%{version}.tar.gz 2.32 +Patch0: shtool.patch 2.33 2.34 # build information 2.35 Prefix: %{l_prefix} 2.36 @@ -57,7 +59,7 @@ 2.37 successful use over many years in various free software projects. 2.38 The compiled shtool script is intended to be used inside the source 2.39 tree of those free software packages. There it can take over 2.40 - various (usually non-portable) tasks related to the building and 2.41 + various (usually nonportable) tasks related to the building and 2.42 installation of such packages. 2.43 2.44 %track 2.45 @@ -69,6 +71,7 @@ 2.46 2.47 %prep 2.48 %setup -q 2.49 + %patch -p0 2.50 2.51 %build 2.52 ./configure \ 2.53 @@ -85,7 +88,8 @@ 2.54 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/shtool 2.55 %endif 2.56 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 2.57 - %{l_files_std} 2.58 + %{l_files_std} \ 2.59 + '%not %dir %{l_prefix}/share/aclocal' 2.60 2.61 %files -f files 2.62