Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37865292
en ru br
ALT Linux repositórios
S:0.11.2-alt1

Group :: Desenvolvimento/Perl
RPM: perl-ph

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

pax_global_header00006660000000000000000000000064122155350470014516gustar00rootroot0000000000000052 comment=b363b9b33c99e97d68d55b982b7f9e971be10caa
ph-0.11/000075500000000000000000000000001221553504700120445ustar00rootroot00000000000000ph-0.11/.gear/000075500000000000000000000000001221553504700130405ustar00rootroot00000000000000ph-0.11/.gear/rules000064400000000000000000000000321221553504700141100ustar00rootroot00000000000000tar: . name=ph-@version@
ph-0.11/Makefile.PL000064400000000000000000000010311221553504700140110ustar00rootroot00000000000000use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'ph',
VERSION => 0.1,
PL_FILES => {
'ioctl_ph.PL' => 'ioctl.ph',
'syscall_ph.PL' => 'syscall.ph',
'sys-resource.ph.PL' => 'sys-resource.ph',
},
INST_LIB => 'blib/arch',
PM => {
'ioctl.ph' => '$(INST_LIBDIR)/ioctl.ph',
'syscall.ph' => '$(INST_LIBDIR)/syscall.ph',
'sys-resource.ph' => '$(INST_LIBDIR)/sys/resource.ph',
map { my $f = $_; s/-/\//g; $f => '$(INST_LIBDIR)/'.$_ } <*.ph>,
},
clean => { FILES => 'syscall.ph ioctl.ph sys-resource.ph' },
);
ph-0.11/h2ph.pl000064400000000000000000000043421221553504700132450ustar00rootroot00000000000000use strict;
use Config;
use File::Temp;

sub get_barewords (@) {
my @include = @_ or die "no includes";
my %barewords;
my $src = File::Temp->new(SUFFIX=>'.c',UNLINK=>0);
for (@include) {
print $src "#include <$_>\n";
}
my $cmd = "$Config{cpp} -dD $Config{cppflags} $src";
open my $pipe, "$cmd |" or die "cpp failed, check $src";
local $_;
while (<$pipe>) {
s/^\s*#\s*define\s+// || s/^\s+//;
s/^(\w\w+)(?:\s|,|=|$)// or next;
$barewords{$1} = undef;
}
close $pipe or die "cpp failed, check $src";
unlink $src;
return sort keys %barewords;
}

sub get_values ($$) {
my @include = @{ +shift };
my @names = @{ +shift };
my $src = File::Temp->new(SUFFIX=>'.c',UNLINK=>0);
print $src "#include <stdio.h>\n";
for (@include) {
print $src "#include <$_>\n";
}
print $src "int main() {\n";
for (@names) {
print $src "printf(\"$_ %ld\\n\", (long)($_));\n";
}
printf $src "return 0;\n}\n";
my $exe = File::Temp->new;
my $cmd = "@Config{'cc','ccflags','cppflags'} -o $exe $src @Config{'ldflags','perllibs'}";
system($cmd) == 0 or die "cc failed, check $src";
close $exe;
open my $pipe, "$exe |" or die "execution failed, check $src";
local $_;
my %kv;
while (<$pipe>) {
s/^(\w+)\s+(-?\d+)$// or die "bad output: $_, check $src";
$kv{$1} = $2;
}
close $pipe or die "execution failed, check $src";
unlink $src;
return %kv;
}

sub gen_h2ph {
my %args = @_;
$args{include} or die "no include";
my @include = ref($args{include})
? @{$args{include}}
: $args{include};
my $regexp = $args{regexp} or die "no regexp";
my $output = $args{output} or die "no output";
my @barewords = get_barewords(@include);
my @names = grep { $_ =~ $regexp } @barewords;
@names or die "@include: no names like $regexp";
my %kv = get_values(\@include, \@names);
%kv or die "cannot get values";
unlink $output;
open my $out, ">$output" or die "$output: $!";
print $out <<EOF;
# Automatically generated, do not edit.
use strict;
no warnings 'redefine';
EOF
for my $k (sort keys %kv) {
my $v = $kv{$k};
print $out "sub $k () { $v }\n";
}
print $out "1;\n";
close $out or die "$output: $!\n";
}

1;
ph-0.11/ioctl_ph.PL000064400000000000000000000004341221553504700141030ustar00rootroot00000000000000use strict;
require "./h2ph.pl";
gen_h2ph(
include => ["asm/termbits.h", "sys/ioctl.h"],
regexp => qr/^FIO|^TC|^TIO|^SIO/,
output => "ioctl.ph",
);
require "./ioctl.ph";
defined &TIOCGWINSZ or die "TIOCGWINSZ not defined";
defined &FIONREAD or die "FIONREAD not defined";
ph-0.11/perl-ph.spec000064400000000000000000000014731221553504700142740ustar00rootroot00000000000000%define dist ph
Name: perl-%dist
Version: 0.11
Release: alt1

Summary: Perl *.ph files
License: GPL or Artistic
Group: Development/Perl

URL: %CPAN %dist
Source: %dist-%version.tar

# Automatically added by buildreq on Sun Sep 19 2010
BuildRequires: perl-devel

%description
This package provides the following Perl header files.

ioctl.ph sys/ioctl.ph
syscall.ph sys/syscall.ph
syslog.ph sys/syslog.ph
socket.ph sys/socket.ph
sys/resource.ph

%prep
%setup -q -n %dist-%version

%build
%perl_vendor_build

%install
%perl_vendor_install

%files
%perl_vendor_archlib/*.ph
%dir %perl_vendor_archlib/sys
%perl_vendor_archlib/sys/*.ph

%changelog
* Mon Sep 16 2013 Vladimir Lettiev <crux@altlinux.ru> 0.11-alt1
- added sys/resource.ph perl header

* Sun Sep 19 2010 Alexey Tourbin <at@altlinux.ru> 0.10-alt1
- separate package
ph-0.11/socket.ph000064400000000000000000000000301221553504700136560ustar00rootroot00000000000000use Socket qw(:all);
1;
ph-0.11/sys-ioctl.ph000064400000000000000000000000241221553504700143170ustar00rootroot00000000000000require "ioctl.ph";
ph-0.11/sys-resource.ph.PL000064400000000000000000000005341221553504700153540ustar00rootroot00000000000000use strict;
require "./h2ph.pl";
gen_h2ph(
include => "sys/resource.h",
regexp => qr/^PRIO_|^RLIM_|^RUSAGE_|^RLIMIT_/,
output => "sys-resource.ph",
);
require "./sys-resource.ph";
defined &RLIMIT_AS or die "RLIMIT_AS not defined";
defined &PRIO_MAX or die "PRIO_MAX not defined";
defined &RUSAGE_SELF or die "RUSAGE_SELF not defined";
ph-0.11/sys-socket.ph000064400000000000000000000000251221553504700144760ustar00rootroot00000000000000require "socket.ph";
ph-0.11/sys-syscall.ph000064400000000000000000000000261221553504700146610ustar00rootroot00000000000000require "syscall.ph";
ph-0.11/sys-syslog.ph000064400000000000000000000000251221553504700145260ustar00rootroot00000000000000require "syslog.ph";
ph-0.11/syscall_ph.PL000064400000000000000000000005121221553504700144400ustar00rootroot00000000000000use strict;
require "./h2ph.pl";
gen_h2ph(
include => "sys/syscall.h",
regexp => qr/^SYS_|^NR_sys/,
output => "syscall.ph",
);
require "./syscall.ph";
defined &SYS_sync or die "SYS_sync not defined";
defined &SYS_statfs or die "SYS_statfs not defined";
defined &SYS_gettimeofday or die "SYS_gettimeofday not defined";
ph-0.11/syslog.ph000064400000000000000000000004361221553504700137200ustar00rootroot00000000000000use Sys::Syslog 0.11 qw(:macros);
*_PATH_LOG = \&Sys::Syslog::_PATH_LOG;
# grep ^LOG_ Syslog.xs
*LOG_FAC = \&Sys::Syslog::LOG_FAC;
*LOG_MAKEPRI = \&Sys::Syslog::LOG_MAKEPRI;
*LOG_MASK = \&Sys::Syslog::LOG_MASK;
*LOG_PRI = \&Sys::Syslog::LOG_PRI;
*LOG_UPTO = \&Sys::Syslog::LOG_UPTO;
1;
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009