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