# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ EAPI=6 COMMIT="2e8cbabaa9196e1c52dadd4945cf7f75c8e348ce" DESCRIPTION="Digital TV scan tables" HOMEPAGE="https://git.linuxtv.org/cgit.cgi/dtv-scan-tables.git/" SRC_URI="https://git.linuxtv.org/cgit.cgi/dtv-scan-tables.git/snapshot/${COMMIT}.tar.xz -> ${P}.tar.xz" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~x86" DTV_DELIVERY_SYSTEMS_V3="atsc dvb-c dvb-s dvb-t" DTV_DELIVERY_SYSTEMS_V5="isdb-t" DTV_DELIVERY_SYSTEMS="${DTV_DELIVERY_SYSTEMS_V3} ${DTV_DELIVERY_SYSTEMS_V5}" DTV_COUNTRIES="ad ar at au ax be bg br ca ch cn co cz de dk ee es fi fr gr hk hr hu ie il ir ir is it lt lu lv nl no nz pl pt ro ru se si sk tw ua ug uk us vn" for system in ${DTV_DELIVERY_SYSTEMS[@]}; do IUSE="${IUSE} dtv_delivery_systems_${system}"; done for country in ${DTV_COUNTRIES[@]}; do IUSE="${IUSE} dtv_countries_${country}"; done DEPEND="media-tv/v4l-utils" S=${WORKDIR}/${COMMIT} src_prepare() { default local my_delivery_systems system for system in ${DTV_DELIVERY_SYSTEMS_V3[@]}; do use dtv_delivery_systems_${system} && my_delivery_systems+="${my_delivery_systems} ${system}" done sed -i "s:DVBV3DIRS = .*:DVBV3DIRS = ${my_delivery_systems}:" Makefile || die for system in ${DTV_DELIVERY_SYSTEMS_V5[@]}; do use dtv_delivery_systems_${system} && my_delivery_systems+="${my_delivery_systems} ${system}" done sed -i "s:DVBV5DIRS = .*:DVBV5DIRS = ${my_delivery_systems}:" Makefile || die [[ -z ${my_delivery_systems} ]] && die "No DTV_DELIVERY_SYSTEMS set" local my_countries country for country in ${DTV_COUNTRIES[@]}; do if ! use dtv_countries_${country}; then find -name ${country}-* -exec rm {} \; || die else my_countries+="${my_countries} ${country}" fi done local scan_file_count=0 for system in ${my_delivery_systems[@]}; do scan_file_count+=$(find ${system} -type f | wc -l) done [[ ${scan_file_count} -eq 0 ]] && die "No scan files for DTV_DELIVERY_SYSTEMS=\"${my_delivery_systems## }\" and DTV_COUNTRIES=\"${my_countries## }\"" } src_install() { PREFIX="${D}"/usr emake install }