File: mkversion

package info (click to toggle)
inn2 2.5.2-2~squeeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,072 kB
  • ctags: 8,521
  • sloc: ansic: 91,418; sh: 13,249; perl: 12,311; makefile: 2,928; yacc: 868; python: 342; lex: 266
file content (39 lines) | stat: -rwxr-xr-x 1,016 bytes parent folder | download | duplicates (6)
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
#! /bin/sh

##  $Id: mkversion 7313 2005-06-11 19:28:03Z eagle $
##
##  Create version.h from INN version information.
##
##  Makefile.global contains the INN version number and extra version
##  information (if any).  This is passed to use by lib/Makefile as our
##  first and second arguments.  Print a header file suitable for use
##  as inn/version.h on stdout.

version="$1"
extra="$2"
string="INN $version"
if [ x"$extra" = x"prerelease" ] ; then
    date=`date +%Y%m%d`
    extra="$date $extra"
fi
if [ -n "$extra" ] ; then
    string="$string ($extra)"
fi
major=`echo "$version" | cut -d. -f1`
minor=`echo "$version" | cut -d. -f2`
patch=`echo "$version" | cut -d. -f3`

cat <<EOF
/* Automatically generated by mkversion, edit Makefile.global to change. */

#ifndef INN_VERSION_H
#define INN_VERSION_H 1

#define INN_VERSION_MAJOR $major
#define INN_VERSION_MINOR $minor
#define INN_VERSION_PATCH $patch
#define INN_VERSION_EXTRA "$extra"
#define INN_VERSION_STRING "$string"

#endif /* INN_VERSION_H */
EOF