~ubuntu-branches/ubuntu/trusty/serf/trusty-security

« back to all changes in this revision

Viewing changes to build/get-version.sh

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2013-12-31 13:17:16 UTC
  • mfrom: (1.1.8) (3.3.2 sid)
  • Revision ID: package-import@ubuntu.com-20131231131716-s862wc4uwdzxmrr1
Tags: 1.3.3-1
* Add myself to Uploaders.
* Change the watch file to better handle code.google.com.
* New upstream release.  (Closes: #716793)
  + Refresh patches/libtool
  + Update symbols
* Adapt packaging for the upstream switch to SCons.
  + control: + scons, - autotools-dev, autoconf
  + rules: Change configure/make calls to scons
* Rename libserf1 to libserf-1-1, following standard naming conventions.
* Enable hardening flags.
* Strip unnecessary RPATH from libserf.
* Honor DEB_BUILD_OPTIONS=parallel=X

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
# extract version numbers from a header file
4
 
#
5
 
# USAGE: get-version.sh CMD VERSION_HEADER PREFIX
6
 
#   where CMD is one of: all, major, libtool
7
 
#   where PREFIX is the prefix to {MAJOR|MINOR|PATCH}_VERSION defines
8
 
#
9
 
#   get-version.sh all returns a dotted version number
10
 
#   get-version.sh major returns just the major version number
11
 
#   get-version.sh libtool returns a version "libtool -version-info" format
12
 
#
13
 
 
14
 
if test $# != 3; then
15
 
  echo "USAGE: $0 CMD VERSION_HEADER PREFIX"
16
 
  echo "  where CMD is one of: all, major, libtool"
17
 
  exit 1
18
 
fi
19
 
 
20
 
major_sed="/#define.*$3_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p"
21
 
minor_sed="/#define.*$3_MINOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p"
22
 
patch_sed="/#define.*$3_PATCH_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p"
23
 
major="`sed -n $major_sed $2`"
24
 
minor="`sed -n $minor_sed $2`"
25
 
patch="`sed -n $patch_sed $2`"
26
 
 
27
 
if test "$1" = "all"; then
28
 
  echo ${major}.${minor}.${patch}
29
 
elif test "$1" = "major"; then
30
 
  echo ${major}
31
 
elif test "$1" = "libtool"; then
32
 
  # Yes, ${minor}:${patch}:${minor} is correct due to libtool idiocy.
33
 
  echo ${minor}:${patch}:${minor}
34
 
else
35
 
  echo "ERROR: unknown version CMD ($1)"
36
 
  exit 1
37
 
fi