Переглянути джерело

updated vbootstrap.sh.in

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@304 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 15 роки тому
батько
коміт
1bbedd61fb
3 змінених файлів з 57 додано та 12 видалено
  1. 6 2
      Makefile
  2. 3 5
      vbootstrap.spec
  3. 48 5
      vbuilder.sh.in

+ 6 - 2
Makefile

@@ -19,8 +19,12 @@ install:
 tarbz2: clean
 	cd .. && rm -rf ${NAME}-${VERSION}
 	cd .. && cp -arf trunk ${NAME}-${VERSION}
-	cd .. && tar --exclude CVS -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
-	mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/
+	cd .. && tar --exclude CVS --exclude .svn -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
+	@if [ -d ~/rpm/SOURCES/${NAME} ]; then \
+		mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/${NAME}; \
+	else \
+		mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/; \
+	fi
 	rm -rf ${NAME}-${VERSION}
 
 rpm: tarbz2

+ 3 - 5
vbootstrap.spec

@@ -46,10 +46,6 @@ make
 %install
 make DESTDIR=$RPM_BUILD_ROOT install
 
-%ifnarch x86_64
-rm -f $RPM_BUILD_ROOT%{_datadir}/vbootstrap/*/VineSeed_i386
-%endif
-
 %clean
 [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
 
@@ -63,8 +59,10 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/vbootstrap/*/VineSeed_i386
 
 
 %changelog
-* Sat Jul 18 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.3-1
+* Mon Aug 31 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.3-1
+- support 5.0 (by daisuke-san)
 - update vbuilder.sh.in
+  - check chroot archtecture
 
 * Mon Jun 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.2-1
 - add vbuilder

+ 48 - 5
vbuilder.sh.in

@@ -7,7 +7,7 @@ VBOOTSTRAP_DIR=/var/local/vbootstrap
 DEFAULT_VERSION=@@DEFAULT_VERSION@@
 VERSION=$DEFAULT_VERSION
 
-Usage(){
+Usage_C(){
     cat<<EOF
 Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--with-compat32} {--build-rpm [src.rpm]|--install-rpm [arch.rpm]|--remove-rpm [package]|--build|--clean}
 	--version:		set [version] (default: ${DEFAULT_VERSION})
@@ -20,13 +20,13 @@ Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--with-compat32} {-
 	--clean:		clean boostrap of [version]
 
 For example, 
-* make plain build environment:
+* make a clean/plain build environment on the current archtecture:
 $(basename $0) --clean --build
 * build source RPM:
 $(basename $0) --build-rpm [src.rpm]
-* make Vine Linux 4.2 environment:
+* make a plain build environment for Vine Linux 4.2:
 $(basename $0) --version 4.2 --clean --build
-* i386 chroot on x86_64:
+* make a i386 chroot on x86_64:
 $(basename $0) --arch i386 --clean --build
 * build compat32:
 $(basename $0) --arch i386 --with-compat32 --build-rpm [src.rpm]
@@ -34,12 +34,48 @@ EOF
 exit 1
 }
 
+Usage_ja(){
+    Usage_C
+}
+
+Msg_NoSupportVARCH_C(){
+    while read varch; do
+	cat<<EOF
+${varch} is NO support on $(uname -i)
+EOF
+    done
+    exit 1
+}
+
+Msg_NoSupportVARCH_ja(){
+    Msg_NoSupportVARCH_C
+}
+
+
 FLAG_setup_vbootstrap=0
 setup-vbootstrap(){
     if [ ${FLAG_setup_vbootstrap} -eq 0 ]; then
 	FLAG_setup_vbootstrap=1
 
+	## check a chroot archtecture
+	[ ! -z ${VARCH} ] && \
+	    case "${VARCH}" in
+		i386)
+		    [ "$(uname -i)" = "ppc" -o "$(uname -i)" = "x86_64" ] && \
+			echo ${VARCH} | Msg_NoSupportVARCH_$LOCALE
+		    ;;
+		x86_64)
+		    [ "$(uname -i)" = "ppc" ] && \
+			echo ${VARCH} | Msg_NoSupportVARCH_$LOCALE
+		    ;;
+		ppc)
+		    [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ] && \
+			echo ${VARCH} | Msg_NoSupportVARCH_$LOCALE
+		    ;;
+	    esac
 	[ -z ${VARCH} ] && VARCH=$(uname -i)
+
+	## support for i386 chroot on x86_64 below: 
 	[ "${VARCH}" != "$(uname -i)" ] && VERSION=${VERSION}_${VARCH}
     fi
 	
@@ -141,7 +177,14 @@ RPM_Build(){
 }
 
 
-[ $# -eq 0 ] && Usage 
+##############################################################################
+
+case $LANG in
+    ja*)  LOCALE=ja ;;
+    *)    LOCALE=C ;;
+esac
+
+[ $# -eq 0 ] && Usage_$LOCALE
 while [ $# -gt 0 ]; do
     case "$1" in
 	--version)