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
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!
29 RPMVER=`rpm --version | awk '{print $3}'`
33 ## Check the RPM version (paranoid)
37 echo "Supported RPM version [$RPMVER]"
40 echo "Unknown RPM version: `rpm --version`"
47 if [ -f Makefile ]; then
54 SRCTREE=`basename $PWD`
55 if [ $DOCS_DIR ] && [ -d $DOCS_DIR ]; then
60 chown -R ${USERID}.${GRPID} $SRCTREE
61 if [ ! -d samba-${VERSION} ]; then
62 ln -s $SRCTREE samba-${VERSION} || exit 1
64 echo -n "Creating samba-${VERSION}.tar.bz2 ... "
65 tar --exclude=.svn --exclude=.bzr --exclude=.bzrignore --exclude=docs-orig -chf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
70 # restore original structure if docs were specified
71 if [ ${DOCS_DIR} ] && [ -d docs-orig ] && [ -L docs ]; then
83 ## copy additional source files
85 chmod 755 setup/filter-requires-samba.sh
86 tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2
87 cp -p ${SPECFILE} ${SPECDIR}
92 echo "$(basename $0): Getting Ready to build release package"
94 ${RPM} -ba $EXTRA_OPTIONS $SPECFILE
95 [ `arch` = "x86_64" ] && {
96 echo "Building 32 bit winbind libs"
97 # hi ho, a hacking we will go ...
98 ln -sf /lib/libcom_err.so.2 /lib/libcom_err.so
99 ln -sf /lib/libuuid.so.1 /lib/libuuid.so
100 ${RPM} -ba --rebuild --target=i386 $SPECFILE
106 # restore original structure if docs were specified
108 if [ ${DOCS_DIR} ] && [ -d docs-orig ] && [ -L docs ]; then
113 echo "$(basename $0): Done."