Browse Source

updated vbuilder.sh.in: supported usermode

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@2532 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 11 years ago
parent
commit
58abb8aba5
5 changed files with 19 additions and 11 deletions
  1. 4 0
      Makefile
  2. 4 0
      vbootstrap-vl.spec
  3. 5 0
      vbuilder.console
  4. 5 0
      vbuilder.pamd
  5. 1 11
      vbuilder.sh.in

+ 4 - 0
Makefile

@@ -35,6 +35,8 @@ install:
 	install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
 	install -d ${DESTDIR}/usr/sbin
 	install -d ${DESTDIR}/etc/vbootstrap
+	install -d ${DESTDIR}/etc/security/console.apps
+	install -d ${DESTDIR}/etc/pam.d
 	install -d ${DESTDIR}/etc/bash_completion.d
 	for sh in vbootstrap/scripts/*.sh; do \
 	  inst_sh=`basename $$sh .sh`; \
@@ -44,6 +46,8 @@ install:
 	install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
 	install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
 	install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
+	install -m 644 vbuilder.console ${DESTDIR}/etc/security/console.apps/vbuilder
+	install -m 644 vbuilder.pamd ${DESTDIR}/etc/pam.d/vbuilder
 	install -m 644 vbuilder-bash-completion.sh ${DESTDIR}/etc/bash_completion.d/vbuilder
 
 	cd po && make install DESTDIR=${DESTDIR}

+ 4 - 0
vbootstrap-vl.spec

@@ -74,6 +74,8 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 %{_datadir}/vbootstrap/*
 %{_sysconfdir}/bash_completion.d/vbuilder
 %config(noreplace) %{_sysconfdir}/vbootstrap/vbuilder.conf
+%config(noreplace) %{_sysconfdir}/pam.d/vbuilder
+%config(noreplace) %{_sysconfdir}/security/console.apps/vbuilder
 
 
 %changelog
@@ -81,6 +83,8 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 - updated po translations
 - updated vbuilder.sh.in, vbuilder-bash-completion.sh
   - added --rpmbuild-define, --rpmbuild-without option
+- supported usermode
+  - dropped require-root() from vbuilder.sh.in
 
 * Tue Jan 18 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.34-1
 - updated vbuilder.sh.in

+ 5 - 0
vbuilder.console

@@ -0,0 +1,5 @@
+FALLBACK=false
+PROGRAM=/usr/sbin/vbuilder
+GUI=no
+USER=root
+# UGROUPS=wheel

+ 5 - 0
vbuilder.pamd

@@ -0,0 +1,5 @@
+#%PAM-1.0
+auth       sufficient	pam_rootok.so
+auth       include	system-auth
+account    required	pam_permit.so
+session	   required	pam_permit.so

+ 1 - 11
vbuilder.sh.in

@@ -455,14 +455,6 @@ EOF
     return 0
 }
 
-require-root(){
-  if [ $USER != "root" ]; then
-    echo $"The root privilege is required."
-    sudo $0 $*
-    return $?
-  fi
-}
-
 ##############################################################################
 
 Clean(){
@@ -656,7 +648,7 @@ RPM_Build(){
 
 
     ## change ${DIST_RELEASE}
-    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl\([0-9]*\)\./vl${DIST_RELEASE}\./")
+    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl[0-9]*\([A-Za-z]*\)\./vl${DIST_RELEASE}\1\./")
 
     ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
     $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -o APT::Install::Virtual=true -y build-dep $BASE_RPM_PKG"
@@ -706,8 +698,6 @@ setup-vbuilder || exit 1
 
 check-parameter $* || exit 1
 
-require-root $* || exit 1
-
 while [ $# -gt 0 ]; do
     tmpARG=$1
     case $tmpARG in