2 # Copyright (C) John H Terpstra 1998-2002
3 # Gerald (Jerry) Carter 2003
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
10 # Note: Under this directory rpm expects to find the same directories that are under the
11 # /usr/src/redhat directory
14 # set DOCS_TARBALL to the path to a docs release tarball in .tar.bz2 format
16 # extra options passed to rpmbuild
19 SPECDIR=`rpm --eval %_specdir`
20 SRCDIR=`rpm --eval %_sourcedir`
22 # At this point the SPECDIR and SRCDIR variables must have a value!
28 RPMVER=`rpm --version | awk '{print $3}'`
32 ## Check the RPM version (paranoid)
36 echo "Supported RPM version [$RPMVER]"
39 echo "Unknown RPM version: `rpm --version`"
45 echo -n "Creating samba-${VERSION}.tar.bz2 ... "
46 git archive --prefix=samba-${VERSION}/ HEAD | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
50 if [ $RC -ne 0 ]; then
57 ## copy additional source files
59 if [ "x${DOCS_TARBALL}" != "x" ] && [ -f ${DOCS_TARBALL} ]; then
60 cp ${DOCS_TARBALL} ${SRCDIR}/${DOCS}
63 chmod 755 setup/filter-requires-samba.sh
64 tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2
66 cp -p ${SPECFILE} ${SPECDIR}
71 echo "$(basename $0): Getting Ready to build release package"
73 ${RPM} -ba $EXTRA_OPTIONS $SPECFILE
74 [ `arch` = "x86_64" ] && {
75 echo "Building 32 bit winbind libs"
76 # hi ho, a hacking we will go ...
77 ln -sf /lib/libcom_err.so.2 /lib/libcom_err.so
78 ln -sf /lib/libuuid.so.1 /lib/libuuid.so
79 ${RPM} -ba --rebuild --target=i386 $SPECFILE
84 echo "$(basename $0): Done."