1#!/bin/sh 2# Copyright (C) John H Terpstra 1998-2002 3# Gerald (Jerry) Carter 2003 4 5# The following allows environment variables to override the target directories 6# the alternative is to have a file in your home directory calles .rpmmacros 7# containing the following: 8# %_topdir /home/mylogin/redhat 9# 10# Note: Under this directory rpm expects to find the same directories that are under the 11# /usr/src/redhat directory 12# 13 14EXTRA_OPTIONS="$1" 15 16SPECDIR=`rpm --eval %_specdir` 17SRCDIR=`rpm --eval %_sourcedir` 18 19# At this point the SPECDIR and SRCDIR vaiables must have a value! 20 21USERID=`id -u` 22GRPID=`id -g` 23VERSION='3.0.25b' 24REVISION='' 25SPECFILE="samba.spec" 26RPMVER=`rpm --version | awk '{print $3}'` 27RPM="rpmbuild" 28 29## 30## Check the RPM version (paranoid) 31## 32case $RPMVER in 33 4*) 34 echo "Supported RPM version [$RPMVER]" 35 ;; 36 *) 37 echo "Unknown RPM version: `rpm --version`" 38 exit 1 39 ;; 40esac 41 42pushd . 43cd ../../source 44if [ -f Makefile ]; then 45 make distclean 46fi 47popd 48 49pushd . 50cd ../../../ 51chown -R ${USERID}.${GRPID} samba-${VERSION}${REVISION} 52if [ ! -d samba-${VERSION} ]; then 53 ln -s samba-${VERSION}${REVISION} samba-${VERSION} || exit 1 54fi 55echo -n "Creating samba-${VERSION}.tar.bz2 ... " 56tar --exclude=.svn -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 57echo "Done." 58if [ $? -ne 0 ]; then 59 echo "Build failed!" 60 exit 1 61fi 62 63popd 64 65 66## 67## copy additional source files 68## 69chmod 755 setup/filter-requires-samba.sh 70tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2 71cp -p ${SPECFILE} ${SPECDIR} 72 73## 74## Build 75## 76echo "$(basename $0): Getting Ready to build release package" 77cd ${SPECDIR} 78${RPM} -ba --clean --rmsource $EXTRA_OPTIONS $SPECFILE 79 80echo "$(basename $0): Done." 81 82