source: MondoRescue/branches/stable/tools/mkgentoo@ 530

Last change on this file since 530 was 530, checked in by bcornec, 18 years ago

Build process reviewed once more :
gentoo integration
slackware integration
mkqemu should only work with tar files, and not SVN (ease VM build and time in build process)
To be continued

DOES NOT WORK AT THE MOMENT

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[20]1#!/bin/bash
2#
[530]3# Creates Gentoo packages from SVN repository
[33]4#
5# $Id: mkgentoo 530 2006-05-08 15:31:14Z bcornec $
6#
[20]7
[157]8umask 022
[33]9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12 export TOOLHOME=$dname
13else
14 export TOOLHOME=${PWD}/$dname
15fi
[20]16
[530]17. $TOOLHOME/gentoo-env
[33]18
[20]19if [ "$1" = "" ]; then
20 c="mindi mondo"
21else
22 c=$1
23fi
[319]24
25$TOOLHOME/mkcommon "$c"
26
[204]27if [ "`echo $c | grep mindi-kernel`" != "" ]; then
[20]28 cd ${BASE}/svn
[204]29 mkdir -p ${TOPDIR}/SOURCES
[530]30 $TOOLHOME/mkebuild ${MINDI_VER} mindi-kernel-${MINDI_VER}/mindi-kernel.ebuild > ${TOPDIR}/ebuild/mindi-kernel.ebuild
31 chmod 644 ${TOPDIR}/ebuild/mindi-kernel.ebuild
32 pkg1="${TOPDIR}/ebuild/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
[423]33 pkg="$pkg $pkg1"
34 rm -f $pkg1
[204]35fi
36if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
37 cd ${BASE}/svn
[530]38 $TOOLHOME/mkebuild ${MINDI_VER} mindi-${MINDI_VER}/distributions/rpm/mindi.ebuild > ${TOPDIR}/ebuild/mindi.ebuild
39 cat mindi-${MINDI_VER}/distributions/$dfam/changelog >> ${TOPDIR}/ebuild/mindi.ebuild
40 chmod 644 ${TOPDIR}/ebuild/mindi.ebuild
[318]41 rm -rf mindi-${MINDI_VER}/distributions
[20]42 mkdir -p ${TOPDIR}/SOURCES
[318]43
[530]44 pkg1="${TOPDIR}/ebuild/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
[423]45 pkg="$pkg $pkg1"
46 rm -f $pkg1
[20]47 # ATTENTION: This could be dangerous for your setup
[204]48 opt="rm -rf /usr/lib/mindi ;"
[20]49fi
50if [ "`echo $c | grep mondo`" != "" ]; then
51 cd ${BASE}/svn
[530]52 $TOOLHOME/mkebuild ${MONDO_VER} mondo-${MONDO_VER}/distributions/rpm/mondo.ebuild > ${TOPDIR}/ebuild/mondo.ebuild
53 cat mondo-${MONDO_VER}/distributions/$dfam/changelog >> ${TOPDIR}/ebuild/mondo.ebuild
54 chmod 644 ${TOPDIR}/ebuild/mondo.ebuild
[318]55 rm -rf mondo-${MONDO_VER}/distributions
56
[530]57 pkg1="${TOPDIR}/ebuild/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
[423]58 pkg="$pkg $pkg1"
59 rm -f $pkg1
[20]60fi
[319]61
[530]62cd ${TOPDIR}/ebuild
[318]63status=0
[204]64if [ "`echo $c | grep kernel`" != "" ]; then
[530]65 echo "Generating mindi-kernel ebuild"
66 log=/tmp/mindi-kernel-ebuild.log
67 rpmbuild -ba mindi-kernel.ebuild 2> $log 1> $log
[318]68 if [ $? != 0 ]; then
69 cat $log
70 status=-1
71 fi
[204]72fi
73if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
[530]74 echo "Generating mindi ebuild"
75 log=/tmp/mindi-ebuild.log
76 rpmbuild -ba mindi.ebuild 2> $log 1> $log
[318]77 if [ $? != 0 ]; then
78 cat $log
79 status=-1
80 fi
[20]81fi
82if [ "`echo $c | grep mondo`" != "" ]; then
[530]83 echo "Generating mondo ebuild"
84 log=/tmp/mondo-ebuild.log
85 rpmbuild -ba mondo.ebuild 2> $log 1> $log
[318]86 if [ $? != 0 ]; then
87 cat $log
88 status=-1
89 fi
[20]90fi
[318]91if [ $status = 0 ]; then
[530]92 echo "Installing ebuild as root ($pkg)"
[318]93 su - -c "$opt rpm -Uvh --force $pkg"
94fi
Note: See TracBrowser for help on using the repository browser.