2004-04-03 06:39:47 +02:00
|
|
|
<?php
|
2009-06-15 00:57:58 +02:00
|
|
|
# $NetBSD: pear_plist.php,v 1.7 2009/06/14 22:58:02 joerg Exp $
|
2004-04-03 06:39:47 +02:00
|
|
|
# Parses package XML file and outputs appropriate PLIST
|
|
|
|
|
|
|
|
$PEAR_LIB = getenv('PEAR_LIB');
|
|
|
|
$WRKSRC = getenv('WRKSRC');
|
|
|
|
$PEAR_DIRRM_BASEDIR = getenv('PEAR_DIRRM_BASEDIR');
|
2009-01-19 20:55:02 +01:00
|
|
|
$PEAR_DIRRM_EXCLUDE = getenv('PEAR_DIRRM_EXCLUDE');
|
2004-04-03 06:39:47 +02:00
|
|
|
$dirrm = array();
|
|
|
|
|
|
|
|
include_once "PEAR/Common.php";
|
|
|
|
$obj = &new PEAR_Common;
|
|
|
|
$info = $obj->infoFromAny("$WRKSRC/package.xml");
|
|
|
|
|
2007-04-15 15:46:42 +02:00
|
|
|
if (!empty($info['attribs']) && $info['attribs']['version'] == '2.0')
|
|
|
|
$pkg = $info['name'];
|
|
|
|
else
|
|
|
|
$pkg = $info['package'];
|
|
|
|
|
|
|
|
# output list of package files, in same order as specified in package
|
2004-04-03 06:39:47 +02:00
|
|
|
echo "$PEAR_LIB/.registry/".strtolower($pkg).".reg\n";
|
|
|
|
foreach($info['filelist'] as $f => $v) {
|
|
|
|
switch($v['role']) {
|
|
|
|
case 'test':
|
|
|
|
case 'doc':
|
2004-11-01 21:31:13 +01:00
|
|
|
case 'data':
|
2004-04-03 06:39:47 +02:00
|
|
|
$prefix = "$v[role]/$pkg/";
|
|
|
|
$dirrm["$v[role]/$pkg"] = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'php':
|
|
|
|
default:
|
|
|
|
if (!empty($v['baseinstalldir']) && $v['baseinstalldir'] != '/') {
|
|
|
|
$prefix = $v['baseinstalldir'] . '/';
|
|
|
|
|
2007-04-15 15:46:42 +02:00
|
|
|
# sometimes the baseinstalldir begins with a slash,
|
2007-10-09 21:19:08 +02:00
|
|
|
# which make the PLIST output to have two instead of
|
2007-04-15 15:46:42 +02:00
|
|
|
# one. We fix this here.
|
|
|
|
if ($prefix[0] == '/')
|
|
|
|
$prefix = substr($prefix, 1);
|
|
|
|
|
2004-04-03 06:39:47 +02:00
|
|
|
if ($PEAR_DIRRM_BASEDIR)
|
|
|
|
$dirrm[$v['baseinstalldir']] = true;
|
|
|
|
} else
|
|
|
|
$prefix = '';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-11-01 21:17:20 +01:00
|
|
|
# replace backslashes with forward slashes in the path name, for
|
|
|
|
# pear packages written by non-UNIX oriented authors.
|
|
|
|
$f = str_replace('\\', '/', $f);
|
2004-04-03 06:39:47 +02:00
|
|
|
|
|
|
|
echo "{$PEAR_LIB}/{$prefix}{$f}\n";
|
|
|
|
|
|
|
|
while(($f = dirname($f)) && $f != '.')
|
|
|
|
$dirrm["{$prefix}{$f}"] = true;
|
|
|
|
}
|
|
|
|
?>
|