123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- #!/bin/bash
- # -*- coding: utf-8-unix -*-
- Usage_C(){
- cat<<EOF
- Usage: $(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]}
- Options:
- --version: set [version] (default: ${DEFAULT_VERSION})
- --arch: set [arch] (default: $(uname -i))
- --dist-upgrade: make VineSeed bootstrap via ${STABLE_VERSION}
- --unionfs cover a bootstrap with unionfs
- --target: build rpms with [target]
- --with-compat32: build rpms with compat32 on boostrap
- Actions:
- --clean: clean boostrap of [version]
- --build: build boostrap of [version]
- --build-rpm: build [src.rpm] on boostrap
- --install-rpm: install [arch.rpm|package] on boostrap
- --remove-rpm: remove [package] on boostrap
- For example,
- * make a clean/plain build environment on the current archtecture:
- $(basename $0) --clean --build
- * build rpms from the specified source rpm:
- $(basename $0) --build-rpm [src.rpm]
- * make a plain build environment for Vine Linux 4.2:
- $(basename $0) --version 4.2 --clean --build
- * make a i386 chroot on x86_64:
- $(basename $0) --arch i386 --clean --build
- * build a kernel package with target i686
- $(basename $0) --target i686 --build-rpm [kernel src.rpm]
- * build a compat32 package:
- $(basename $0) --arch i386 --with-compat32 --build-rpm [src.rpm]
- $(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*//)
- EOF
- }
- Usage_ja(){
- Usage_C
- }
- Msg_MissingParameter_C(){
- para=$1
- cat<<EOF
- E: Missing some parameters after ${para}
- EOF
- }
- Msg_MissingParameter_ja(){
- para=$1
- cat<<EOF
- E: ${para} 以後のいくつかのパラメータに間違いがあります
- EOF
- }
- Msg_NoSupportVARCH_C(){
- cat<<EOF
- E: arch ${VARCH} is NOT supported on $(uname -i)
- EOF
- }
- Msg_NoSupportVARCH_ja(){
- cat<<EOF
- E: ${VARCH} アーキテクチャは $(uname -i) 上で非サポートです
- EOF
- }
- Msg_NoSupportVERSION_C(){
- cat<<EOF
- E: ${VERSION} is NOT supported
- EOF
- }
- Msg_NoSupportVERSION_ja(){
- cat<<EOF
- E: バージョン ${VERSION} は非サポートです
- EOF
- }
- Msg_NoSupportDistUpgradeVERSION_C(){
- cat<<EOF
- E: version ${VERSION} does not support --dist-upgrade option
- EOF
- }
- Msg_NoSupportDistUpgradeVERSION_ja(){
- cat<<EOF
- E: バージョン ${VERSION} では --dist-upgrade オプションはサポートされていません
- EOF
- }
- Msg_NoSupportTARGET_C(){
- cat<<EOF
- E: rpm build target ${TARGET} is NOT supported
- EOF
- }
- Msg_NoSupportTARGET_ja(){
- cat<<EOF
- E: rpm ビルドターゲット ${TARGET} はサポートされていません
- EOF
- }
- Msg_NotPackageName_C(){
- cat<<EOF
- E: $RPM_PKG is not a package name
- EOF
- }
- Msg_NotPackageName_ja(){
- cat<<EOF
- E: $RPM_PKG はパッケージ名でありません
- EOF
- }
- Msg_NotSourceRPM_C(){
- cat<<EOF
- E: $RPM_PKG is not a source RPM package
- EOF
- }
- Msg_NotSourceRPM_ja(){
- cat<<EOF
- E: $RPM_PKG はソース RPM パッケージでありません
- EOF
- }
- ##############################################################################
- check-parameter(){
- if [ -z "$*" ]; then
- Usage_$LOCALE
- return 1
- fi
- while [ ! -z "$*" ]; do
- case $1 in
- --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
- shift
- check-next-parameter $1 || return 1
- ;;
- --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
- ;;
- *)
- Msg_MissingParameter_$LOCALE $1
- return 1
- ;;
- esac
- shift
- done
- return 0
- }
- check-next-parameter(){
- arg=$1
- if [ -z "${arg}" ]; then
- Msg_MissingParameter_$LOCALE ${arg}
- return 1
- fi
- if [ $(echo ${arg} | grep '^-') ]; then
- Msg_MissingParameter_$LOCALE ${arg}
- return 1
- fi
- return 0
- }
- setup-vbuilder(){
- ## load default settings
- if [ -r /etc/vbootstrap/vbuilder.conf ]; then
- . /etc/vbootstrap/vbuilder.conf
- fi
- [ -z "${VBOOTSTRAP_DIR}" ] && \
- VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
- [ -z "${DEFAULT_VERSION}" ] && \
- DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
- [ -z "${BUILT_RPMS_DIR}" ] && \
- BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
- [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
- VERSION=$DEFAULT_VERSION
- ## current stable relase version
- STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
- ## set locale
- case $LANG in
- ja*) LOCALE=ja ;;
- *) LOCALE=C ;;
- esac
- ## set boolian
- with_setup_vbootstrap=0
- with_unionfs=0
- with_dist_upgrade=0
- }
- setup-vbootstrap(){
- if [ ${with_setup_vbootstrap} -eq 0 ]; then
- with_setup_vbootstrap=1
- ## check a chroot archtecture
- if [ ! -z ${VARCH} ]; then
- case "${VARCH}" in
- i386)
- [ "$(uname -i)" = "ppc" ] && \
- Msg_NoSupportVARCH_$LOCALE
- [ $? -eq 0 ] && exit 1
- ;;
- i686)
- [ "$(uname -i)" = "ppc" ] && \
- Msg_NoSupportVARCH_$LOCALE
- [ $? -eq 0 ] && exit 1
- ;;
- x86_64)
- [ "$(uname -i)" = "ppc" ] && \
- Msg_NoSupportVARCH_$LOCALE
- [ $? -eq 0 ] && exit 1
- ;;
- ppc)
- [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
- Msg_NoSupportVARCH_$LOCALE
- [ $? -eq 0 ] && exit 1
- ;;
- esac
- fi
- [ -z ${VARCH} ] && VARCH=$(uname -i)
- ##!! 4.2 is NO support on VARCH=x86_64
- if [ "${VERSION}" = "4.2" -a "${VARCH}" = "x86_64" ]; then
- Msg_NoSupportVERSION_${LOCALE}
- exit 1
- fi
- ## support i386 chroot on x86_64 below:
- [ "${VARCH}" != "$(uname -i)" ] && VERSION=${VERSION}_${VARCH}
- ## check support ${VERSION}
- if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
- Msg_NoSupportVERSION_$LOCALE
- exit 1
- fi
- ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
- if [ $with_dist_upgrade -eq 1 ]; then
- if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
- Msg_NoSupportDistUpgradeVERSION_$LOCALE
- exit 1
- fi
- fi
- ## check build target option ${TARGET}
- if [ ! -z "${TARGET}" ]; then
- RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
- if [ -z "$(echo $RPM_TARGET_LIST | grep $TARGET)" ]; then
- Msg_NoSupportTARGET_$LOCALE
- exit 1
- fi
- fi
- fi
- MAJOR_VERSION=$(echo ${VERSION} | sed -e "s/_i[0-9]86//")
- BUILD_ROOT=${VBOOTSTRAP_DIR}/${VERSION}
- BUILD_USER=vbuilder
- BUILD_DIR=/home/${BUILD_USER}/rpm
- ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
- CACHE_DIR=${VBOOTSTRAP_DIR}/cache/${VERSION}/apt/archives
- UNIONFS_DIR=${VBOOTSTRAP_DIR}/unionfs/${VERSION}
- __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c"
- mkdir -p $VBOOTSTRAP_DIR
- }
- setup-vbootstrap-rpm(){
- setup-vbootstrap
- ## check ${BUILD_ROOT}
- [ -d ${BUILD_ROOT} ] || Build
- DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
- if [ -f $RPM_PKG ]; then
- BASE_RPM_PKG=$(basename $RPM_PKG)
- cp -f $RPM_PKG $BUILD_ROOT${BUILD_DIR}
- else
- BASE_RPM_PKG=$RPM_PKG
- fi
- }
- ## recover apt-get data on host/chroot
- apt-get-update(){
- case $1 in
- --host)
- echo -n "apt-get update on host ... "
- apt-get -qq update > /dev/null 2>&1
- echo "done."
- ;;
- --chroot)
- echo -n "apt-get update on chroot ... "
- $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
- echo "done."
- ;;
- *)
- echo apt-get-update: unknown option $1
- exit 1
- ;;
- esac
- }
- ## mount-chroot {|--umount} [file system|name]
- ## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
- ## support name: vfs chache_dir
- ## NOTE: /tmp needs for applications which use X
- ## vfs is virtual file systems
- ## cache_dir is ${CACHE_DIR} to ${ARCHIVES_DIR}
- mount-chroot(){
- if [ "$1" = "--umount" ]; then
- mount-chroot-umount $2 || return 1
- else
- mount-chroot-mount $1 || return 1
- fi
- return 0
- }
- ## mount-chroot-umount [file system|name]
- mount-chroot-umount(){
- local fs=$1
- case $fs in
- /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
- [ -d ${BUILD_ROOT}${fs} ] || return 1
- [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
- umount ${BUILD_ROOT}${fs}
- return 0
- ;;
- vfs)
- # for dir in /sys /proc /dev/shm /dev/pts /dev; do
- # mount-chroot-umount ${dir} || return 1
- # done
- [ -d ${BUILD_ROOT}/proc ] || return 1
- [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
- umount ${BUILD_ROOT}/proc
- return 0
- ;;
- cache_dir)
- [ -d ${ARCHIVES_DIR} ] || return 1
- [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
- umount ${ARCHIVES_DIR}
- return 0
- ;;
- unionfs_dir)
- [ -d ${BUILD_ROOT} ] || return 1
- [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
- umount ${BUILD_ROOT}
- if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
- echo "Retry lazy unmount ... "
- umount -l ${BUILD_ROOT}
- echo "done."
- fi
- return 0
- ;;
- *)
- echo mount-chroot-umount: unknown file system $fs
- exit 1
- ;;
- esac
- }
- ## mount-chroot-mount [file system|name]
- mount-chroot-mount(){
- local fs=$1
- local mnt_opts=""
- case $fs in
- /home)
- mnt_opts="-o rbind"
- ;;
- *)
- mnt_opts="--bind"
- ;;
- esac
- case $fs in
- /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
- [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
- [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
- mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
- return 0
- ;;
- vfs)
- # for dir in /dev /dev/pts /dev/shm /proc /sys; do
- # mount-chroot-mount ${dir} || return 1
- # done
- mount-chroot-mount /proc || return 1
- return 0
- ;;
- cache_dir)
- [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR}
- [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
- [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
- mount ${mnt_opts} ${CACHE_DIR} ${ARCHIVES_DIR}
- [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
- return 0
- ;;
- unionfs_dir)
- if [ $with_unionfs -eq 1 ]; then
- [ -d ${UNIONFS_DIR} ] || mkdir -p ${UNIONFS_DIR}
- [ -z "$(mount | grep ${BUILD_ROOT})" ] && \
- mount -t unionfs -o dirs=${UNIONFS_DIR}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
- unionctl ${BUILD_ROOT} --list
- fi
- return 0
- ;;
- *)
- echo mount-chroot-mount: unknown file system $fs
- exit 1
- ;;
- esac
-
- }
- ##############################################################################
- Clean(){
- setup-vbootstrap
- # mount-chroot --umount /home
- # mount-chroot --umount /tmp
- mount-chroot --umount vfs
- mount-chroot --umount cache_dir
- mount-chroot --umount unionfs_dir
- apt-get-update --host
- if [ $with_unionfs -eq 1 ]; then
- if [ -d ${UNIONFS_DIR} ]; then
- echo -n "Cleaning build root \"${UNIONFS_DIR}\" via unionfs ... "
- rm -rf ${UNIONFS_DIR}
- echo "done."
- fi
- else
- if [ -d ${BUILD_ROOT} ]; then
- echo -n "Cleaning build root \"${BUILD_ROOT}\" ... "
- rm -rf ${BUILD_ROOT}
- echo "done."
- fi
- fi
- echo "Cleanup a build farm for ${VERSION} done."
- }
- Retry_vbootstrap-post(){
- local CHROOT_DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
- local DIST_RELEASE=$(cat /etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
- if [ "${CHROOT_DIST_RELEASE}" != "${DIST_RELEASE}" ]; then
- . /usr/share/vbootstrap/scripts/${VERSION}
- $__chroot_sh "rm /var/lib/rpm/*"
- $__chroot_sh "rpmdb --initdb"
- $__chroot_sh "apt-get -qq update"
- $__chroot_sh "apt-get -qq -y install ${BASE_PKGS}"
- fi
- }
- Build(){
- setup-vbootstrap
- if [ $with_dist_upgrade -eq 1 ]; then
- ## make bootstrap of ${STABLE_VERSION}
- /usr/sbin/vbootstrap \
- $(echo ${VERSION} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
- ${BUILD_ROOT}
- ## aim apt-line to VineSeed
- sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
- ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
- else
- /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
- fi
- ## retry vbootstrap post in Build()
- Retry_vbootstrap-post
- mount-chroot cache_dir
- mount-chroot vfs
- # mount-chroot /tmp
- # mount-chroot /home
- $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
- ##!! 4.2 has no apt-sourceslist-{plus,nonfree} packages
- if [ "${MAJOR_VERSION}" != "4.2" ]; then
- $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
- $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
- fi
- if [ $with_dist_upgrade -eq 1 ]; then
- $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
- fi
- $__chroot_sh 'apt-get -qq -y install build-essential'
- $__chroot_sh 'apt-get -qq -y install self-build-setup'
- $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
- $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
- $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
- $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
- $__chroot_sh '/usr/sbin/pwconv'
- $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
- ##!! for rpm-4.8.0 or higher
- ##!! (See http://trac.vinelinux.org/wiki/Vine6/AboutUpdateToolchain)
- if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" = "VineSeed" ]; then
- $__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
- fi
- # mount-chroot --umount /home
- # mount-chroot --umount /tmp
- mount-chroot --umount vfs
- mount-chroot --umount cache_dir
- apt-get-update --host
- echo "Making a build farm for ${VERSION} done."
- }
- RPM_Remove(){
- setup-vbootstrap-rpm
- mount-chroot unionfs_dir
- mount-chroot cache_dir
- mount-chroot vfs
- if [ -f $RPM_PKG ]; then
- Msg_NotPackageName_$LOCALE
- exit 1
- fi
- $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
- mount-chroot --umount vfs
- mount-chroot --umount cache_dir
- mount-chroot --umount unionfs_dir
- apt-get-update --host
- }
- RPM_Install(){
- setup-vbootstrap-rpm
- mount-chroot unionfs_dir
- mount-chroot cache_dir
- mount-chroot vfs
- apt-get-update --chroot
- $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
- mount-chroot --umount vfs
- mount-chroot --umount cache_dir
- mount-chroot --umount unionfs_dir
- apt-get-update --host
- }
- RPM_Build(){
- setup-vbootstrap-rpm
- mount-chroot unionfs_dir
- mount-chroot cache_dir
- mount-chroot vfs
- if [ ! -f $RPM_PKG ]; then
- Msg_NotSourceRPM_$LOCALE
- exit 1
- fi
-
- RPM_PKG_USER=$(stat -c %U $RPM_PKG)
- RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
- local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
- RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
- [ -z "${TARGET}" ] || \
- RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
- ## make src.rpm for $VERSION
- $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
- $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild -bs --nodeps --clean --rmsource --rmspec ${BUILD_DIR}/SPECS/*.spec'"
- ## change ${DIST_RELEASE}
- BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl\([0-9]*\)\./vl${DIST_RELEASE}\./")
- ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
- $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -y build-dep $BASE_RPM_PKG"
- $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
- $__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')"
- ## copy built rpms to ${HOME}/rpm/ for each archtectures
- echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
- for i in $RPM_PKG_ARCH_LIST; do \
- if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
- [ -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ] || \
- $__install -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/
- find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
- -exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/ \;
- fi
- done
- mount-chroot --umount vfs
- mount-chroot --umount cache_dir
- mount-chroot --umount unionfs_dir
- apt-get-update --host
- echo "done."
- }
- ##############################################################################
- setup-vbuilder
- check-parameter $* || exit 1
- while [ $# -gt 0 ]; do
- tmpARG=$1
- case $tmpARG in
- --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
- shift
- ;;
- --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
- ;;
- *)
- echo unknown option $1
- exit 1
- ;;
- esac
- case $tmpARG in
- --version)
- VERSION=$1
- ;;
- --arch)
- VARCH=$1
- ;;
- --dist-upgrade)
- with_dist_upgrade=1
- ;;
- --unionfs)
- with_unionfs=1
- ;;
- --target)
- TARGET=$1
- RPM_OPTS="${RPM_OPTS} --target $TARGET"
- ;;
- --with-compat32)
- RPM_OPTS="${RPM_OPTS} --with compat32"
- ;;
- --build-rpm)
- RPM_PKG=$1
- RPM_Build || exit 1
- ;;
- --install-rpm)
- RPM_PKG=$1
- RPM_Install || exit 1
- ;;
- --remove-rpm)
- RPM_PKG=$1
- RPM_Remove || exit 1
- ;;
- --build)
- Build
- ;;
- --clean)
- Clean
- ;;
- esac
- shift
- done
- exit
|