File: Makefile.PL

package info (click to toggle)
libx11-guitest-perl 0.28-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 756 kB
  • sloc: sh: 2,046; ansic: 610; perl: 593; makefile: 13
file content (79 lines) | stat: -rw-r--r-- 2,435 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

# X11::GUITest ($Id: Makefile.PL 242 2014-03-16 12:11:48Z ctrondlp $)

use strict;
use warnings;
use Config;
use ExtUtils::MakeMaker;


# Optional building of additional doc formats.
if (defined($ARGV[0]) && $ARGV[0] eq 'docs') {
	BuildDocumentation();
}

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
	'NAME' => 'X11::GUITest',
	($] ge '5.005') ? (
		'AUTHOR' => 'Dennis K. Paulsen <ctrondlp@cpan.org>',
		'ABSTRACT' => 'Collection of functions for X11 GUI testing/interaction.',
	) : (),
	'VERSION_FROM' => 'GUITest.pm', # Finds $VERSION
	($] lt '5.008') ? (
		'INST_MAN3DIR' => './blib/man3',
		'MAN3EXT' => '3pm'
	) : (),
	'MAN3PODS' => {'GUITest.pm' => '$(INST_MAN3DIR)/X11::GUITest.$(MAN3EXT)'},
	'LIBS'  => GetLibs(), # e.g., '-lm'
	# To work around an incompatibility between the XTest and the Xinerama
	# (X server) extensions, use "-DX11_GUITEST_USING_XINERAMA".
	'DEFINE' => '-DNDEBUG -DX11_GUITEST_ALT_L_FALLBACK_META_L', # e.g., '-DHAVE_SOMETHING'
	'INC'   => '-I/usr/X11R6/include -I/usr/X/include', # e.g., '-I/usr/include/other'
	'CCFLAGS' => $Config{ccflags} . ' -Wall',
	'OBJECT' => 'GUITest$(OBJ_EXT) KeyUtil$(OBJ_EXT)',
	'OPTIMIZE' => '-O2',
        'META_MERGE' => {
            resources => {
                repository => 'https://x11guitest.svn.sourceforge.net/svnroot/x11guitest',
            },
        },
        'LICENSE' => 'gpl_2',
);


sub GetLibs {
	my $un = `uname -a 2>&1` || "";
	if ($un =~ /x86_64|amd64/i && $un !~ /OpenBSD/) {
		# In case of x64, lets make sure we use x64 libs, system might have both.
		return ['-L/usr/X11R6/lib64 -L/usr/X/lib64 -lXtst -lX11'];
	} else {
		return ['-L/usr/X11R6/lib -L/usr/X/lib -lXtst -lX11'];
	}
}

# Subroutine: BuildDocumentation
# Description: This function is implemented to generate the
#			   documentation in HTML/plain-text formats.
sub BuildDocumentation {
	my $podfile = 'GUITest.pm';

	# Check POD
	if ( system("podchecker $podfile &>/dev/null") != 0 ) {
		print "POD validation failed!  Documentation will not be written.\n";
		return(0);
	}

	# Generate Text and HTML documents
	print "Writing documentation for X11::GUITest\n";
	system("pod2text $podfile docs/X11-GUITest.txt");
	system("pod2html --infile=$podfile --outfile=docs/X11-GUITest.html");
	system("cp -f docs/X11-GUITest.txt README");

	# Cleanup
	unlink <pod*.x??>;
	unlink <pod*.tmp>;

	return(1);
}