~ubuntu-branches/ubuntu/lucid/autoconf-archive/lucid

« back to all changes in this revision

Viewing changes to m4/ac_spec_package_version.m4

  • Committer: Bazaar Package Importer
  • Author(s): Deng Xiyue
  • Date: 2009-05-12 17:30:18 UTC
  • mfrom: (1.1.9 upstream) (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090512173018-s7y88nfoxpaauztk
Tags: 20090426-1
* New upstream release.
* Update Standard-Version to 3.8.1:
  + List original Debianizer.
  + Point to versioned license file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# ===========================================================================
2
 
#        http://autoconf-archive.cryp.to/ac_spec_package_version.html
3
 
# ===========================================================================
4
 
#
5
 
# OBSOLETE MACRO
6
 
#
7
 
#   Use AX_SPEC_PACKAGE_VERSION.
8
 
#
9
 
# SYNOPSIS
10
 
#
11
 
#   AC_SPEC_PACKAGE_VERSION(rpmspecfile)
12
 
#
13
 
# DESCRIPTION
14
 
#
15
 
#   set PACKAGE and VERSION from the defines in the given specfile default
16
 
#   to basename and currentde if rpmspecfile is not found
17
 
#
18
 
# LAST MODIFICATION
19
 
#
20
 
#   2008-04-12
21
 
#
22
 
# COPYLEFT
23
 
#
24
 
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
25
 
#
26
 
#   This program is free software; you can redistribute it and/or modify it
27
 
#   under the terms of the GNU General Public License as published by the
28
 
#   Free Software Foundation; either version 2 of the License, or (at your
29
 
#   option) any later version.
30
 
#
31
 
#   This program is distributed in the hope that it will be useful, but
32
 
#   WITHOUT ANY WARRANTY; without even the implied warranty of
33
 
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
34
 
#   Public License for more details.
35
 
#
36
 
#   You should have received a copy of the GNU General Public License along
37
 
#   with this program. If not, see <http://www.gnu.org/licenses/>.
38
 
#
39
 
#   As a special exception, the respective Autoconf Macro's copyright owner
40
 
#   gives unlimited permission to copy, distribute and modify the configure
41
 
#   scripts that are the output of Autoconf when processing the Macro. You
42
 
#   need not follow the terms of the GNU General Public License when using
43
 
#   or distributing such scripts, even though portions of the text of the
44
 
#   Macro appear in them. The GNU General Public License (GPL) does govern
45
 
#   all other use of the material that constitutes the Autoconf Macro.
46
 
#
47
 
#   This special exception to the GPL applies to versions of the Autoconf
48
 
#   Macro released by the Autoconf Macro Archive. When you make and
49
 
#   distribute a modified version of the Autoconf Macro, you may extend this
50
 
#   special exception to the GPL to apply to your modified version as well.
51
 
 
52
 
AC_DEFUN([AC_SPEC_PACKAGE_VERSION],[dnl
53
 
  pushdef([specfile], ac_spec_package_version_file)
54
 
  specfile=`basename $1`
55
 
  AC_MSG_CHECKING( $specfile package version)
56
 
  if test -z "$1"; then
57
 
    AC_MSG_ERROR( no rpm spec file given )
58
 
  else
59
 
    # find specfile
60
 
    for i in $1 $srcdir/$1 $srcdir/../$1 ; do
61
 
      if test -f "$i" ; then
62
 
        specfile="$i"
63
 
        break
64
 
      fi
65
 
    done
66
 
    if test ! -f $specfile ; then
67
 
      k="w/o spec"
68
 
    else
69
 
      if test -z "$PACKAGE" ; then
70
 
        i=`grep -i '^name:' $specfile | head -1 | sed -e 's/.*://'`
71
 
        PACKAGE=`echo $i | sed -e 's/ /-/'`
72
 
      fi
73
 
      if test -z "$VERSION" ; then
74
 
        i=`grep -i '^version:' $specfile | head -1 | sed -e 's/.*://'`
75
 
        VERSION=`echo $i | sed -e 's/ /-/'`
76
 
      fi
77
 
    fi
78
 
    if test -z "$PACKAGE" ; then
79
 
      PACKAGE=`basename $specfile .spec`
80
 
    fi
81
 
    if test -z "$VERSION" ; then
82
 
      VERSION=`date +%Y.%m.%d`
83
 
    fi
84
 
    AC_MSG_RESULT( $PACKAGE $VERSION $k )
85
 
  fi
86
 
])