Browse Source

update: vbuilder.sh.in

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@396 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 15 năm trước cách đây
mục cha
commit
68fe057f86
2 tập tin đã thay đổi với 18 bổ sung8 xóa
  1. 4 1
      vbootstrap.spec
  2. 14 7
      vbuilder.sh.in

+ 4 - 1
vbootstrap.spec

@@ -1,7 +1,7 @@
 # This package is maintained on trac svn repository. Please do not change on local.
 # If you find a BUG, please report to Vine@vinelinux.org or mailing list or BTS.
 
-%define version 0.0.6
+%define version 0.0.7
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -59,6 +59,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
 
 
 %changelog
+* Sun Nov 22 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.7-1
+- updated vbuilder.sh.in
+
 * Sat Oct 31 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.6-1
 - updated vbuilder.sh.in, little
 

+ 14 - 7
vbuilder.sh.in

@@ -215,6 +215,8 @@ setup-vbootstrap-rpm(){
     ## 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}
@@ -254,19 +256,24 @@ RPM_Build(){
     local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
     RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
 
-    /usr/sbin/chroot ${BUILD_ROOT} \
-    	/bin/sh -c "cd ${BUILD_DIR} && apt-get -y build-dep $BASE_RPM_PKG"
-    /usr/sbin/chroot ${BUILD_ROOT} \
-    	/bin/sh -c "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
-    /usr/sbin/chroot ${BUILD_ROOT} \
-	/bin/sh -c "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')"
-
     ## make src.rpm for $VERSION
     /usr/sbin/chroot ${BUILD_ROOT} \
     	/bin/sh -c "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
     /usr/sbin/chroot ${BUILD_ROOT} \
 	/bin/sh -c "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}
+    /usr/sbin/chroot ${BUILD_ROOT} \
+    	/bin/sh -c "cd ${BUILD_DIR}/SRPMS && apt-get -y build-dep $BASE_RPM_PKG"
+    /usr/sbin/chroot ${BUILD_ROOT} \
+    	/bin/sh -c "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
+    /usr/sbin/chroot ${BUILD_ROOT} \
+	/bin/sh -c "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 \