source: MondoRescue/branches/2.06/tools/rpm-env @ 265

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

Remove hard coded version dependancy to use mondo/VERSION

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs environment from SVN repository
4#
5# $Id: rpm-env 265 2005-12-23 20:05:52Z 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
16dname=`dirname $0`
17export VER="branches/`cat $dname/../mondo/VERSION`"
18export pkg=""
19export opt=""
20export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
21
22mkdir -p ${BASE}/RPMS
23export TMP=${BASE}/tmp
24mkdir -p ${TMP}
25if [ -f ${HOME}/.rpmmacros ]; then
26    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
27else
28    export TOPDIR=${BASE}/RPMS
29fi
30cd ${TOPDIR}
31mkdir -p RPMS SRPMS SPECS SOURCES BUILD
32
33export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
34export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
35
36if [ -e /etc/mandriva-release ]; then
37    export ddir="mandriva"
38    export dver=`cat /etc/mandriva-release | awk '{print $4}'`
39    export suf="${dver}mdk"
40elif [ -e /etc/mandrake-release ]; then
41    export ddir="mandrake"
42    export dver=`cat /etc/mandrake-release | awk '{print $3}'`
43    export suf="${dver}mdk"
44elif [ -e /etc/redhat-release ]; then
45    grep -q Enterprise /etc/redhat-release
46    if [ $? -eq 0 ]; then
47        export ddir="rhel"
48        export dver=`cat /etc/redhat-release | awk '{print $7}'`
49    elif grep -q Fedora /etc/redhat-release ; then
50        export ddir="fedora"
51        export dver=`cat /etc/redhat-release | awk '{print $4}'`
52        export suf="fc${dver}"
53    else
54        export ddir="redhat"
55        export dver=`cat /etc/redhat-release | awk '{print $5}' | sed "s/\.//"`
56        export suf="rh${dver}"
57    fi
58elif [ -e /etc/SuSE-release ]; then
59    grep -q Enterprise /etc/SuSE-release
60    if [ $? -eq 0 ]; then
61        export ddir="sles"
62        export dver=`cat /etc/SuSE-release | head -1 | awk '{print $5}'`
63    else
64        export ddir="suse"
65        export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'`
66    fi
67else
68    export dver=""
69    export ddir="generic"
70fi
71
72if [ _"$suf" = _"" ]; then
73    export suf="${ddir}${dver}"
74fi
Note: See TracBrowser for help on using the repository browser.