source: trunk/tools/rpm-env @ 66

Last change on this file since 66 was 66, checked in by bcornec, 14 years ago

bug on redhat env

  • 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 66 2005-10-14 14:32:21Z bcornec $
6#
7
8# Adapt to your needs
9export BASE=${HOME}/mondo
10export SVNAUTH=bcornec@shell.berlios.de
11export DSTDIR=/home/groups/ftp/pub/mondorescue
12export FTPURL="ftp.berlios.de /incoming"
13
14# Should not be modified below
15export VER=trunk
16export pkg=""
17export opt=""
18export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
19
20mkdir -p ${BASE}/RPMS
21export TMP=${BASE}/tmp
22mkdir -p ${TMP}
23if [ -f ${HOME}/.rpmmacros ]; then
24    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
25else
26    export TOPDIR=${BASE}/RPMS
27fi
28cd ${TOPDIR}
29mkdir -p RPMS SRPMS SPECS SOURCES BUILD
30
31export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/mindi.spec | egrep '^%define version' | awk '{print $3}' | sed "s/[  ]*//"`
32export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/mondo.spec | egrep '^%define version' | awk '{print $3}' | sed "s/[  ]*//"`
33
34if [ -e /etc/mandriva-release ]; then
35    export ddir="mandriva"
36    export dver=`cat /etc/mandriva-release | awk '{print $4}'`
37    export suf="${dver}mdk"
38elif [ -e /etc/mandrake-release ]; then
39    export ddir="mandrake"
40    export dver=`cat /etc/mandrake-release | awk '{print $3}'`
41    export suf="${dver}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=`cat /etc/redhat-release | awk '{print $7}'`
47    else
48        export ddir="redhat"
49        export dver=`cat /etc/redhat-release | awk '{print $5}'`
50        export suf="${dver}rh"
51    fi
52elif [ -e /etc/SuSE-release ]; then
53    export ddir="suse"
54    export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'`
55else
56    export dver=""
57    export ddir="generic"
58fi
59
60if [ _"$suf" = _"" ]; then
61    export suf="${ddir}${dver}"
62fi
Note: See TracBrowser for help on using the repository browser.