# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../asterisk-sounds/asterisk-sounds.conf
# Copyright (C) 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# 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. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---

pkgprefix -t asterisk

var_append makeopt ' ' "ASTLIBDIR=$( pkgprefix libdir asterisk )"
var_append makeopt ' ' "ASTVARLIBDIR=$( pkgprefix datadir asterisk )"

var_append GCC_WRAPPER_APPEND ' ' "-I$( pkgprefix includedir asterisk )"

clean_dupes() {
	local x= files='invalid.gsm'
	for x in hasleft leaderhasleft placeintoconf thereare userswilljoin userwilljoin \
		userwilljoin waitforleader; do
		files="$files conf-$x.gsm"
	done
#	for x in a b c d e f g h i j k l m n o p q r s t u v w x y z zed; do
#		files="$files letters/$x.gsm"
#	done
	for x in $files; do
		rm -vf sounds/$x
	done
}

hook_add preconf 5 'clean_dupes'

makeinstopt="$makeopt install"