source: MondoRescue/trunk/tools/rpm-env @ 357

Last change on this file since 357 was 357, checked in by bcornec, 15 years ago

merge -r 349:356 $SVN_M/branches/stable

  • 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 357 2006-01-29 01:14:27Z 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"
[357]53        dver=`awk '{print $5}' /etc/redhat-release`
[317]54        export suf=".rh${dver}"
[357]55        export dver=`echo ${dver} | sed "s/\.//"`
[61]56    fi
57elif [ -e /etc/SuSE-release ]; then
[236]58    grep -q Enterprise /etc/SuSE-release
59    if [ $? -eq 0 ]; then
60        export ddir="sles"
[276]61        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
[236]62    else
63        export ddir="suse"
[276]64        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
[236]65    fi
[55]66else
[61]67    export dver=""
68    export ddir="generic"
[55]69fi
[61]70
71if [ _"$suf" = _"" ]; then
[317]72    export suf=".${ddir}${dver}"
[61]73fi
Note: See TracBrowser for help on using the repository browser.