packaging(RHEL-CTDB): also pack libwbcient in winbind-32bit package
[garming/samba-autobuild/.git] / packaging / RHEL-CTDB / makerpms.sh
index 219982fda907b8c310b338012336dc153efdf01f..8da9078f98e9bed2eb03749c30a3069513a18557 100755 (executable)
@@ -25,8 +25,6 @@ RPMSRCDIR=`rpm --eval %_sourcedir`
 
 DIRNAME=$(dirname $0)
 TOPDIR=${DIRNAME}/../..
-SRCDIR=${TOPDIR}/source
-VERSION_H=${SRCDIR}/include/version.h
 
 SPECFILE="samba.spec"
 DOCS="docs.tar.bz2"
@@ -49,25 +47,14 @@ esac
 ##
 ## 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
+${DIRNAME}/makespec.sh
+RC=$?
+if [ $RC -ne 0 ]; then
+       exit ${RC}
 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
-VERSION=`echo ${VERSION} | sed 's/-/_/g'`
-VERSION=`echo ${VERSION} | sed 's/\"//g'`
-echo "VERSION: ${VERSION}"
-sed -e s/PVERSION/${VERSION}/g \
-       < ${DIRNAME}/${SPECFILE}.tmpl \
-       > ${DIRNAME}/${SPECFILE}
+RELEASE=$(grep ^Release ${DIRNAME}/${SPECFILE} | sed -e 's/^Release:\ \+//')
+VERSION=$(grep ^Version ${DIRNAME}/${SPECFILE} | sed -e 's/^Version:\ \+//')
 
 ##
 ## create the tarball
@@ -101,19 +88,20 @@ cp -p ${SPECFILE} ${RPMSPECDIR}
 popd
 
 ##
-## Build
+## some symlink fixes for building 32bit compat libs
 ##
-echo "$(basename $0): Getting Ready to build release package"
-pushd ${RPMSPECDIR}
-${RPM} -ba $EXTRA_OPTIONS $SPECFILE
-if [ "x$?" = "x0" ] && [ `arch` = "x86_64" ]; then
-    echo "Building 32 bit winbind libs"
-    # hi ho, a hacking we will go ...
+if [ `arch` = "x86_64" ]; then
     ln -sf /lib/libcom_err.so.2 /lib/libcom_err.so
     ln -sf /lib/libuuid.so.1 /lib/libuuid.so
-    ${RPM} -ba --rebuild --target=i386 $SPECFILE
 fi
 
+##
+## Build
+##
+echo "$(basename $0): Getting Ready to build release package"
+
+pushd ${RPMSPECDIR}
+${RPM} -ba $EXTRA_OPTIONS $SPECFILE
 popd
 
 echo "$(basename $0): Done."