1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00
Michael Adam 0037b31b2f packaging(RHEL-CTDB): extend makespec.sh to extract VENDOR_PATCH from version.h
Michael
(cherry picked from commit fc122aa276bce379b492e5bdf52ab3e03bc3737f)
2009-11-13 16:19:32 +01:00

40 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
#
# Copyright (C) Michael Adam 2008
#
# Script to determine the samba version and create the SPEC file from template
DIRNAME=$(dirname $0)
TOPDIR=${DIRNAME}/../..
SRCDIR=${TOPDIR}/source
VERSION_H=${SRCDIR}/include/version.h
SPECFILE=${DIRNAME}/samba.spec
##
## determine the samba version and create the SPEC file
##
pushd ${SRCDIR}
./script/mkversion.sh
popd
if [ ! -f ${VERSION_H} ] ; then
echo "Error creating version.h"
exit 1
fi
VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print $3}'`
if test "x${vendor_version}" != "x" ; then
VERSION="${VERSION}-${vendor_version}"
fi
vendor_patch=`grep SAMBA_VERSION_VENDOR_PATCH ${VERSION_H} | awk '{print $3}'`
if test "x${vendor_patch}" != "x" ; then
VERSION="${VERSION}-${vendor_patch}"
fi
VERSION=`echo ${VERSION} | sed 's/-/_/g'`
VERSION=`echo ${VERSION} | sed 's/\"//g'`
echo "VERSION: ${VERSION}"
sed -e s/PVERSION/${VERSION}/g \
< ${SPECFILE}.tmpl \
> ${SPECFILE}