r13424: Don't attempt to use cc -O2. This breaks the solaris build.
[Samba.git] / packaging / RHEL / makerpms.sh.tmpl
blobe6c178f6f3c5782663ec7f1a22b48e0013e1b630
1 #!/bin/sh
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 SPECDIR=`rpm --eval %_specdir`
15 SRCDIR=`rpm --eval %_sourcedir`
17 # At this point the SPECDIR and SRCDIR vaiables must have a value!
19 USERID=`id -u`
20 GRPID=`id -g`
21 VERSION='PVERSION'
22 SPECFILE="samba.spec"
23 RPMVER=`rpm --version | awk '{print $3}'`
24 RPM="rpmbuild"
27 ## Check the RPM version (paranoid)
29 case $RPMVER in
30 4*)
31 echo "Supported RPM version [$RPMVER]"
34 echo "Unknown RPM version: `rpm --version`"
35 exit 1
37 esac
39 ( cd ../../source; if [ -f Makefile ]; then make distclean; fi )
40 ( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
42 ( cd ../../.. ; tar --exclude=.svn -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 )
45 ## copy additional source files
47 chmod 755 setup/filter-requires-samba.sh
48 tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2
49 cp -p ${SPECFILE} ${SPECDIR}
52 ## Build
54 echo Getting Ready to build release package
55 cd ${SPECDIR}
56 ${RPM} -ba --clean --rmsource $SPECFILE
58 echo Done.