source: trunk/tools/rpm-env @ 320

Last change on this file since 320 was 320, checked in by bcornec, 13 years ago

merge -r316:319 $SVN_M/branches/2.06

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs environment from SVN repository
4#
5# $Id: rpm-env 320 2006-01-14 23:29:12Z bcornec $
6#
7
8dname=`dirname $0`
9prem=`echo $dname |cut -c1`
10if [ ${prem} == "/" ]; then
11        export TOOLHOME=$dname
12else
13    export TOOLHOME=${PWD}/$dname
14fi
15
16. $TOOLHOME/common-env
17
18export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
19
20# Should not be modified below
21export VER=trunk
22export pkg=""
23export opt=""
24
25if [ -f ${HOME}/.rpmmacros ]; then
26    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
27else
28    export TOPDIR=${BASE}/RPMS
29fi
30mkdir -p ${TOPDIR}
31cd ${TOPDIR}
32mkdir -p RPMS SRPMS SPECS SOURCES BUILD
33
34if [ -e /etc/mandriva-release ]; then
35    export ddir="mandriva"
36    export dver=`awk '{print $4}' /etc/mandriva-release`
37    export suf=".`echo $dver | sed 's/\.//'`mdk"
38elif [ -e /etc/mandrake-release ]; then
39    export ddir="mandrake"
40    export dver=`awk '{print $3}' /etc/mandrake-release`
41    export suf=".`echo $dver | sed 's/\.//'`mdk"
42elif [ -e /etc/redhat-release ]; then
43    grep -q Enterprise /etc/redhat-release
44    if [ $? -eq 0 ]; then
45        export ddir="rhel"
46        export dver=`awk '{print $7}' /etc/redhat-release`
47    elif grep -q Fedora /etc/redhat-release ; then
48        export ddir="fedora"
49        export dver=`awk '{print $4}' /etc/redhat-release`
50        export suf=".fc${dver}"
51    else
52        export ddir="redhat"
53        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
54        export suf=".rh${dver}"
55    fi
56elif [ -e /etc/SuSE-release ]; then
57    grep -q Enterprise /etc/SuSE-release
58    if [ $? -eq 0 ]; then
59        export ddir="sles"
60        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
61    else
62        export ddir="suse"
63        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
64    fi
65else
66    export dver=""
67    export ddir="generic"
68fi
69
70if [ _"$suf" = _"" ]; then
71    export suf=".${ddir}${dver}"
72fi
Note: See TracBrowser for help on using the repository browser.