summaryrefslogtreecommitdiffstats
path: root/packaging/RedHat/makerpms.sh.tmpl
blob: 44b89a45ec8eb2dec6334dc69677e8cdac4b4574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# Copyright (C) John H Terpstra 1998
# Updated for RPM 3 by Jochen Wiedmann, joe@ispsoft.de
# Changed for a generic tar file rebuild by abartlet@pcug.org.au
USERID=`id -u`
GRPID=`id -g`
VERSION='PVERSION'

rm -f ../../samba2.*.spec

case `rpm --version | awk '{print $3}'` in
    2.*)
       sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba2.rpm2.spec
       cp samba2.rpm2.spec ../../
       ;;
    3.*)
       sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba2.rpm3.spec
       cp samba2.rpm3.spec ../../
       ;;
    4.*)
       sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2.spec > samba2.rpm4.spec
       cp samba2.rpm4.spec ../../
       ;;
    *)
       echo "Unknown RPM version: `rpm --version`"
       exit 1
       ;;
esac

( cd ../../source; if [ -f Makefile ]; then make distclean; fi )
( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
( cd ../../.. ; tar --exclude=CVS -czvf samba-${VERSION}.tar.gz samba-${VERSION}/samba2.*.spec samba-${VERSION} )

rpm -ta -v ../../../samba-${VERSION}.tar.gz