This repository has been archived by the owner on Dec 6, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
package.php
78 lines (67 loc) · 2.31 KB
/
package.php
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
<?php
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$desc = <<<EOT
This extension allows the Python interpreter to be embedded inside of PHP, allowing for the instantiate and manipulation of Python objects from within PHP.
EOT;
$version = '0.9.0a';
$notes = <<<EOT
- Each request now has its own, private interpreter state.
- The new "python.optimize" INI setting controls Python's optimization level.
- Python's sys.stdout and sys.stderr streams are now intercepted.
- Python Unicode strings are now converted to UTF8-encoded PHP strings.
- Added a new php.call() Python function for calling PHP functions.
EOT;
$package = new PEAR_PackageFileManager2();
$result = $package->setOptions(array(
'filelistgenerator' => 'cvs',
'changelogoldtonew' => false,
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagefile' => 'package.xml',
'packagedirectory' => '.',
'clearcontents' => true,
'ignore' => array('package.php', 'package.xml'),
'dir_roles' => array(
'docs' => 'doc',
'examples' => 'doc',
'tests' => 'test',
),
'exceptions' => array(
'CREDITS' => 'doc',
'EXPERIMENTAL' => 'doc',
'LICENSE' => 'doc',
'TODO' => 'doc',
),
));
if (PEAR::isError($result)) {
echo $result->getMessage();
die();
}
$package->clearDeps();
$package->setPackage('python');
$package->setPackageType('extsrc');
$package->setSummary('Embedded Python');
$package->setDescription($desc);
$package->setChannel('pecl.php.net');
$package->setLicense('MIT License');
$package->addMaintainer('lead', 'jon', 'Jon Parise', '[email protected]');
$package->addRelease();
$package->setProvidesExtension('python');
$package->setAPIVersion('0.6.0');
$package->setAPIStability('alpha');
$package->setReleaseVersion($version);
$package->setReleaseStability('alpha');
$package->setNotes($notes);
$package->setPhpDep('5.3.0');
$package->setPearInstallerDep('1.4.3');
$package->generateContents();
if ($_SERVER['argv'][1] == 'commit') {
$result = $package->writePackageFile();
} else {
$result = $package->debugPackageFile();
}
if (PEAR::isError($result)) {
echo $result->getMessage();
die();
}