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

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

Preparation to support official mandriva builds

  • 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 316 2006-01-13 19:44:05Z 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
[97]12export FTPSERV="ftp.berlios.de"
13export FTPDIR="/incoming"
[20]14
15# Should not be modified below
[265]16dname=`dirname $0`
17export VER="branches/`cat $dname/../mondo/VERSION`"
[20]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
[50]26    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
[20]27else
28    export TOPDIR=${BASE}/RPMS
29fi
30cd ${TOPDIR}
31mkdir -p RPMS SRPMS SPECS SOURCES BUILD
32
[237]33export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
34export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
[54]35
36if [ -e /etc/mandriva-release ]; then
[60]37    export ddir="mandriva"
[275]38    export dver=`awk '{print $4}' /etc/mandriva-release`
[316]39    export suf=".`echo $dver | sed 's/\.//'`mdk"
[54]40elif [ -e /etc/mandrake-release ]; then
[60]41    export ddir="mandrake"
[275]42    export dver=`awk '{print $3}' /etc/mandrake-release`
[316]43    export suf=".`echo $dver | sed 's/\.//'`mdk"
[60]44elif [ -e /etc/redhat-release ]; then
[67]45    grep -q Enterprise /etc/redhat-release
46    if [ $? -eq 0 ]; then
[60]47        export ddir="rhel"
[275]48        export dver=`awk '{print $7}' /etc/redhat-release`
[257]49    elif grep -q Fedora /etc/redhat-release ; then
50        export ddir="fedora"
[275]51        export dver=`awk '{print $4}' /etc/redhat-release`
[313]52        export suf=".fc${dver}"
[60]53    else
54        export ddir="redhat"
[275]55        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
[313]56        export suf=".rh${dver}"
[60]57    fi
58elif [ -e /etc/SuSE-release ]; then
[233]59    grep -q Enterprise /etc/SuSE-release
60    if [ $? -eq 0 ]; then
61        export ddir="sles"
[275]62        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
[233]63    else
64        export ddir="suse"
[275]65        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
[233]66    fi
[54]67else
[60]68    export dver=""
69    export ddir="generic"
[54]70fi
[60]71
72if [ _"$suf" = _"" ]; then
[313]73    export suf=".${ddir}${dver}"
[60]74fi
Note: See TracBrowser for help on using the repository browser.