diff --git a/doc/BINPKG_INFO b/doc/BINPKG_INFO index e507d05fb69..cf2f06d004f 100644 --- a/doc/BINPKG_INFO +++ b/doc/BINPKG_INFO @@ -76,7 +76,7 @@ To install binary packages, firstly a repository must be created as well as some binary packages for it. The flow for this task is: 1- xbps-src install - 2- xbps-src build-pkg all + 2- xbps-src build-pkg all [requires sudo access] 3- xbps-src genindex 4- xbps-repo add $XBPS_PACKAGES 5- xbps-bin install -r /rootdir diff --git a/doc/README b/doc/README index bcc7c3722b8..6fdab5f8500 100644 --- a/doc/README +++ b/doc/README @@ -43,6 +43,7 @@ xbps binary/source packages: * wget * libarchive (development package) * perl + * sudo Super-user privileges are required as well, because all packages are built in a chroot (except the ones that are included in a virtual package to be diff --git a/doc/SRCPKG_INFO b/doc/SRCPKG_INFO index 7de79770f73..b95fae91b54 100644 --- a/doc/SRCPKG_INFO +++ b/doc/SRCPKG_INFO @@ -2,7 +2,8 @@ REQUIREMENTS ----------------------------------------------------------------------------- -To be able to build packages the following software is required: +To be able to build packages from source the following software is required +in the host system: * GNU Binutils * GNU Bison @@ -20,8 +21,6 @@ Super-user privileges are required as well, because all packages are built in a chroot (except the ones that are included in a virtual package to be able to build a minimal system for the chroot). -PLEASE NOTE THAT fakechroot or fakeroot-ng DO NOT WORK. - ------------------------------------------------------------------------------ HOW TO BUILD/HANDLE PACKAGES FROM SOURCE ------------------------------------------------------------------------------ diff --git a/doc/TODO b/doc/TODO index eb9cf0af8ef..d4e0af0c7ba 100644 --- a/doc/TODO +++ b/doc/TODO @@ -16,8 +16,6 @@ xbps-cmpver: Packages: * fix mpfr hardcoded rpath for gmp. - * Fix sudo permissions for /etc/sudoers. This must be 644 to be able to - build the binary package. xbps-bin: * Add support to handle conf_files and keep_dirs from package metadata. diff --git a/shutils/binpkg.sh b/shutils/binpkg.sh index 9c92eb1e2ce..e52437c6c56 100644 --- a/shutils/binpkg.sh +++ b/shutils/binpkg.sh @@ -165,7 +165,7 @@ xbps_make_binpkg() binpkg=$pkgname-$version.$arch.xbps pkgdir=$XBPS_PACKAGESDIR/$arch - run_rootcmd tar cfjp $XBPS_DESTDIR/$binpkg . + run_rootcmd yes tar cfjp $XBPS_DESTDIR/$binpkg . if [ $? -eq 0 ]; then [ ! -d $pkgdir ] && mkdir -p $pkgdir mv -f $XBPS_DESTDIR/$binpkg $pkgdir diff --git a/shutils/common_funcs.sh b/shutils/common_funcs.sh index e14a773654f..c01814d0cd8 100644 --- a/shutils/common_funcs.sh +++ b/shutils/common_funcs.sh @@ -39,12 +39,19 @@ run_func() run_rootcmd() { local lenv= + local usesudo="$1" [ -n "$in_chroot" ] && unset fakeroot_cmd lenv="XBPS_DESTDIR=$XBPS_DESTDIR" lenv="XBPS_DISTRIBUTIONDIR=$XBPS_DISTRIBUTIONDIR $lenv" - env ${lenv} ${fakeroot_cmd} $@ + + shift + if [ -n "$usesudo" -a -z "$in_chroot" ]; then + sudo env ${lenv} $@ + else + env ${lenv} ${fakeroot_cmd} $@ + fi } msg_error() diff --git a/shutils/install_funcs.sh b/shutils/install_funcs.sh index e139a62e00f..ccf146c5e5d 100644 --- a/shutils/install_funcs.sh +++ b/shutils/install_funcs.sh @@ -106,7 +106,7 @@ make_install() # # Install package via make. # - run_rootcmd ${make_cmd} ${make_install_target} ${make_install_args} + run_rootcmd no ${make_cmd} ${make_install_target} ${make_install_args} if [ "$?" -ne 0 ]; then msg_error "installing $pkgname-$version." exit 1 diff --git a/templates/sudo/template b/templates/sudo/template index b4cf6beaf0d..16cbdf4d4b0 100644 --- a/templates/sudo/template +++ b/templates/sudo/template @@ -32,8 +32,4 @@ session optional pam_xauth.so session required pam_env.so session required pam_unix.so _EOF - chmod 644 $destdir/etc/pam.d/sudo - chmod 644 $destdir/usr/libexec/sudo/sudo_noexec.so - chmod 755 $destdir/usr/bin/sudo* $destdir/usr/sbin/visudo - chmod 644 $destdir/etc/sudoers }