source: projects/vbootstrap/trunk/vbuilder.sh.in @ 6378

Revision 6378, 30.4 KB checked in by daisuke, 12 years ago (diff)

fix typo..

RevLine 
[118]1#!/bin/bash
2# -*- coding: utf-8-unix -*-
3
[2522]4TEXTDOMAIN=vbootstrap
5TEXTDOMAINDIR=/usr/share/locale
6
[2516]7Usage(){
[118]8    cat<<EOF
[3675]9$(basename $0) @@VBUILDER_VERSION@@ $(echo $([ -z "@@VBUILDER_REVISION@@" ] || echo "(r@@VBUILDER_REVISION@@)"))
[5510]10Usage:  $(basename $0) {--profile [profile]} {--version [version]} {--arch [arch]} {--category [categories]} {--fetch-url [fetch_url]} {--dist-upgrade} {--target [target]} {--no-build-essential} {--with-compat32} {--rpmbuild-define [macro_expr]} {--rpmbuild-with [bcond_with]} {--rpmbuild-without [bcond_with]} {--sign} {--no-install} {--debug} {--help} {--bootstrap-dir [directory]} {--unionfs-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]}
[4076]11EOF
[411]12
[4076]13    echo $"
[411]14Options:
[5364]15        --profile:              set a profile
[5450]16        --version:              set [version] (default: ${VERSION})
[2718]17        --arch:                 set [arch] (default: ${UARCH})
[791]18        --category:             set [categories] (default: ${CATEGORIES})
[5364]19        --fetch-url:            set [fetch_url] to fetch packages (default: ${VBOOTSTRAP_FETCH_URL})
[412]20        --dist-upgrade:         make VineSeed bootstrap via ${STABLE_VERSION}
[791]21        --unionfs:              cover a bootstrap with unionfs
[406]22        --target:               build rpms with [target]
[5508]23        --no-build-essential:   do not install build-essential
[3850]24        --with-compat32:        build rpms with compat32 on bootstrap
[2531]25        --rpmbuild-define:      give a option --define [macro_expr] to rpmbuild
[1476]26        --rpmbuild-with:        give a option --with [bcond_with] to rpmbuild
[2531]27        --rpmbuild-without:     give a option --without [bcond_with] to rpmbuild
[1240]28        --sign:                 sign built rpms
[1267]29        --no-install:           build only a source rpm - do NOT install a built rpm
[2718]30        --login:                login in chroot as root user
[709]31        --bootstrap-dir:        set a bootstrap directory (default: ${VBOOTSTRAP_DIR})
[2711]32        --unionfs-dir:          set a directory to store unionfs images of vbootstrap (default: ${UNIONFS_DIR})
[725]33        --cache-dir:            set a directory to cache rpms (default: ${CACHE_DIR})
[709]34        --built-rpms-dir:       set a directory to store built rpms in chroot (default: ${BUILT_RPMS_DIR})
[2718]35        --debug:                enable debug mode
36        --help:                 show this help
[4076]37"
[411]38
[4076]39    echo $"
[411]40Actions:
[3850]41        clean:                  clean the bootstrap of [version]
42        build:                  build a bootstrap of [version]
[5367]43        build-rpm:              build [src.rpm] on a bootstrap
[3850]44        install-rpm:            install [arch.rpm|package] on a bootstrap
45        remove-rpm:             remove [package] on a bootstrap
[4076]46"
[118]47
[4076]48    echo $"
[3968]49Examples:
[304]50* make a clean/plain build environment on the current archtecture:
[802]51$(basename $0) clean build
[470]52* build rpms from the specified source rpm:
[802]53$(basename $0) build-rpm [src.rpm]
[3676]54* make a plain build environment for Vine Linux 5.2:
55$(basename $0) --version 5.2 clean build
[304]56* make a i386 chroot on x86_64:
[802]57$(basename $0) --arch i386 clean build
58* build a kernel package with target i686:
59$(basename $0) --target i686 build-rpm [kernel src.rpm]
[406]60* build a compat32 package:
[802]61$(basename $0) --arch i386 --with-compat32 build-rpm [src.rpm]
[4076]62"
63    /usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*//
[5364]64## TODO: output supported profiles and their names/comments
[118]65}
66
[323]67##############################################################################
68
[5364]69initialize-variables(){
70    ## set boolian variables
71    with_profile=0
72    with_setup_vbootstrap=0
73    with_dist_upgrade=0
74    with_unionfs=0
75    with_sign=0
76    with_no_install=0
77    with_login=0
78    with_debug=0
79    with_actions=0
80    with_ix86_on_x86_64=0
81    with_category_main=0
82    with_category_plus=0
83    with_category_nonfree=0
84    with_category_test=0
85    with_category_proposed_updates=0
86    with_category_security=0
[5508]87    with_build_essential=1
[5364]88
89    return 0
90}
91
[416]92check-parameter(){
[2516]93    [ -z "$*" ] && Usage && return 1
[416]94
95    while [ ! -z "$*" ]; do
96        case $1 in
[725]97            --help|help)
[5367]98                setup-vbuilder ||:
[2516]99                Usage
[517]100                return 1
[516]101                ;;
[5364]102            --profile)
103                shift
104                with_profile=1
105                PROFILE=$1
106                check-next-parameter $1 || return 1
107                ;;
108            --version|--arch|--category|--fetch-url|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
[725]109                [ $with_actions -eq 1 ] && \
[2516]110                    echo $"E: You can give no more options after actions" && \
111                    return 1
[416]112                shift
113                check-next-parameter $1 || return 1
114                ;;
[5508]115            --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install|--login|--no-build-essential|--debug)
[725]116                [ $with_actions -eq 1 ] && \
[2516]117                    echo $"E: You can give no more options after actions" && \
118                    return 1
[416]119                ;;
[725]120            --build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
121                with_actions=1
122                shift
123                check-next-parameter $1 || return 1
124                ;;
[3675]125            --build|build|--clean|clean)
[725]126                with_actions=1
127                ;;
[416]128            *)
[2516]129                echo $"E: Missing some parameters after $1"
[416]130                return 1
131                ;;
132        esac
133        shift
134    done
[725]135
[2516]136    [ $with_actions -eq 0 ] && \
137        echo $"E: You must give at least one action" && return 1
[725]138
[416]139    return 0
140}
141
[412]142check-next-parameter(){
[2516]143    [ -z "$1" ] && echo $"E: Missing some parameters after $1" && return 1
[416]144
[2516]145    [ $(echo $1 | grep '^-') ] && \
146        echo $"E: Missing some parameters after $1" && return 1
[725]147
[412]148    return 0
149}
150
[5364]151## NOTE: setup-vbuilder() loads
152##  - system wide configurations (from /etc/vbootstrap/vbuilder.conf)
153##  - given profile (from /etc/vbootstrap/profile.d/*.conf)
154##  - given command-line parameters
155## where given command-line parameters override the settings given profile,
156## and the settings given profile override system wide settings.
157## If you use a profile of vbuilder, you may not override the settings
158## given profile.
[323]159setup-vbuilder(){
[3343]160    ## check $SUDO_USER and $USERHELPER_UID
161    RPM_SIGN_USER=$SUDO_USER
162    if [ -z "${RPM_SIGN_USER}" ]; then
[3967]163        [ -z "${USERHELPER_UID}" ] && \
164            echo $"W: \$SUDO_USER and \$USERHELPER_UID are empty" && \
165            return 1
166           
[3352]167        RPM_SIGN_USER=$(getent passwd $USERHELPER_UID | cut -d":" -f1)
[3343]168    fi
169    ## get $RPM_SIGN_USER's home directory
170    HOME=$(getent passwd $RPM_SIGN_USER |  cut -d":" -f6)
171
[323]172    ## load default settings
[725]173    VBUILDER_CONF=/etc/vbootstrap/vbuilder.conf
174    if [ -r $VBUILDER_CONF ]; then
175        . $VBUILDER_CONF
[1240]176        [ $? -eq 1 ] && return 1
[323]177    fi
[791]178    [ -z "${CATEGORIES}" ] && \
179        CATEGORIES=@@VBUILDER_CATEGORIES@@
[5364]180    [ -z "${VBOOTSTRAP_FETCH_URL}" ] && \
181        VBOOTSTRAP_FETCH_URL=@@VBUILDER_VBOOTSTRAP_FETCH_URL@@
[330]182    [ -z "${VBOOTSTRAP_DIR}" ] && \
183        VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
[2711]184    [ -z "${UNIONFS_DIR}" ] && \
185        UNIONFS_DIR=@@VBUILDER_UNIONFS_DIR@@
[725]186    [ -z "${CACHE_DIR}" ] && \
187        CACHE_DIR=@@VBUILDER_CACHE_DIR@@
[370]188    [ -z "${BUILT_RPMS_DIR}" ] && \
189        BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
[709]190
[5368]191    ## set default version for vbootstrap
192    VERSION=@@VBUILDER_DEFAULT_VERSION@@
193
[5364]194    ## load profile
195    if [ ${with_profile} -eq 1 ]; then
196        [ ! -r /etc/vbootstrap/profile.d/${PROFILE}.conf ] && \
197            echo $"E: No such profile found: ${PROFILE}" && return 1
198
199        . /etc/vbootstrap/profile.d/${PROFILE}.conf
200        [ $? -eq 1 ] && return 1
201    fi
202
[709]203    ## set current stable relase version
[411]204    STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
205
[3676]206    ## set default chroot archtecture
207    UARCH=$(uname -i)
208    case "${UARCH}" in
209        arm*)
210            UARCH="arm"
211            ;;
212    esac
213
[1240]214    return 0
[323]215}
216
[118]217setup-vbootstrap(){
[411]218    if [ ${with_setup_vbootstrap} -eq 0 ]; then
219        with_setup_vbootstrap=1
[118]220
[2718]221        ## check debug mode
222        [ ${with_debug} -eq 1 ] && \
[3675]223            cat $VBUILDER_CONF && \
[2718]224            set && set -x
225
[725]226        ## check some directories
227        ## Note: create $BUILT_RPMS_DIR in RPM_Build()
[709]228        [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
[725]229        [ -d $CACHE_DIR ] || mkdir -p $CACHE_DIR
[709]230
[3676]231        ## check chroot version
232        case ${VERSION} in
[4072]233            4.2|5.2|6.0|VineSeed)
[2718]234                ;;
[3676]235            *)
236                echo $"E: ${VERSION} is NOT supported"
237                return 1
238                ;;
[2718]239        esac
240
241        case "${VARCH}" in
242            arm*)
243                VARCH="arm"
244                ;;
245        esac
246
[304]247        ## check a chroot archtecture
[725]248        if [ -z ${VARCH} ]; then
[2718]249            VARCH=${UARCH}
[725]250        else
[304]251            case "${VARCH}" in
[3676]252                i386|x86_64)
253                    [ "${UARCH}" = "ppc" -o "${UARCH}" = "arm" ] && \
254                        echo $"E: arch ${VARCH} is NOT supported on ${UARCH}" && return 1
[304]255                    ;;
256                ppc)
[3676]257                    [ "${UARCH}" = "i386" -o "${UARCH}" = "x86_64" -o "${UARCH}" = "arm" ] && \
258                        echo $"E: arch ${VARCH} is NOT supported on ${UARCH}" && return 1
[304]259                    ;;
[2718]260                arm)
[3676]261                    [ "${UARCH}" = "i386" -o "${UARCH}" = "x86_64" -o "${UARCH}" = "ppc" ] && \
[2718]262                        echo $"E: arch ${VARCH} is NOT supported on ${UARCH}" && return 1
263                    ;;
[304]264            esac
[323]265        fi
266
[3676]267        ##!! 4.2 is NO support on VARCH=x86_64 or VARCH=arch
268        if [ "${VERSION}" = "4.2" ]; then
269            if [ "${VARCH}" = "x86_64" -o "${VARCH}" = "arm" ]; then
270                echo $"E: ${VERSION}_${VARCH} is NOT supported"
271                return 1
272            fi
[323]273        fi
274
[5364]275        ## set base profile <version>_<arch>
276        BASE_PROFILE=${VERSION}_${VARCH}
[2718]277
[5364]278        ## check support ${BASE_PROFILE}
279        if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${BASE_PROFILE})" ]; then
280            echo $"E: ${BASE_PROFILE} is NOT supported"
[2516]281            return 1
[323]282        fi
283
[411]284        ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
285        if [ $with_dist_upgrade -eq 1 ]; then
[3676]286            if [ "${VERSION}" != "VineSeed" ]; then
[2516]287                echo $"E: version ${VERSION} does not support --dist-upgrade option"
288                return 1
[411]289            fi
290        fi
291
[3676]292        ## support i386 chroot on x86_64 below:
293        [ "${UARCH}" = "x86_64" -a "${VARCH}" = "i386" ] && \
294            with_ix86_on_x86_64=1
[791]295
296        ## check apt categories
[800]297        ## "main" category is unconditionally permited
[791]298        with_category_main=1
299        for cat in $(echo ${CATEGORIES} | sed -e "s/,/ /"g); do
300            case $cat in
301                main)
302                    with_category_main=1
303                    ;;
304                plus)
305                    with_category_plus=1
306                    ;;
307                nonfree)
308                    with_category_nonfree=1
309                    ;;
[800]310                test)
311                    ## "test" category only exists in VineSeed
[3676]312                    [ "${VERSION}" = "VineSeed" ] || \
[2516]313                        echo $"E: No such category exists: $cat" && return 1
[800]314                    with_category_test=1
315                    ;;
[791]316                proposed-updates)
[800]317                    ##!! "proposed-updates" category does not exist in 4.2
[3676]318                    [ "${VERSION}" = "4.2" ] && \
[2516]319                        echo $"E: No such category exists: $cat" && return 1
[791]320
321                    with_category_proposed_updates=1
322                    ;;
[800]323                security)
324                    ## "security" category does not exist in VineSeed
[3676]325                    [ "${VERSION}" = "VineSeed" ] && \
[2516]326                        echo $"E: No such category exists: $cat" && return 1
[800]327                    with_category_security=1
328                    ;;
[791]329                *)
[2516]330                    echo $"E: No such category exists: $cat" && return 1
[791]331                    ;;
332            esac
333        done
334
[406]335        ## check build target option ${TARGET}
[407]336        if [ ! -z "${TARGET}" ]; then
337            RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
[3742]338            RPM_TARGET_LIST="${RPM_TARGET_LIST} noarch"
339            if [ -z "$(echo ${RPM_TARGET_LIST} | grep ${TARGET})" ]; then
[2516]340                echo $"E: rpm build target ${TARGET} is NOT supported"
341                return 1
[407]342            fi
[406]343        fi
344
[1240]345        ## set ${RPM_PKG_ARCH_LIST}
[5364]346        RPM_PKG_ARCH_LIST=" \
347            RPMS/i386 RPMS/i486 RPMS/i586 RPMS/i686 RPMS/x86_64 RPMS/ppc \
348            RPMS/noarch \
349            RPMS/armv3l RPMS/armv4l RPMS/armv4tl \
350            RPMS/armv5tejl RPMS/armv5tel RPMS/armv6l RPMS/armv7l \
351            SRPMS"
[1240]352        [ -z "${TARGET}" ] || \
353            RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
354
[135]355    fi
[323]356
[1240]357    ## set global variables
[296]358    BUILD_USER=vbuilder
359    BUILD_DIR=/home/${BUILD_USER}/rpm
[5364]360    if [ ${with_profile} -eq 1 ]; then
361        BUILD_ROOT=${VBOOTSTRAP_DIR}/${PROFILE}
362        UNIONFS_ROOT=${UNIONFS_DIR}/${PROFILE}
363    else
364        BUILD_ROOT=${VBOOTSTRAP_DIR}/${BASE_PROFILE}
365        UNIONFS_ROOT=${UNIONFS_DIR}/${BASE_PROFILE}
366    fi
[452]367    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
[5364]368    EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${BASE_PROFILE}/apt/archives
[135]369
[2468]370    __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c -l"
[453]371
[135]372    mkdir -p $VBOOTSTRAP_DIR
[1240]373
374    return 0
[118]375}
376
[412]377setup-vbootstrap-rpm(){
[1240]378    setup-vbootstrap || return 1
[412]379
380    ## check ${BUILD_ROOT}
381    [ -d ${BUILD_ROOT} ] || Build
[2324]382    ## setarch ix86 if ix86 chroot on x86_64 host
383    [ $with_ix86_on_x86_64 -eq 1 ] && \
[2468]384        __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} setarch ${VARCH} /bin/sh -c -l"
[412]385
386    DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
387
388    if [ -f $RPM_PKG ]; then
389        BASE_RPM_PKG=$(basename $RPM_PKG)
390        cp -f $RPM_PKG $BUILD_ROOT${BUILD_DIR}
391    else
392        BASE_RPM_PKG=$RPM_PKG   
393    fi
[1240]394
395    return 0
[412]396}
397
[413]398## recover apt-get data on host/chroot
399apt-get-update(){
400    case $1 in
401        --host)
[2522]402            echo -n $"apt-get update on host ... "
[464]403            apt-get -qq update > /dev/null 2>&1
[2522]404            echo $"done."
[413]405            ;;
406        --chroot)
[2522]407            echo -n $"apt-get update on chroot ... "
[464]408            $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
[2522]409            echo $"done."
[413]410            ;;
411        *)
412            echo apt-get-update: unknown option $1
413            exit 1
414            ;;
415    esac
416}
417
[454]418## mount-chroot {|--umount} [file system|name]
419## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
[2654]420## support names: vfs archives_dir
[454]421## NOTE: /tmp needs for applications which use X
422##       vfs is virtual file systems
[851]423##       archives_dir uses to mount ${EXTERNAL_ARCHIVES_DIR} to ${ARCHIVES_DIR}
424##       unionfs_dir covers ${BUILD_ROOT} with unionfs
[454]425mount-chroot(){
[412]426    if [ "$1" = "--umount" ]; then
[454]427        mount-chroot-umount $2 || return 1
[412]428    else
[454]429        mount-chroot-mount $1 || return 1
[412]430    fi
[454]431    return 0
[412]432}
433
[454]434## mount-chroot-umount [file system|name]
435mount-chroot-umount(){
436    local fs=$1
437    case $fs in
438        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
439            [ -d ${BUILD_ROOT}${fs} ] || return 1
440            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
441                umount ${BUILD_ROOT}${fs}
[2654]442            if [ ! -z "$(mount | grep ${BUILD_ROOT}${fs})" ]; then
443                echo $"Retry lazy unmount ${BUILD_ROOT}${fs} ... "
444                umount -l ${BUILD_ROOT}${fs}
445                echo $"done."
446            fi
[454]447            ;;
448        vfs)
[2718]449            for dir in /sys /proc /dev/shm /dev/pts /dev; do
450                mount-chroot-umount ${dir} || return 1
451            done
[454]452            ;;
[725]453        archives_dir)
[454]454            [ -d ${ARCHIVES_DIR} ] || return 1
455            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
456                umount ${ARCHIVES_DIR}
457            ;;
[485]458        unionfs_dir)
459            [ -d ${BUILD_ROOT} ] || return 1
[5513]460            [ -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs)')" ] || \
[485]461                umount ${BUILD_ROOT}
[5513]462            if [ ! -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs)')" ]; then
[2654]463                echo $"Retry lazy unmount ${BUILD_ROOT} ... "
[485]464                umount -l ${BUILD_ROOT}
[2522]465                echo $"done."
[485]466            fi
467            ;;
[454]468        *)
469            echo mount-chroot-umount: unknown file system $fs
470            exit 1
471            ;;
472    esac
[1240]473    return 0
[412]474}
475
[454]476## mount-chroot-mount [file system|name]
477mount-chroot-mount(){
478    local fs=$1
[412]479
[454]480    case $fs in
481        /home)
[2718]482            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
483            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
484                mount -o _netdev,rbind ${fs} ${BUILD_ROOT}${fs}
[454]485            ;;
[2718]486        /tmp|/dev)
487            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
488            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
489                mount --bind -o _netdev ${fs} ${BUILD_ROOT}${fs}
[454]490            ;;
[2718]491        /sys)
[454]492            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
493            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
[2718]494                mount -o _netdev -t sysfs vbuildersysfs ${BUILD_ROOT}${fs}
[454]495            ;;
[2718]496        /proc)
497            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
498            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
499                mount -o _netdev -t proc vbuilderproc ${BUILD_ROOT}${fs}
500            ;;
501        /dev/shm)
502            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
503            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
504                mount -o _netdev -t tmpfs vbuildertmpfs ${BUILD_ROOT}${fs}
505            ;;
506        /dev/pts)
507            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
508            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
509                mount -o gid=5,mode=620,_netdev -t devpts vbuilderdevpts ${BUILD_ROOT}${fs}
510            ;;
[454]511        vfs)
[2718]512            for dir in /dev /dev/pts /dev/shm /proc /sys; do
513                mount-chroot-mount ${dir} || return 1
514            done
[454]515            ;;
[725]516        archives_dir)
517            [ -d ${EXTERNAL_ARCHIVES_DIR} ] || mkdir -p ${EXTERNAL_ARCHIVES_DIR}
[454]518            [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
519            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
[2718]520                mount --bind -o _netdev ${EXTERNAL_ARCHIVES_DIR} ${ARCHIVES_DIR}
[454]521            [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
522            ;;
[485]523        unionfs_dir)
524            if [ $with_unionfs -eq 1 ]; then
[2711]525                [ -d ${UNIONFS_ROOT} ] || mkdir -p ${UNIONFS_ROOT}
[6376]526                /sbin/modprobe aufs >& /dev/null ||:
[6378]527                if ( grep -q aufs /proc/filesystems ) ; then
[5504]528                    [ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
529                        mount -t aufs -o br=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro aufs ${BUILD_ROOT}
530                else
531                    [ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
532                        mount -t unionfs -o dirs=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
533                    unionctl ${BUILD_ROOT} --list
534                fi
[485]535            fi
536            ;;
[455]537        *)
538            echo mount-chroot-mount: unknown file system $fs
539            exit 1
540            ;;
[454]541    esac
[1240]542    return 0
[452]543}
[412]544
[5364]545## TODO: support spec-validator
546## spec-validator [spec file]
547spec-validator(){
548    echo
549    return 0
550}
[791]551
[5364]552
[118]553##############################################################################
554
555Clean(){
[1240]556    setup-vbootstrap || return 1
[118]557
[454]558    # mount-chroot --umount /home
[2718]559    mount-chroot --umount /tmp
560    mount-chroot --umount /dev/shm
561    mount-chroot --umount /dev/pts
[3021]562    mount-chroot --umount /proc
[725]563    mount-chroot --umount archives_dir
[485]564    mount-chroot --umount unionfs_dir
[413]565    apt-get-update --host
[406]566
[2770]567    ## We remark that we first remove /, and secondly remove /.
[2769]568    ## If we directly remove /, we obtained some non-empty directories:
569    ##   /dev/.udev/rules.d.
[485]570    if [ $with_unionfs -eq 1 ]; then
[2711]571        if [ -d ${UNIONFS_ROOT} ]; then
572            echo -n $"Cleaning build root ${UNIONFS_ROOT} via unionfs ... "
[2770]573            rm -rf ${UNIONFS_ROOT} 2>/dev/null
[2711]574            rm -rf ${UNIONFS_ROOT}
[2522]575            echo $"done."
[485]576        fi
577    else
578        if [ -d ${BUILD_ROOT} ]; then
[2522]579            echo -n $"Cleaning build root ${BUILD_ROOT} ... "
[2770]580            rm -rf ${BUILD_ROOT} 2>/dev/null
[485]581            rm -rf ${BUILD_ROOT}
[2522]582            echo $"done."
[485]583        fi
[323]584    fi
[412]585
[5364]586    echo $"Cleanup a build farm for ${BUILD_ROOT} done."
[1240]587    return 0
[118]588}
589
590Build(){
[1240]591    setup-vbootstrap || return 1
[118]592
[411]593    if [ $with_dist_upgrade -eq 1 ]; then
594        ## make bootstrap of ${STABLE_VERSION}
595        /usr/sbin/vbootstrap \
[5364]596            $(echo ${BASE_PROFILE} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
[5442]597            ${VBOOTSTRAP_FETCH_URL} ${BUILD_ROOT} 2>&1 | \
598            egrep -v -e '^W: Duplicate sources.list entry' \
599                     -e '^W: .*apt-get update'
[118]600
[411]601        ## aim apt-line to VineSeed
602        sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
603            ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
604    else
[5442]605        /usr/sbin/vbootstrap \
606            ${BASE_PROFILE} ${VBOOTSTRAP_FETCH_URL} ${BUILD_ROOT} 2>&1 | \
607            egrep -v -e '^W: Duplicate sources.list entry' \
608                     -e '^W: .*apt-get update'
[411]609    fi
610
[2718]611    mount-chroot /proc
[725]612    mount-chroot archives_dir
[2718]613    mount-chroot /dev/pts
614    mount-chroot /dev/shm
[454]615    # mount-chroot /tmp
616    # mount-chroot /home
[118]617
[791]618    ##!! 4.2 has no apt-sourceslist-{plus,nonfree,proposed-updates} packages
[3676]619    case ${VERSION} in
[791]620        4.2)
[5364]621            sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list
622            sed -i -e 's/main plus updates nonfree *$/$(echo ${CATEGORIES} | sed -e "s/,/ /"g) updates/g' ${BUILD_ROOT}/etc/apt/sources.list
623            $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
[800]624            # [ $with_category_security -eq 1 ] && \
625            #   echo
[791]626            ;;
[4530]627        5.2|@@VBUILDER_STABLE_VERSION@@)
[5364]628            sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
629            $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
[791]630            [ $with_category_plus -eq 1 ] && \
[5364]631                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus' && \
632                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/plus.list
[791]633            [ $with_category_nonfree -eq 1 ] && \
[5364]634                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree' && \
635                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/nonfree.list
[791]636            [ $with_category_proposed_updates -eq 1 ] && \
[5364]637                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-proposed-updates' && \
638                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/proposed-updates.list
[800]639            # [ $with_category_security -eq 1 ] && \
640            #   echo
[791]641            ;;
642        VineSeed)
[5364]643            sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
644            $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
[791]645            [ $with_category_plus -eq 1 ] && \
[5364]646                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus' && \
647                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/plus.list
[791]648            [ $with_category_nonfree -eq 1 ] && \
[5364]649                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree' && \
650                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/nonfree.list
[800]651            [ $with_category_test -eq 1 ] && \
[5364]652                $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-test' && \
653                sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/test.list
[791]654            ;;
655    esac
[423]656
[791]657    [ $with_dist_upgrade -eq 1 ] && \
[464]658        $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
[791]659
[5508]660    [ $with_build_essential -eq 1 ] && \
661        $__chroot_sh 'apt-get -qq -y install build-essential'
662
[464]663    $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
[118]664
[2662]665    $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
[2718]666    $__chroot_sh 'cd /dev && /sbin/MAKEDEV ptmx'
[2662]667    $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
668    $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
669    $__chroot_sh 'cd /dev && /sbin/MAKEDEV random'
670    $__chroot_sh 'cd /dev && /sbin/MAKEDEV urandom'
[2718]671    $__chroot_sh 'cd /dev && mkdir -p shm && chmod 777 shm'
672    $__chroot_sh 'cd /dev && mkdir -p pts && chmod 755 pts'
[406]673
[453]674    $__chroot_sh '/usr/sbin/pwconv'
675    $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
[323]676
[452]677    ##!! for rpm-4.8.0 or higher
678    ##!! (See http://trac.vinelinux.org/wiki/Vine6/AboutUpdateToolchain)
[3676]679    if [ "${VERSION}" = "VineSeed" ]; then
[453]680        $__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
[452]681    fi
682
[5364]683    ## set local repositories (profile only)
684    if [ ${with_profile} -eq 1 ]; then
685        if [ ! -z "${LOCAL_REPOS}" ]; then
686            cat >${BUILD_ROOT}/etc/apt/sources.list.d/local.list<<EOF
687${LOCAL_REPOS}
688EOF
[5510]689        $__chroot_sh "apt-get update"
[5364]690        fi
691
692        ## additional base packages
693        [ ! -z "${ADD_BASE_PKGS}" ] && \
694            $__chroot_sh "apt-get -y install ${ADD_BASE_PKGS}" 
695    fi
696
[454]697    # mount-chroot --umount /home
698    # mount-chroot --umount /tmp
[2718]699    mount-chroot --umount /dev/shm
700    mount-chroot --umount /dev/pts
[725]701    mount-chroot --umount archives_dir
[2718]702    mount-chroot --umount /proc
[413]703    apt-get-update --host
[412]704
[5364]705    echo $"Making a build farm for ${BUILD_ROOT} done."
[1240]706    return 0
[118]707}
708
709RPM_Remove(){
[1240]710    setup-vbootstrap-rpm || return 1
[485]711    mount-chroot unionfs_dir
[725]712    mount-chroot archives_dir
[3021]713    mount-chroot /proc
[2718]714    mount-chroot /dev/pts
715    mount-chroot /dev/shm
[6010]716    # apt-get-update --chroot
[118]717
[2516]718    [ -f $RPM_PKG ] && \
719        echo $"E: $RPM_PKG is not a package name" && return 1
[453]720    $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
[412]721
[2718]722    mount-chroot --umount /dev/shm
723    mount-chroot --umount /dev/pts
[3021]724    mount-chroot --umount /proc
[725]725    mount-chroot --umount archives_dir
[485]726    mount-chroot --umount unionfs_dir
[6010]727    # apt-get-update --host
[1240]728
729    return 0
[118]730}
731
732RPM_Install(){
[1240]733    setup-vbootstrap-rpm || return 1
[485]734    mount-chroot unionfs_dir
[725]735    mount-chroot archives_dir
[3021]736    mount-chroot /proc
[2718]737    mount-chroot /dev/pts
738    mount-chroot /dev/shm
[413]739    apt-get-update --chroot
[118]740
[4622]741    [ $with_category_nonfree -eq 1 ] && \
742        [ ! -z "$(echo $BASE_RPM_PKG | grep -e 'self-build-' -e 'install-assist-')" ] && \
743        $__chroot_sh 'rpm -q --quiet self-build-setup || apt-get -qq -y install self-build-setup'
744
[453]745    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
[412]746
[2718]747    mount-chroot --umount /dev/shm
748    mount-chroot --umount /dev/pts
[3021]749    mount-chroot --umount /proc
[725]750    mount-chroot --umount archives_dir
[485]751    mount-chroot --umount unionfs_dir
[413]752    apt-get-update --host
[1240]753
754    return 0
[118]755}
756
757RPM_Build(){
[5364]758    [ ! -f ${RPM_PKG} ] && \
759        echo $"E: No such file found: ${RPM_PKG}" && return 1
760
761    ## check the extension of given $RPM_PKG
762    local RPM_PKG_EXT=${RPM_PKG##*.}
763    case ${RPM_PKG_EXT} in
764        spec)
765            ## In this case,
766            ## the file ${RPM_PKG} is a spec file!
767            # spec-validator ${RPM_PKG} || return 1
768            # return 1
769
770            ## We assign the variable ${RPM_PKG}
771            ## the src.rpm generated by the spec file ${RPM_PKG}.
772            RPM_PKG=$(rpm -E "%{_srcrpmdir}")/$(rpm -q --qf "%{name}-%{version}-%{release}\n" --specfile ${RPM_PKG} | head -n 1).src.rpm
773            ;;
774        rpm)
775            RPM_PKG_EXT=$(echo ${RPM_PKG} | sed -e "s|.*\.\(src\.rpm\)$|\1|")
776            [ "${RPM_PKG_EXT}" != "src.rpm" ] && \
777                echo $"E: $RPM_PKG is NOT a source RPM package" && return 1
778            ;;
779        *)
780            echo $"The action build-rpm cannot work such extension: ${RPM_PKG_EXT}"
781            return 1
782            ;;
783    esac
784
[1240]785    setup-vbootstrap-rpm || return 1
[485]786    mount-chroot unionfs_dir
[725]787    mount-chroot archives_dir
[3021]788    mount-chroot /proc
[2718]789    mount-chroot /dev/pts
790    mount-chroot /dev/shm
[628]791    apt-get-update --chroot
[5364]792   
793    [ ! -f ${RPM_PKG} ] && \
794        echo $"E: No such file found: ${RPM_PKG}" && return 1
[118]795
[370]796    RPM_PKG_USER=$(stat -c %U $RPM_PKG)
[371]797    RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
[520]798    [ ! -z "${SUDO_UID}" ] && RPM_PKG_USER=${SUDO_UID}
799    [ ! -z "${SUDO_GID}" ] && RPM_PKG_GROUP=${SUDO_GID}
[371]800    local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
[370]801
802    ## make src.rpm for $VERSION
[453]803    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
[1524]804    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild -bs --nodeps --clean --rmsource --rmspec $RPM_OPTS ${BUILD_DIR}/SPECS/*.spec'"
[370]805
[396]806
807    ## change ${DIST_RELEASE}
[4003]808    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl[0-9]*\([A-Za-z]*[0-9A-Za-z]*\)\./vl${DIST_RELEASE}\1\./")
[396]809
810    ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
[969]811    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -o APT::Install::Virtual=true -y build-dep $BASE_RPM_PKG"
[453]812    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
[4622]813
814    BUILT_RPMS_LIST=$(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')
815
816    [ $with_category_nonfree -eq 1 ] && \
817        [ ! -z "$(echo $BUILT_RPMS_LIST | grep -e 'self-build-' -e 'install-assist-')" ] && \
818        $__chroot_sh 'rpm -q --quiet self-build-setup || apt-get -qq -y install self-build-setup'
819
[1267]820    [ $with_no_install -eq 0 ] && \
[4622]821        $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BUILT_RPMS_LIST"
[396]822
[370]823    ## copy built rpms to ${HOME}/rpm/ for each archtectures
[2522]824    echo $"Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
[4076]825    for i in $RPM_PKG_ARCH_LIST; do
826        [ -d $BUILD_ROOT${BUILD_DIR}/${i} ] || continue
827        if [ ! -d ${BUILT_RPMS_DIR}/${VERSION}/${i} ]; then
828            $__install -d ${BUILT_RPMS_DIR}/${VERSION}/${i}/
829            chown -R ${RPM_PKG_USER}:${RPM_PKG_GROUP} ${BUILT_RPMS_DIR}
[370]830        fi
[4076]831        find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
832            -exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${VERSION}/${i}/ \;
[370]833    done
[412]834
[2718]835    mount-chroot --umount /dev/shm
836    mount-chroot --umount /dev/pts
[3021]837    mount-chroot --umount /proc
[725]838    mount-chroot --umount archives_dir
[485]839    mount-chroot --umount unionfs_dir
[413]840    apt-get-update --host
[412]841
[2522]842    echo $"done."
[1240]843    return 0
[118]844}
845
[1240]846RPM_Sign(){
[1375]847    [ $with_sign -eq 1 ] || return 1
[118]848
[2668]849    setup-vbootstrap || return 1
850
851    [ -d ${BUILD_ROOT} ] || Build
852
853    mount-chroot unionfs_dir
854
[2662]855    echo $"Signing built rpms using ${RPM_SIGN_USER}'s key: "
[5364]856    su $RPM_SIGN_USER -c "rpmsign --addsign $(for i in $RPM_PKG_ARCH_LIST; do find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' 2>/dev/null; done | sed -e s,$BUILD_ROOT${BUILD_DIR},${BUILT_RPMS_DIR}/${VERSION},g -e 's/$/ \\/g')"
[1375]857
[2668]858    mount-chroot --umount unionfs_dir
859
[1240]860    return 0
861}
862
[2718]863Login_Chroot(){
864    [ $with_login -eq 1 ] || return 1
[1240]865
[2718]866    setup-vbootstrap || return 1
867
868    __chroot="/usr/sbin/chroot ${BUILD_ROOT}"
869    ## setarch ix86 if ix86 chroot on x86_64 host
870    [ $with_ix86_on_x86_64 -eq 1 ] && \
871        __chroot="/usr/sbin/chroot ${BUILD_ROOT} setarch ${VARCH}"
872
873
874    mount-chroot unionfs_dir
875    mount-chroot archives_dir
[3021]876    mount-chroot /proc
[2718]877    mount-chroot /dev/pts
878    mount-chroot /dev/shm
879    mount-chroot /tmp
880    # mount-chroot /home
[6010]881    # apt-get-update --chroot
[2718]882
883    ## copy host's configurations of /etc
884    #passwd shadow group gshadow
885    for i in resolv.conf hosts; do
886        cp -pf /etc/${i} ${BUILD_ROOT}/etc
887    done
888    cp -Ppf /etc/localtime ${BUILD_ROOT}/etc
889
[3678]890    $__chroot /bin/bash
[2718]891
892    # mount-chroot  --umount /home
893    mount-chroot  --umount /tmp
894    mount-chroot --umount /dev/shm
895    mount-chroot --umount /dev/pts
[3021]896    mount-chroot --umount /proc
[2718]897    mount-chroot --umount archives_dir
898    mount-chroot --umount unionfs_dir
[6010]899    # apt-get-update --host
[2718]900
901    return 0
902}
903
904
[304]905##############################################################################
906
[5364]907initialize-variables || exit 1
[304]908
[416]909check-parameter $* || exit 1
910
[5364]911setup-vbuilder || exit 1
912
[118]913while [ $# -gt 0 ]; do
[411]914    tmpARG=$1
915    case $tmpARG in
[5364]916        --profile)
[406]917            shift
918            ;;
[5364]919        --version|--arch|--category|--fetch-url|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
920            shift
921            ;;
[5508]922        --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install|--login|--no-build-essential|--debug)
[406]923            ;;
[725]924        --build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
925            shift
926            ;;
[3675]927        --build|build|--clean|clean)
[725]928            ;;
[406]929        *)
[416]930            echo unknown option $1
[406]931            exit 1
932            ;;
933    esac
934
[411]935    case $tmpARG in
[5364]936        --profile)
937            ;;
[406]938        --version)
[118]939            VERSION=$1
940            ;;
941        --arch)
942            VARCH=$1
943            ;;
[791]944        --category)
945            CATEGORIES=$1
946            ;;
[5364]947        --fetch-url)
948            VBOOTSTRAP_FETCH_URL=$1
949            ;;
[411]950        --dist-upgrade)
951            with_dist_upgrade=1
952            ;;
[485]953        --unionfs)
954            with_unionfs=1
955            ;;
[406]956        --target)
957            TARGET=$1
958            RPM_OPTS="${RPM_OPTS} --target $TARGET"
959            ;;
[118]960        --with-compat32)
[406]961            RPM_OPTS="${RPM_OPTS} --with compat32"
[118]962            ;;
[2531]963        --rpmbuild-define)
964            RPM_OPTS="${RPM_OPTS} --define $1"
965            ;;
[1476]966        --rpmbuild-with)
967            RPM_OPTS="${RPM_OPTS} --with $1"
968            ;;
[2531]969        --rpmbuild-without)
970            RPM_OPTS="${RPM_OPTS} --without $1"
971            ;;
[1240]972        --sign)
973            with_sign=1
974            ;;
[1267]975        --no-install)
976            with_no_install=1
977            ;;
[5508]978        --no-build-essential)
979            with_build_essential=0
980            ;;
[2718]981        --login)
982            with_login=1
983            ;;
[709]984        --bootstrap-dir)
985            VBOOTSTRAP_DIR=$1
986            ;;
[2711]987        --unionfs-dir)
988            UNIONFS_DIR=$1
989            ;;
[725]990        --cache-dir)
991            CACHE_DIR=$1
992            ;;
[709]993        --built-rpms-dir)
994            BUILT_RPMS_DIR=$1
995            ;;
[2718]996        --debug)
997            with_debug=1
998            ;;
[679]999        --build-rpm|build-rpm)
[118]1000            RPM_PKG=$1
[406]1001            RPM_Build || exit 1
[118]1002            ;;
[679]1003        --install-rpm|install-rpm)
[118]1004            RPM_PKG=$1
[406]1005            RPM_Install || exit 1
[118]1006            ;;
[679]1007        --remove-rpm|remove-rpm)
[118]1008            RPM_PKG=$1
[406]1009            RPM_Remove || exit 1
[118]1010            ;;
[679]1011        --build|build)
[1240]1012            Build || exit 1
[118]1013            ;;
[679]1014        --clean|clean)
[1240]1015            Clean || exit 1
[118]1016            ;;
1017    esac
1018    shift
1019done
1020
[3479]1021RPM_Sign ||:
[1240]1022
[3479]1023Login_Chroot ||:
[2718]1024
[118]1025exit
Note: See TracBrowser for help on using the repository browser.