File: ac_spec_package_3version.html

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (132 lines) | stat: -rw-r--r-- 3,165 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
 <head>
  <title>
   Autoconf Macro: ac_spec_package_3version
  </title>
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
 </head>
 <body>
  <table summary="web navigation" style="width:100%;">
   <tbody>
    <tr>
     <td style="width:50%;" align="center">
      <a href=
      "http://autoconf-archive.cryp.to/ac_spec_package_3version.m4">Download M4
      Source</a>
     </td>
     <td style="width:50%;" align="center">
      <a href="macros-by-category.html">Macro Index Page</a>
     </td>
    </tr>
   </tbody>
  </table>
  <hr>
  <h1>
   ac_spec_package_3version
  </h1>
  <h2>
   Obsolete Macro
  </h2>
  <p class="indent">
   Use AX_SPEC_PACKAGE_VERSION.
  </p>
  <h2>
   Synopsis
  </h2>
  <p class="indent" style="white-space:nowrap;">
   <code>AC_SPEC_PACKAGE_3VERSION(rpmspecfile)</code>
  </p>
  <h2>
   Description
  </h2>
  <div class="indent">
   <p>
    set PACKAGE and VERSION from the defines in the given specfile default to
    basename and currentdate if rpmspecfile is not found if the VERSION-number
    from the spec-file is shorter than 3 digits then additional numbers are
    taken from the current date using entries from `date` as %y and %W%w since
    libtool version numbers can be as max only be 3 digits. The year counts
    from 1900.
   </p>
   <p>
    spec example:
   </p>
   <pre>
    Name: testprog
    Version: 2
</pre>
   <p>
    result: (on 1. April 2002, being monday of 13th week)
   </p>
   <pre>
    VERSION="2.102.131"
    PACKAGE="testprog"
</pre>
   <p>
    See also AC_SET_RELEASEINFO_VERSIONINFO for the use of a 3VERSION.
   </p>
  </div>
  <h2>
   Author
  </h2>
  <p class="indent">
   Guido Draheim &lt;guidod@gmx.de&gt;
  </p>
  <h2>
   Last Modified
  </h2>
  <p class="indent">
   2005-01-25
  </p>
  <h2>
   M4 Source Code
  </h2>
  <div class="indent">
   <pre class="m4source">
AC_DEFUN([AC_SPEC_PACKAGE_3VERSION],[dnl
  pushdef([specfile], ac_spec_package_version_file)
  specfile=`basename $1`
  AC_MSG_CHECKING( $specfile package version)
  if test -z "$1"; then
    AC_MSG_ERROR( no rpm spec file given )
  else
    # find specfile
    for i in $1 $srcdir/$1 $srcdir/../$1 ; do
      if test -f "$i" ; then
        specfile="$i"
        break
      fi
    done
    if test ! -f $specfile ; then
      k="w/o spec"
    else
      if test -z "$PACKAGE" ; then
        i=`grep -i '^name:' $specfile | head -1 | sed -e 's/.*://'`
        PACKAGE=`echo $i | sed -e 's/ /-/'`
      fi
      if test -z "$VERSION" ; then
        i=`grep -i '^version:' $specfile | head -1 | sed -e 's/.*://'`
        VERSION=`echo $i | sed -e 's/ /-/'`
      fi
    fi
    if test -z "$PACKAGE" ; then
      PACKAGE=`basename $specfile .spec`
    fi
    if test -z "$VERSION" ; then
      VERSION=`date +0.1%y.%W%w`
    fi
    case "$VERSION" in
    *.*.*) ;;
    *.*) VERSION="$VERSION."`date +1%y%W%w` ;;
    *) VERSION="$VERSION."`date +1%y.%W%w` ;;
    esac
    VERSION=`echo $VERSION | sed -e 's/[[.]]0/./g'`
    AC_MSG_RESULT( $PACKAGE $VERSION $k )
  fi
])
</pre>
  </div>
 </body>
</html>