seblu-build 1.27 KB
Newer Older
1
#!/bin/bash
Seblu's avatar
Seblu committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

# Copyright © Sébastien Luttringer
#
# 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 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 19 20 21 22 23

[[ ! -f PKGBUILD ]] && echo 'No PKGBUILD' && exit 1

source /etc/makepkg.conf
source PKGBUILD

24 25 26
repo=${0##*/}
repo=${repo%-*}

27 28 29 30 31 32 33 34 35 36 37 38
# usage : in_array( $needle, $haystack )
# return : 0 - found
#          1 - not found
in_array() {
	local needle=$1; shift
	local item
	for item in "$@"; do
	   [[ $item = $needle ]] && return 0 # Found
	done
	return 1 # Not Found
}

Seblu's avatar
Seblu committed
39
# arch amd64 build and any builds
40 41
if in_array 'x86_64' "${arch[@]}" || in_array 'any' "${arch[@]}"; then
	$repo-x86_64-build "$@" || exit 1
42 43
fi

44
# vim:set ts=2 sw=2 ft=sh noet ai: