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

Last change on this file was 319, checked in by bcornec, 15 years ago
  • split build architecture to allow for multiple packages generation (rpms, debs, ebuild, ...)
  • only prepared for rpms and debs at the moment

Use tools/mkrpm to generate all the RPMs
Use tools/mkdeb (to be coded correctly) to generate all the debs

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.7 KB
RevLine 
[20]1#!/bin/bash
2#
3# Creates RPMs environment from SVN repository
[33]4#
5# $Id: rpm-env 319 2006-01-14 10:44:12Z bcornec $
6#
[20]7
[319]8dname=`dirname $0`
9prem=`echo $dname |cut -c1`
10if [ ${prem} == "/" ]; then
11        export TOOLHOME=$dname
12else
13    export TOOLHOME=${PWD}/$dname
14fi
[20]15
[319]16. $TOOLHOME/common-env
17
18export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
19
[20]20# Should not be modified below
21export pkg=""
22export opt=""
23
24if [ -f ${HOME}/.rpmmacros ]; then
[50]25    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
[20]26else
27    export TOPDIR=${BASE}/RPMS
28fi
[318]29mkdir -p ${TOPDIR}
[20]30cd ${TOPDIR}
31mkdir -p RPMS SRPMS SPECS SOURCES BUILD
32
[54]33if [ -e /etc/mandriva-release ]; then
[60]34    export ddir="mandriva"
[275]35    export dver=`awk '{print $4}' /etc/mandriva-release`
[316]36    export suf=".`echo $dver | sed 's/\.//'`mdk"
[54]37elif [ -e /etc/mandrake-release ]; then
[60]38    export ddir="mandrake"
[275]39    export dver=`awk '{print $3}' /etc/mandrake-release`
[316]40    export suf=".`echo $dver | sed 's/\.//'`mdk"
[60]41elif [ -e /etc/redhat-release ]; then
[67]42    grep -q Enterprise /etc/redhat-release
43    if [ $? -eq 0 ]; then
[60]44        export ddir="rhel"
[275]45        export dver=`awk '{print $7}' /etc/redhat-release`
[257]46    elif grep -q Fedora /etc/redhat-release ; then
47        export ddir="fedora"
[275]48        export dver=`awk '{print $4}' /etc/redhat-release`
[313]49        export suf=".fc${dver}"
[60]50    else
51        export ddir="redhat"
[275]52        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
[313]53        export suf=".rh${dver}"
[60]54    fi
55elif [ -e /etc/SuSE-release ]; then
[233]56    grep -q Enterprise /etc/SuSE-release
57    if [ $? -eq 0 ]; then
58        export ddir="sles"
[275]59        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
[233]60    else
61        export ddir="suse"
[275]62        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
[233]63    fi
[54]64else
[60]65    export dver=""
66    export ddir="generic"
[54]67fi
[60]68
69if [ _"$suf" = _"" ]; then
[313]70    export suf=".${ddir}${dver}"
[60]71fi
Note: See TracBrowser for help on using the repository browser.