summaryrefslogtreecommitdiff
path: root/src/chroot-tools/libremakepkg.gpl2
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-01-13 18:41:31 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-01-13 18:41:31 -0500
commit5c2dd97a91421e6e5f7e920579fcb88bb71e7fa7 (patch)
treec56ccf02cc4da998a9267539a43adcd20d4691d9 /src/chroot-tools/libremakepkg.gpl2
parentb7fc106e2af7cf08fe4f8090ce2d807ba5f8f2c2 (diff)
use /usr/share/devtools/makechrootpkg.sh instead of *.gpl2
Diffstat (limited to 'src/chroot-tools/libremakepkg.gpl2')
-rwxr-xr-xsrc/chroot-tools/libremakepkg.gpl2115
1 files changed, 0 insertions, 115 deletions
diff --git a/src/chroot-tools/libremakepkg.gpl2 b/src/chroot-tools/libremakepkg.gpl2
deleted file mode 100755
index 6b7180b..0000000
--- a/src/chroot-tools/libremakepkg.gpl2
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-# Contains code derived from devtools' "makechrootpkg"
-
-# Copyright 2011-2012 The Arch Linux Development Team
-# Copyright 2012 Luke Shumaker
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-chroot_init() {
- # make sure the chroot exists
- librechroot -n "$CHROOT" -l "$CHROOTCOPY" -m
-
- if [[ -r "$LIBREHOME/.gnupg/pubring.gpg" ]]; then
- install -D "$LIBREHOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg"
- fi
- rm -f "$copydir/build/.makepkg.conf"
-
- mkdir -p "$copydir/pkgdest"
- mkdir -p "$copydir/srcdest"
-
- MAKEPKG_CONF=$copydir/etc/makepkg.conf set_conf_makepkg PKGDEST /pkgdest
- MAKEPKG_CONF=$copydir/etc/makepkg.conf set_conf_makepkg SRCDEST /srcdest
-
- cat > "$copydir/etc/sudoers.d/nobody-pacman" <<EOF
-Defaults env_keep += "HOME"
-nobody ALL = NOPASSWD: /usr/bin/pacman
-EOF
- chmod 440 "$copydir/etc/sudoers.d/nobody-pacman"
-}
-
-
-chroot_copy_in() {
- rm -rf "$copydir"/build/*
- cp PKGBUILD "$copydir/build/"
- (
- set +euE
- source PKGBUILD
-
- # Copy source files
- for file in "${source[@]}"; do
- file="${file%%::*}"
- file="${file##*://*/}"
- if [[ -f $file ]]; then
- cp "$file" "$copydir/srcdest/"
- elif [[ -f $SRCDEST/$file ]]; then
- cp "$SRCDEST/$file" "$copydir/srcdest/"
- fi
- done
-
- # Find all changelog and install files, even inside functions
- for i in 'changelog' 'install'; do
- while read -r file; do
- # evaluate any bash variables used
- eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
- if [[ -f $file ]]; then
- cp "$file" "$copydir/build/"
- fi
- done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
- done
- )
-
- chown -R nobody "$copydir"/{build,pkgdest,srcdest}
-}
-
-chroot_exec() {
- local HASNET=true
- [[ $1 == -N ]] && { HASNET=false; shift; }
-
- local cmd="$*"
- cat >"$copydir/chrootexec" <<EOF
-#!/bin/bash
-. /etc/profile
-${INCHROOT} || export HOME=/build
-${INCHROOT} || cd /build
-
-${cmd}
-EOF
- chmod 755 "$copydir/chrootexec"
-
- local flags=''
- if $INCHROOT; then
- $HASNET || flags='-n'
- unshare $flags -- /chrootexec
- else
- $HASNET || flags='-N'
- librechroot $flags -n "$CHROOT" -l "$CHROOTCOPY" -r /chrootexec
- fi
-}
-
-add_to_local_repo() {
- for pkgfile in "$copydir"/pkgdest/*.pkg.tar*; do
- mkdir -p "$copydir/repo"
- pushd "$copydir/repo" >/dev/null
- cp "$pkgfile" .
- repo-add repo.db.tar.gz "${pkgfile##*/}"
- popd >/dev/null
- done
-}
-chroot_copy_out() {
- for pkgfile in "$copydir"/pkgdest/*.pkg.tar*; do
- chown "$LIBREUSER" "$pkgfile"
- mv "$pkgfile" "$PKGDEST"
- if [[ $PKGDEST != . ]]; then
- ln -s "$PKGDEST/${pkgfile##*/}" .
- fi
- done
- copy_logs
-}