source: branches/2.06/tools/rpm-env @ 315

Last change on this file since 315 was 315, checked in by bcornec, 14 years ago
  • svn.log now part of the rpms
  • .spec factorisation continues (mkrel, requires, ...)
  • 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 315 2006-01-13 19:07: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
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=`awk '{print $4}' /etc/mandriva-release`
39    export suf=" "
40elif [ -e /etc/mandrake-release ]; then
41    export ddir="mandrake"
42    export dver=`awk '{print $3}' /etc/mandrake-release`
43    export suf=" "
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=`awk '{print $7}' /etc/redhat-release`
49    elif grep -q Fedora /etc/redhat-release ; then
50        export ddir="fedora"
51        export dver=`awk '{print $4}' /etc/redhat-release`
52        export suf=".fc${dver}"
53    else
54        export ddir="redhat"
55        export dver=`awk '{print $5}' /etc/redhat-release | 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=`head -1 /etc/SuSE-release | awk '{print $5}'`
63    else
64        export ddir="suse"
65        export dver=`head -1 /etc/SuSE-release | 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.