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

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

merge -r274:275 $SVN_M/branches/2.06

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
RevLine 
[20]1#!/bin/bash
2#
3# Creates RPMs environment from SVN repository
[33]4#
5# $Id: rpm-env 276 2006-01-03 16:01:12Z bcornec $
6#
[20]7
8# Adapt to your needs
[33]9export BASE=${HOME}/mondo
[20]10export SVNAUTH=bcornec@shell.berlios.de
[27]11export DSTDIR=/home/groups/ftp/pub/mondorescue
[98]12export FTPSERV="ftp.berlios.de"
13export FTPDIR="/incoming"
[20]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
[51]25    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
[20]26else
27    export TOPDIR=${BASE}/RPMS
28fi
29cd ${TOPDIR}
30mkdir -p RPMS SRPMS SPECS SOURCES BUILD
31
[238]32export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
33export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
[55]34
35if [ -e /etc/mandriva-release ]; then
[61]36    export ddir="mandriva"
[276]37    export dver=`awk '{print $4}' /etc/mandriva-release`
[61]38    export suf="${dver}mdk"
[55]39elif [ -e /etc/mandrake-release ]; then
[61]40    export ddir="mandrake"
[276]41    export dver=`awk '{print $3}' /etc/mandrake-release`
[61]42    export suf="${dver}mdk"
43elif [ -e /etc/redhat-release ]; then
[66]44    grep -q Enterprise /etc/redhat-release
45    if [ $? -eq 0 ]; then
[61]46        export ddir="rhel"
[276]47        export dver=`awk '{print $7}' /etc/redhat-release`
[262]48    elif grep -q Fedora /etc/redhat-release ; then
49        export ddir="fedora"
[276]50        export dver=`awk '{print $4}' /etc/redhat-release`
[262]51        export suf="fc${dver}"
[61]52    else
53        export ddir="redhat"
[276]54        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
[262]55        export suf="rh${dver}"
[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
72    export suf="${ddir}${dver}"
73fi
Note: See TracBrowser for help on using the repository browser.