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