*/*: Bump copyright on files touched this year
[gentoo.git] / dev-perl / Device-SerialPort / Device-SerialPort-1.40.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 DIST_AUTHOR=COOK
7 DIST_VERSION=1.04
8 DIST_EXAMPLES=("eg/*")
9 inherit perl-module
10
11 DESCRIPTION="A Serial port Perl Module"
12
13 SLOT="0"
14 KEYWORDS="~alpha amd64 ~arm hppa ia64 ~mips ppc sparc x86"
15 IUSE=""
16
17 #From the module:
18 # If you run 'make test', you must make sure that nothing is plugged
19 # into '/dev/ttyS1'!
20 # Doesn't sound wise to enable SRC_TEST="do" - mcummings
21
22 src_configure() {
23         myconf=()
24         [[ -n "${DEVICE_SERIALPORT_PORT}" ]] && myconf+=( "TESTPORT=${DEVICE_SERIALPORT_PORT}" )
25         perl-module_src_configure
26 }
27 src_test() {
28         local MODULES=(
29                 "Device::SerialPort ${DIST_VERSION}"
30         )
31         local failed=()
32         for dep in "${MODULES[@]}"; do
33                 ebegin "Compile testing ${dep}"
34                         perl -Mblib="${S}" -M"${dep} ()" -e1
35                 eend $? || failed+=( "$dep" )
36         done
37         if [[ ${failed[@]} ]]; then
38                 echo
39                 eerror "One or more modules failed compile:";
40                 for dep in "${failed[@]}"; do
41                         eerror "  ${dep}"
42                 done
43                 die "Failing due to module compilation errors";
44         fi
45         if [[ -n "${DEVICE_SERIALPORT_PORT}" ]]; then
46                 DIST_TEST="do"; # Parallel testing a serial port sounds unsmart.
47                 perl-module_src_test;
48         else
49                 ewarn "Functional tests are disabled without manual intervention."
50                 ewarn "For details, read:"
51                 ewarn "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/dev-perl/Device-SerialPort"
52         fi
53 }