~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to packaging/RHEL-CTDB/makespec.sh

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Copyright (C) Michael Adam 2008
 
4
#
 
5
# Script to determine the samba version and create the SPEC file from template
 
6
 
 
7
DIRNAME=$(dirname $0)
 
8
TOPDIR=${DIRNAME}/../..
 
9
SRCDIR=${TOPDIR}/source
 
10
VERSION_H=${SRCDIR}/include/version.h
 
11
SPECFILE=${DIRNAME}/samba.spec
 
12
 
 
13
##
 
14
## determine the samba version and create the SPEC file
 
15
##
 
16
pushd ${SRCDIR}
 
17
./script/mkversion.sh
 
18
popd
 
19
if [ ! -f ${VERSION_H} ] ; then
 
20
        echo "Error creating version.h"
 
21
        exit 1
 
22
fi
 
23
 
 
24
VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
 
25
vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print $3}'`
 
26
if test "x${vendor_version}"  != "x" ; then
 
27
        VERSION="${VERSION}-${vendor_version}"
 
28
fi
 
29
VERSION=`echo ${VERSION} | sed 's/-/_/g'`
 
30
VERSION=`echo ${VERSION} | sed 's/\"//g'`
 
31
echo "VERSION: ${VERSION}"
 
32
sed -e s/PVERSION/${VERSION}/g \
 
33
        < ${SPECFILE}.tmpl \
 
34
        > ${SPECFILE}
 
35