source: trunk/tools/rpm-env @ 317

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

merge -r309:316 $SVN_M/branches/2.06

  • 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 317 2006-01-13 19:46:06Z 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/VERSION`
33export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
34
35if [ -e /etc/mandriva-release ]; then
36    export ddir="mandriva"
37    export dver=`awk '{print $4}' /etc/mandriva-release`
38    export suf=".`echo $dver | sed 's/\.//'`mdk"
39elif [ -e /etc/mandrake-release ]; then
40    export ddir="mandrake"
41    export dver=`awk '{print $3}' /etc/mandrake-release`
42    export suf=".`echo $dver | sed 's/\.//'`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=`awk '{print $7}' /etc/redhat-release`
48    elif grep -q Fedora /etc/redhat-release ; then
49        export ddir="fedora"
50        export dver=`awk '{print $4}' /etc/redhat-release`
51        export suf=".fc${dver}"
52    else
53        export ddir="redhat"
54        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
55        export suf=".rh${dver}"
56    fi
57elif [ -e /etc/SuSE-release ]; then
58    grep -q Enterprise /etc/SuSE-release
59    if [ $? -eq 0 ]; then
60        export ddir="sles"
61        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
62    else
63        export ddir="suse"
64        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
65    fi
66else
67    export dver=""
68    export ddir="generic"
69fi
70
71if [ _"$suf" = _"" ]; then
72    export suf=".${ddir}${dver}"
73fi
Note: See TracBrowser for help on using the repository browser.