File: Build.PL

package info (click to toggle)
libfile-lchown-perl 0.03-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 116 kB
  • sloc: perl: 68; makefile: 3
file content (58 lines) | stat: -rw-r--r-- 1,086 bytes parent folder | download
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
use v5;
use strict;
use warnings;

use Module::Build;
use ExtUtils::CChecker 0.03;

my $cc = ExtUtils::CChecker->new;

$cc->assert_compile_run( 
   diag => "no lchown()",
   source => <<'EOF' );
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
  if(lchown(".", -1, -1) != 0)
    exit(1);
  exit(0);
}
EOF

$cc->try_compile_run(
   define => "HAVE_LUTIMES",
   source => <<'EOF' );
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
int main(int argc, char *argv[]) {
  if(lutimes(".", NULL) != 0)
    exit(1);
  exit(0);
}
EOF

my $build = $cc->new_module_build(
   module_name => 'File::lchown',
   configure_requires => {
      'ExtUtils::CChecker' => 0.03,
      'Module::Build' => 0.4004,
   },
   requires => {
      'Exporter' => '5.57',
   },
   build_requires => {
      'Module::Build' => 0,
      'Module::Build::Compat' => 0,
      'Test::More' => 0,
   },
   test_requires => {
      'Test2::V0' => 0,
      'Time::HiRes' => 0,
   },
   license => 'perl',
   create_license => 1,
   create_readme  => 1,
);

$build->create_build_script;