source: projects/vbootstrap/tags/0.0.20/vbuilder.sh.in @ 628

Revision 628, 16.3 KB checked in by munepi, 14 years ago (diff)

updated vbuilder.sh.in: fixed RPM_Build()

Line 
1#!/bin/bash
2# -*- coding: utf-8-unix -*-
3
4Usage_C(){
5    cat<<EOF
6Usage:  $(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {--build|--clean|--build-rpm [src.rpm]|--install-rpm [arch.rpm|package]|--remove-rpm [package]}
7
8Options:
9        --version:              set [version] (default: ${DEFAULT_VERSION})
10        --arch:                 set [arch] (default: $(uname -i))
11        --dist-upgrade:         make VineSeed bootstrap via ${STABLE_VERSION}
12        --unionfs               cover a bootstrap with unionfs
13        --target:               build rpms with [target]
14        --with-compat32:        build rpms with compat32 on boostrap
15
16Actions:
17        --clean:                clean boostrap of [version]
18        --build:                build boostrap of [version]
19        --build-rpm:            build [src.rpm] on boostrap
20        --install-rpm:          install [arch.rpm|package] on boostrap
21        --remove-rpm:           remove [package] on boostrap
22
23For example,
24* make a clean/plain build environment on the current archtecture:
25$(basename $0) --clean --build
26* build rpms from the specified source rpm:
27$(basename $0) --build-rpm [src.rpm]
28* make a plain build environment for Vine Linux 4.2:
29$(basename $0) --version 4.2 --clean --build
30* make a i386 chroot on x86_64:
31$(basename $0) --arch i386 --clean --build
32* build a kernel package with target i686
33$(basename $0) --target i686 --build-rpm [kernel src.rpm]
34* build a compat32 package:
35$(basename $0) --arch i386 --with-compat32 --build-rpm [src.rpm]
36$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*//)
37EOF
38}
39
40Usage_ja(){
41    Usage_C
42}
43
44Msg_MissingParameter_C(){
45    para=$1
46    cat<<EOF
47E: Missing some parameters after ${para}
48EOF
49}
50
51Msg_MissingParameter_ja(){
52    para=$1
53    cat<<EOF
54E: ${para} 以後のいくつかのパラメータに間違いがあります
55EOF
56}
57
58Msg_NoSupportVARCH_C(){
59    cat<<EOF
60E: arch ${VARCH} is NOT supported on $(uname -i)
61EOF
62}
63
64Msg_NoSupportVARCH_ja(){
65    cat<<EOF
66E: ${VARCH} アーキテクチャは $(uname -i) 上で非サポートです
67EOF
68}
69
70Msg_NoSupportVERSION_C(){
71    cat<<EOF
72E: ${VERSION} is NOT supported
73EOF
74}
75
76Msg_NoSupportVERSION_ja(){
77    cat<<EOF
78E: バージョン ${VERSION} は非サポートです
79EOF
80}
81
82Msg_NoSupportDistUpgradeVERSION_C(){
83    cat<<EOF
84E: version ${VERSION} does not support --dist-upgrade option
85EOF
86}
87
88Msg_NoSupportDistUpgradeVERSION_ja(){
89    cat<<EOF
90E: バージョン ${VERSION} では --dist-upgrade オプションはサポートされていません
91EOF
92}
93
94Msg_NoSupportTARGET_C(){
95    cat<<EOF
96E: rpm build target ${TARGET} is NOT supported
97EOF
98}
99
100Msg_NoSupportTARGET_ja(){
101    cat<<EOF
102E: rpm ビルドターゲット ${TARGET} はサポートされていません
103EOF
104}
105
106Msg_NotPackageName_C(){
107    cat<<EOF
108E: $RPM_PKG is not a package name
109EOF
110}
111
112Msg_NotPackageName_ja(){
113    cat<<EOF
114E: $RPM_PKG はパッケージ名でありません
115EOF
116}
117
118Msg_NotSourceRPM_C(){
119    cat<<EOF
120E: $RPM_PKG is not a source RPM package
121EOF
122}
123
124Msg_NotSourceRPM_ja(){
125    cat<<EOF
126E: $RPM_PKG はソース RPM パッケージでありません
127EOF
128}
129
130##############################################################################
131
132check-parameter(){
133    if [ -z "$*" ]; then
134        Usage_$LOCALE
135        return 1
136    fi
137
138    while [ ! -z "$*" ]; do
139        case $1 in
140            --help)
141                Usage_$LOCALE
142                return 1
143                ;;
144            --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
145                shift
146                check-next-parameter $1 || return 1
147                ;;
148            --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
149                ;;
150            *)
151                Msg_MissingParameter_$LOCALE $1
152                return 1
153                ;;
154        esac
155        shift
156    done
157    return 0
158}
159
160check-next-parameter(){
161    arg=$1
162    if [ -z "${arg}" ]; then
163        Msg_MissingParameter_$LOCALE ${arg}
164        return 1
165    fi
166
167    if [ $(echo ${arg} | grep '^-') ]; then
168        Msg_MissingParameter_$LOCALE ${arg}
169        return 1
170    fi
171    return 0
172}
173
174setup-vbuilder(){
175    ## load default settings
176    if [ -r /etc/vbootstrap/vbuilder.conf ]; then
177        . /etc/vbootstrap/vbuilder.conf
178    fi
179    [ -z "${VBOOTSTRAP_DIR}" ] && \
180        VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
181    [ -z "${DEFAULT_VERSION}" ] && \
182        DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
183    [ -z "${BUILT_RPMS_DIR}" ] && \
184        BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
185    [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
186    VERSION=$DEFAULT_VERSION
187
188    ## current stable relase version
189    STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
190
191    ## set locale
192    case $LANG in
193        ja*)  LOCALE=ja ;;
194        *)    LOCALE=C ;;
195    esac
196
197    ## set boolian
198    with_setup_vbootstrap=0
199    with_unionfs=0
200    with_dist_upgrade=0
201}
202
203setup-vbootstrap(){
204    if [ ${with_setup_vbootstrap} -eq 0 ]; then
205        with_setup_vbootstrap=1
206
207        ## check a chroot archtecture
208        if [ ! -z ${VARCH} ]; then
209            case "${VARCH}" in
210                i386|i686|x86_64)
211                    [ "$(uname -i)" = "ppc" ] && \
212                        Msg_NoSupportVARCH_$LOCALE
213                    [ $? -eq 0 ] && exit 1
214                    ;;
215                ppc)
216                    [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
217                        Msg_NoSupportVARCH_$LOCALE
218                    [ $? -eq 0 ] && exit 1
219                    ;;
220            esac
221        fi
222
223        [ -z ${VARCH} ] && VARCH=$(uname -i)
224
225        ##!! 4.2 is NO support on VARCH=x86_64
226        if [ "${VERSION}" = "4.2" -a "${VARCH}" = "x86_64" ]; then
227            Msg_NoSupportVERSION_${LOCALE}
228            exit 1
229        fi
230
231        ## support i386 chroot on x86_64 below:
232        [ "${VARCH}" != "$(uname -i)" ] && VERSION=${VERSION}_${VARCH}
233
234        ## check support ${VERSION}
235        if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
236            Msg_NoSupportVERSION_$LOCALE
237            exit 1
238        fi
239
240        ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
241        if [ $with_dist_upgrade -eq 1 ]; then
242            if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
243                Msg_NoSupportDistUpgradeVERSION_$LOCALE
244                exit 1
245            fi
246        fi
247
248        ## check build target option ${TARGET}
249        if [ ! -z "${TARGET}" ]; then
250            RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
251            if [ -z "$(echo $RPM_TARGET_LIST | grep $TARGET)" ]; then
252                Msg_NoSupportTARGET_$LOCALE
253                exit 1
254            fi
255        fi
256
257    fi
258
259    MAJOR_VERSION=$(echo ${VERSION} | sed -e "s/_i[0-9]86//")
260
261    BUILD_ROOT=${VBOOTSTRAP_DIR}/${VERSION}
262    BUILD_USER=vbuilder
263    BUILD_DIR=/home/${BUILD_USER}/rpm
264    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
265    CACHE_DIR=${VBOOTSTRAP_DIR}/cache/${VERSION}/apt/archives
266    UNIONFS_DIR=${VBOOTSTRAP_DIR}/unionfs/${VERSION}
267
268    __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c"
269
270    mkdir -p $VBOOTSTRAP_DIR
271}
272
273setup-vbootstrap-rpm(){
274    setup-vbootstrap
275
276    ## check ${BUILD_ROOT}
277    [ -d ${BUILD_ROOT} ] || Build
278
279    DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
280
281    if [ -f $RPM_PKG ]; then
282        BASE_RPM_PKG=$(basename $RPM_PKG)
283        cp -f $RPM_PKG $BUILD_ROOT${BUILD_DIR}
284    else
285        BASE_RPM_PKG=$RPM_PKG   
286    fi
287}
288
289## recover apt-get data on host/chroot
290apt-get-update(){
291    case $1 in
292        --host)
293            echo -n "apt-get update on host ... "
294            apt-get -qq update > /dev/null 2>&1
295            echo "done."
296            ;;
297        --chroot)
298            echo -n "apt-get update on chroot ... "
299            $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
300            echo "done."
301            ;;
302        *)
303            echo apt-get-update: unknown option $1
304            exit 1
305            ;;
306    esac
307}
308
309## mount-chroot {|--umount} [file system|name]
310## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
311## support name: vfs chache_dir
312## NOTE: /tmp needs for applications which use X
313##       vfs is virtual file systems
314##       cache_dir is ${CACHE_DIR} to ${ARCHIVES_DIR}
315mount-chroot(){
316    if [ "$1" = "--umount" ]; then
317        mount-chroot-umount $2 || return 1
318    else
319        mount-chroot-mount $1 || return 1
320    fi
321    return 0
322}
323
324## mount-chroot-umount [file system|name]
325mount-chroot-umount(){
326    local fs=$1
327    case $fs in
328        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
329            [ -d ${BUILD_ROOT}${fs} ] || return 1
330            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
331                umount ${BUILD_ROOT}${fs}
332            return 0
333            ;;
334        vfs)
335            # for dir in /sys /proc /dev/shm /dev/pts /dev; do
336            #   mount-chroot-umount ${dir} || return 1
337            # done
338            [ -d ${BUILD_ROOT}/proc ] || return 1
339            [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
340                umount ${BUILD_ROOT}/proc
341            return 0
342            ;;
343        cache_dir)
344            [ -d ${ARCHIVES_DIR} ] || return 1
345            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
346                umount ${ARCHIVES_DIR}
347            return 0
348            ;;
349        unionfs_dir)
350            [ -d ${BUILD_ROOT} ] || return 1
351            [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
352                umount ${BUILD_ROOT}
353            if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
354                echo "Retry lazy unmount ... "
355                umount -l ${BUILD_ROOT}
356                echo "done."
357            fi
358            return 0
359            ;;
360        *)
361            echo mount-chroot-umount: unknown file system $fs
362            exit 1
363            ;;
364    esac
365}
366
367## mount-chroot-mount [file system|name]
368mount-chroot-mount(){
369    local fs=$1
370    local mnt_opts=""
371
372    case $fs in
373        /home)
374            mnt_opts="-o rbind"
375            ;;
376        *)
377            mnt_opts="--bind"
378            ;;
379    esac
380
381    case $fs in
382        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
383            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
384            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
385                mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
386            return 0
387            ;;
388        vfs)
389            # for dir in /dev /dev/pts /dev/shm /proc /sys; do
390            #   mount-chroot-mount ${dir} || return 1
391            # done
392            mount-chroot-mount /proc || return 1
393            return 0
394            ;;
395        cache_dir)
396            [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR}
397            [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
398            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
399                mount ${mnt_opts} ${CACHE_DIR} ${ARCHIVES_DIR}
400            [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
401            return 0
402            ;;
403        unionfs_dir)
404            if [ $with_unionfs -eq 1 ]; then
405                [ -d ${UNIONFS_DIR} ] || mkdir -p ${UNIONFS_DIR}
406                [ -z "$(mount | grep ${BUILD_ROOT})" ] && \
407                    mount -t unionfs -o dirs=${UNIONFS_DIR}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
408                unionctl ${BUILD_ROOT} --list
409            fi
410            return 0
411            ;;
412        *)
413            echo mount-chroot-mount: unknown file system $fs
414            exit 1
415            ;;
416    esac
417   
418}
419
420
421##############################################################################
422
423Clean(){
424    setup-vbootstrap
425
426    # mount-chroot --umount /home
427    # mount-chroot --umount /tmp
428    mount-chroot --umount vfs
429    mount-chroot --umount cache_dir
430    mount-chroot --umount unionfs_dir
431    apt-get-update --host
432
433    if [ $with_unionfs -eq 1 ]; then
434        if [ -d ${UNIONFS_DIR} ]; then
435            echo -n "Cleaning build root \"${UNIONFS_DIR}\" via unionfs ... "
436            rm -rf ${UNIONFS_DIR}
437            echo "done."
438        fi
439    else
440        if [ -d ${BUILD_ROOT} ]; then
441            echo -n "Cleaning build root \"${BUILD_ROOT}\" ... "
442            rm -rf ${BUILD_ROOT}
443            echo "done."
444        fi
445    fi
446
447    echo "Cleanup a build farm for ${VERSION} done."
448}
449
450Build(){
451    setup-vbootstrap
452
453    if [ $with_dist_upgrade -eq 1 ]; then
454        ## make bootstrap of ${STABLE_VERSION}
455        /usr/sbin/vbootstrap \
456            $(echo ${VERSION} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
457            ${BUILD_ROOT}
458
459        ## aim apt-line to VineSeed
460        sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
461            ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
462    else
463        /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
464    fi
465
466    mount-chroot cache_dir
467    mount-chroot vfs
468    # mount-chroot /tmp
469    # mount-chroot /home
470
471    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
472
473    ##!! 4.2 has no apt-sourceslist-{plus,nonfree} packages
474    if [ "${MAJOR_VERSION}" != "4.2" ]; then
475        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
476        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
477    fi
478
479    if [ $with_dist_upgrade -eq 1 ]; then
480        $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
481    fi
482    $__chroot_sh 'apt-get -qq -y install build-essential'
483    $__chroot_sh 'apt-get -qq -y install self-build-setup'
484
485    $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
486
487    $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
488    $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
489    $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
490
491    $__chroot_sh '/usr/sbin/pwconv'
492    $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
493
494    ##!! for rpm-4.8.0 or higher
495    ##!! (See http://trac.vinelinux.org/wiki/Vine6/AboutUpdateToolchain)
496    if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" = "VineSeed" ]; then
497        $__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
498    fi
499
500    # mount-chroot --umount /home
501    # mount-chroot --umount /tmp
502    mount-chroot --umount vfs
503    mount-chroot --umount cache_dir
504    apt-get-update --host
505
506    echo "Making a build farm for ${VERSION} done."
507}
508
509RPM_Remove(){
510    setup-vbootstrap-rpm
511    mount-chroot unionfs_dir
512    mount-chroot cache_dir
513    mount-chroot vfs
514    apt-get-update --chroot
515
516    if [ -f $RPM_PKG ]; then
517        Msg_NotPackageName_$LOCALE
518        exit 1
519    fi
520    $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
521
522    mount-chroot --umount vfs
523    mount-chroot --umount cache_dir
524    mount-chroot --umount unionfs_dir
525    apt-get-update --host
526}
527
528RPM_Install(){
529    setup-vbootstrap-rpm
530    mount-chroot unionfs_dir
531    mount-chroot cache_dir
532    mount-chroot vfs
533    apt-get-update --chroot
534
535    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
536
537    mount-chroot --umount vfs
538    mount-chroot --umount cache_dir
539    mount-chroot --umount unionfs_dir
540    apt-get-update --host
541}
542
543RPM_Build(){
544    setup-vbootstrap-rpm
545    mount-chroot unionfs_dir
546    mount-chroot cache_dir
547    mount-chroot vfs
548    apt-get-update --chroot
549
550    if [ ! -f $RPM_PKG ]; then
551        Msg_NotSourceRPM_$LOCALE
552        exit 1
553    fi
554   
555    RPM_PKG_USER=$(stat -c %U $RPM_PKG)
556    RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
557    [ ! -z "${SUDO_UID}" ] && RPM_PKG_USER=${SUDO_UID}
558    [ ! -z "${SUDO_GID}" ] && RPM_PKG_GROUP=${SUDO_GID}
559    local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
560    RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
561    [ -z "${TARGET}" ] || \
562        RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
563
564    ## make src.rpm for $VERSION
565    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
566    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild -bs --nodeps --clean --rmsource --rmspec ${BUILD_DIR}/SPECS/*.spec'"
567
568
569    ## change ${DIST_RELEASE}
570    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl\([0-9]*\)\./vl${DIST_RELEASE}\./")
571
572    ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
573    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -y build-dep $BASE_RPM_PKG"
574    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
575    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $(find $BUILD_ROOT${BUILD_DIR}/RPMS -type f -regex '.*\.rpm' | sed -e s@${BUILD_ROOT}@@g -e 's|.*\/compat32-.*||g' -e 's|.*\/.*\.src\.rpm||g' -e 's/$/ \\/g')"
576
577    ## copy built rpms to ${HOME}/rpm/ for each archtectures
578    echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
579    for i in $RPM_PKG_ARCH_LIST; do \
580        if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
581            if [ ! -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ]; then
582                $__install -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/
583                chown -R ${RPM_PKG_USER}:${RPM_PKG_GROUP} ${BUILT_RPMS_DIR}
584            fi
585            find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
586                -exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/ \;
587        fi
588    done
589
590    mount-chroot --umount vfs
591    mount-chroot --umount cache_dir
592    mount-chroot --umount unionfs_dir
593    apt-get-update --host
594
595    echo "done."
596}
597
598
599##############################################################################
600
601setup-vbuilder
602
603check-parameter $* || exit 1
604
605while [ $# -gt 0 ]; do
606    tmpARG=$1
607    case $tmpARG in
608        --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
609            shift
610            ;;
611        --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
612            ;;
613        *)
614            echo unknown option $1
615            exit 1
616            ;;
617    esac
618
619    case $tmpARG in
620        --version)
621            VERSION=$1
622            ;;
623        --arch)
624            VARCH=$1
625            ;;
626        --dist-upgrade)
627            with_dist_upgrade=1
628            ;;
629        --unionfs)
630            with_unionfs=1
631            ;;
632        --target)
633            TARGET=$1
634            RPM_OPTS="${RPM_OPTS} --target $TARGET"
635            ;;
636        --with-compat32)
637            RPM_OPTS="${RPM_OPTS} --with compat32"
638            ;;
639        --build-rpm)
640            RPM_PKG=$1
641            RPM_Build || exit 1
642            ;;
643        --install-rpm)
644            RPM_PKG=$1
645            RPM_Install || exit 1
646            ;;
647        --remove-rpm)
648            RPM_PKG=$1
649            RPM_Remove || exit 1
650            ;;
651        --build)
652            Build
653            ;;
654        --clean)
655            Clean
656            ;;
657    esac
658    shift
659done
660
661exit
Note: See TracBrowser for help on using the repository browser.