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_DIR to the path to a release tarball docs dir in order to get docs
17 SPECDIR=`rpm --eval %_specdir`
18 SRCDIR=`rpm --eval %_sourcedir`
20 # At this point the SPECDIR and SRCDIR vaiables must have a value!
27 RPMVER=`rpm --version | awk '{print $3}'`
31 ## Check the RPM version (paranoid)
35 echo "Supported RPM version [$RPMVER]"
38 echo "Unknown RPM version: `rpm --version`"
45 if [ -f Makefile ]; then
52 SRCTREE=`basename $PWD`
53 if [ $DOCS_DIR ] && [ -d $DOCS_DIR ]; then
58 chown -R ${USERID}.${GRPID} $SRCTREE
59 if [ ! -d samba-${VERSION} ]; then
60 ln -s $SRCTREE samba-${VERSION} || exit 1
62 echo -n "Creating samba-${VERSION}.tar.bz2 ... "
63 tar --exclude=.svn --exclude=.bzr --exclude=.bzrignore --exclude=docs-orig -chf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
68 # restore original structure if docs were specified
69 if [ ${DOCS_DIR} ] && [ -d docs-orig ] && [ -L docs ]; then
81 ## copy additional source files
83 chmod 755 setup/filter-requires-samba.sh
84 tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2
85 cp -p ${SPECFILE} ${SPECDIR}
90 echo "$(basename $0): Getting Ready to build release package"
92 ${RPM} -ba $EXTRA_OPTIONS $SPECFILE
93 [ `arch` = "x86_64" ] && {
94 echo "Building 32 bit winbind libs"
95 # hi ho, a hacking we will go ...
96 ln -sf /lib/libcom_err.so.2 /lib/libcom_err.so
97 ln -sf /lib/libuuid.so.1 /lib/libuuid.so
98 ${RPM} -ba --rebuild --target=i386 $SPECFILE
104 # restore original structure if docs were specified
106 if [ ${DOCS_DIR} ] && [ -d docs-orig ] && [ -L docs ]; then
111 echo "$(basename $0): Done."