summaryrefslogtreecommitdiff
path: root/src/mips64el-tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/mips64el-tools')
-rw-r--r--src/mips64el-tools/Makefile1
-rwxr-xr-xsrc/mips64el-tools/add-mips64el6
-rwxr-xr-xsrc/mips64el-tools/librebasebuilder84
-rwxr-xr-xsrc/mips64el-tools/mips-add8
-rwxr-xr-xsrc/mips64el-tools/mipsrelease61
5 files changed, 160 insertions, 0 deletions
diff --git a/src/mips64el-tools/Makefile b/src/mips64el-tools/Makefile
new file mode 100644
index 0000000..2c76089
--- /dev/null
+++ b/src/mips64el-tools/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
diff --git a/src/mips64el-tools/add-mips64el b/src/mips64el-tools/add-mips64el
new file mode 100755
index 0000000..17b167b
--- /dev/null
+++ b/src/mips64el-tools/add-mips64el
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# Change all arch array that aren't any or mips64el already
+
+find -name 'PKGBUILD' -exec sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" '{}' \;
+
+exit $?
diff --git a/src/mips64el-tools/librebasebuilder b/src/mips64el-tools/librebasebuilder
new file mode 100755
index 0000000..6b8c8bb
--- /dev/null
+++ b/src/mips64el-tools/librebasebuilder
@@ -0,0 +1,84 @@
+#!/usr/bin/env bash
+# -*- coding: utf-8 -*-
+# Copyright (C) 2012 Michał Masłowski <mtjm@mtjm.eu>
+#
+# 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, either version 3 of the License, or
+# (at your option) any later version.
+#
+# 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+# TODO:
+
+# - make it more configurable
+
+# - compare the result with previous base images
+
+for arg in "$@" ; do
+ case "$arg" in
+ -h|--h|--he|--hel|--help|-\?)
+ echo 'Usage: librebasebuilder
+
+Make a base tarball named parabola-mips64el-DATE.tar.bz2.
+
+This script must be run as root.' >&2
+ exit 0
+ ;;
+ esac
+done
+
+[[ "$UID" != "0" ]] && {
+ echo "This script must be run as root." >&2
+ exit 1
+}
+
+tempdir=/home/chroot/base
+outdir=$(pwd)
+
+archroot -n $tempdir mkinitcpio base sudo parted nano zile vi ed openssh
+
+cd $tempdir
+
+# Don't list mtjm's DNS servers.
+cat > etc/resolv.conf <<EOF
+#
+# /etc/resolv.conf
+#
+
+#search <yourdomain.tld>
+#nameserver <ip>
+
+# End of file
+EOF
+
+# From pacman-mirrorlist-libre-20120307-1. Remember to escape dollars.
+cat > etc/pacman.d/mirrorlist <<EOF
+# Parabola GNU/Linux - Last Updated: Wed Mar 7 17:33:36 GMT 2012
+
+# Atlanta, GA, USA
+# Responsible: belos
+Server = http://parabola.techno-geeks.org/\$repo/os/\$arch
+
+# Nuremberg, Germany
+# Responsible: johkra
+Server = http://parabolaweb.eu/\$repo/os/\$arch
+
+# UK
+# Responsible: Parabola Project
+Server = http://repo.parabolagnulinux.org/\$repo/os/\$arch
+
+EOF
+
+rm .arch-chroot
+
+tar cjf $outdir/parabola-mips64el-$(LC_ALL=C date -u +%Y%m%d).tar.bz2 .
diff --git a/src/mips64el-tools/mips-add b/src/mips64el-tools/mips-add
new file mode 100755
index 0000000..402036e
--- /dev/null
+++ b/src/mips64el-tools/mips-add
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+. libremessages
+if ! grep mips64el PKGBUILD >/dev/null; then # Add mips64el in ${arch} array if it isn't 'any'
+ warning "Adding mips64el arch"
+ sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" "PKGBUILD"
+ git add PKGBUILD
+ git commit
+fi
diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease
new file mode 100755
index 0000000..de17651
--- /dev/null
+++ b/src/mips64el-tools/mipsrelease
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# Lic: GPLv3+
+# Author: Nicolas Reynolds <fauno@kiwwwi.com.ar>
+# Local release of mips64el packages + clean ABS sync
+# Called by HOOKLOCALRELEASE
+
+# $1 repo
+# $2+ packages
+
+. libremessages
+. $(librelib conf.sh)
+load_files makepkg
+check_vars makepkg CARCH PKGDEST PKGEXT || exit 1
+load_files libretools
+check_vars libretools WORKDIR || exit 1
+
+usage() {
+ echo "$0 repo"
+ echo
+ echo " release packages locally on \${PKGDEST}/stage3."
+ echo " and make a clean ABS sync "
+}
+
+main() {
+ if [[ $# != 1 ]]; then
+ usage
+ exit 1
+ fi
+
+ repo=$1
+
+ if [ -z "${repo}" ]; then
+ error "Empty repo"
+ exit 1
+ fi
+
+ # Get all needed sources
+ load_PKGBUILD
+ pkgs=()
+ makepkg --source -f --skippgpcheck -c
+
+ msg "Adding packages to [stage3]..."
+ for name in "${pkgname[@]}"; do
+ msg2 "${name} $(get_full_version $name)"
+ pkgs+=(${PKGDEST}/${name}-$(get_full_version $name)-*.pkg.tar.*)
+ done
+
+ repo-add ${PKGDEST}/stage3.db.tar.gz "${pkgs[@]}"
+
+ librestage ${repo}
+
+ mkdir -p ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null
+
+ pushd ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null
+ tar xvf $SRCPKGDEST/${pkgbase:-${pkgname[0]}}-$(get_full_version)${SRCEXT}
+ popd >/dev/null
+
+ exit $?
+}
+
+main "$@"