~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to packaging/RedHat-9/makerpms.sh.tmpl

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Copyright (C) John H Terpstra 1998-2002
3
 
# Updated for RPM 3 by Jochen Wiedmann, joe@ispsoft.de
4
 
# Changed for a generic tar file rebuild by abartlet@pcug.org.au
5
 
# Changed by John H Terpstra to build on RH7.2 - should also work for earlier versions jht@samba.org
6
 
 
7
 
# The following allows environment variables to override the target directories
8
 
#   the alternative is to have a file in your home directory calles .rpmmacros
9
 
#   containing the following:
10
 
#   %_topdir  /home/mylogin/redhat
11
 
#
12
 
# Note: Under this directory rpm expects to find the same directories that are under the
13
 
#   /usr/src/redhat directory
14
 
#
15
 
 
16
 
SPECDIR=`rpm --eval %_specdir`
17
 
SRCDIR=`rpm --eval %_sourcedir`
18
 
 
19
 
# At this point the SPECDIR and SRCDIR vaiables must have a value!
20
 
 
21
 
USERID=`id -u`
22
 
GRPID=`id -g`
23
 
VERSION='PVERSION'
24
 
REVISION='PREVISION'
25
 
SPECFILE="samba3.spec"
26
 
RPMVER=`rpm --version | awk '{print $3}'`
27
 
RPM="rpm"
28
 
echo The RPM Version on this machine is: $RPMVER
29
 
 
30
 
##
31
 
## fix the mandir macro
32
 
##
33
 
case $RPMVER in
34
 
    [23]*)
35
 
       sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE
36
 
       ;;
37
 
    4*)
38
 
       sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
39
 
       ;;
40
 
    *)
41
 
       echo "Unknown RPM version: `rpm --version`"
42
 
       exit 1
43
 
       ;;
44
 
esac
45
 
 
46
 
##
47
 
## now catch the right command to build an RPM (defaults ro 'rpm'
48
 
##
49
 
case $RPMVER in
50
 
    4.[123]*)
51
 
       RPM="rpmbuild"
52
 
       ;;
53
 
esac
54
 
 
55
 
echo "RPM build command is \"$RPM\""
56
 
 
57
 
pushd .
58
 
cd ../../source
59
 
if [ -f Makefile ]; then
60
 
        make distclean
61
 
fi
62
 
popd
63
 
 
64
 
pushd .
65
 
cd ../../../
66
 
chown -R ${USERID}.${GRPID} samba-${VERSION}${REVISION}
67
 
if [ ! -d samba-${VERSION} ]; then
68
 
        ln -s samba-${VERSION}${REVISION} samba-${VERSION} || exit 1
69
 
fi
70
 
echo -n "Creating samba-${VERSION}.tar.bz2 ... "
71
 
tar --exclude=.svn -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
72
 
echo "Done."
73
 
if [ $? -ne 0 ]; then
74
 
        echo "Build failed!"
75
 
        exit 1
76
 
fi
77
 
 
78
 
popd
79
 
 
80
 
 
81
 
/bin/cp -p filter-requires-samba_rh8.sh ${SRCDIR}
82
 
/bin/cp -p filter-requires-samba_rh9.sh ${SRCDIR}
83
 
chmod 755 ${SRCDIR}/filter-requires-samba_rh?.sh
84
 
/bin/cp -av $SPECFILE ${SPECDIR}
85
 
 
86
 
echo Getting Ready to build release package
87
 
cd ${SPECDIR}
88
 
${RPM} -ba --clean --rmsource $SPECFILE
89
 
 
90
 
echo Done.
91