source: trunk/tools/rpm-env @ 127

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

merge -r 96:97 from 2.04 branch

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