|
Last change
on this file since 788 was 414, checked in by Herwig Bauernfeind, 16 years ago |
|
Samba 3.5.0: Initial import
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 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}/source3
|
|---|
| 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 "^#define SAMBA_VERSION_OFFICIAL_STRING " ${VERSION_H} | awk '{print $3}'`
|
|---|
| 25 | vendor_version=`grep "^#define 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 | vendor_patch=`grep "^#define SAMBA_VERSION_VENDOR_PATCH " ${VERSION_H} | awk '{print $3}'`
|
|---|
| 30 | if test "x${vendor_patch}" != "x" ; then
|
|---|
| 31 | VERSION="${VERSION}-${vendor_patch}"
|
|---|
| 32 | fi
|
|---|
| 33 | VERSION=`echo ${VERSION} | sed 's/-/_/g'`
|
|---|
| 34 | VERSION=`echo ${VERSION} | sed 's/\"//g'`
|
|---|
| 35 | echo "VERSION: ${VERSION}"
|
|---|
| 36 |
|
|---|
| 37 | # to build a release-rpm, set USE_GITHASH="no"
|
|---|
| 38 | # in the environmet
|
|---|
| 39 | #
|
|---|
| 40 | if test "x$USE_GITHASH" = "xno" ; then
|
|---|
| 41 | GITHASH=""
|
|---|
| 42 | echo "GITHASH: not used"
|
|---|
| 43 | else
|
|---|
| 44 | GITHASH=".$(git log --pretty=format:%h -1)"
|
|---|
| 45 | echo "GITHASH: ${GITHASH}"
|
|---|
| 46 | fi
|
|---|
| 47 |
|
|---|
| 48 | sed -e s/PVERSION/${VERSION}/g \
|
|---|
| 49 | -e s/GITHASH/${GITHASH}/g \
|
|---|
| 50 | < ${SPECFILE}.tmpl \
|
|---|
| 51 | > ${SPECFILE}
|
|---|
| 52 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.