-
Notifications
You must be signed in to change notification settings - Fork 2
/
autopackage2.php
61 lines (51 loc) · 1.67 KB
/
autopackage2.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
<?php
/**
* package.xml generation file for patTemplate
*
* This file is executed by createSnaps.php to
* automatically create a package that can be
* installed via the PEAR installer.
*
* @author Stephan Schmidt <[email protected]>
* @author gERD Schaufelberger <[email protected]>
* @package patTemplate
* @subpackage Tools
*/
/**
* uses PackageFileManager
*/
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/PackageFileManager/Svn.php';
include dirname(__FILE__) . '/package-config.php';
$package = new PEAR_PackageFileManager2();
$result = $package->setOptions($options);
if (PEAR::isError($result)) {
echo $result->getMessage();
die(__LINE__ . "\n");
}
$package->setPackage($name);
$package->setSummary($summary);
$package->setDescription($description);
$package->setChannel($channel);
$package->setAPIVersion($apiVersion);
$package->setReleaseVersion($version . 'dev' . $argv[1]);
$package->setReleaseStability('devel');
$package->setAPIStability($apiStability);
$package->setNotes($notes);
$package->setPackageType('php'); // this is a PEAR-style php script package
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.txt');
foreach ($maintainer as $m) {
$package->addMaintainer($m['role'], $m['handle'], $m['name'], $m['email'], $m['active']);
}
foreach ($dependency as $d) {
$package->addPackageDepWithChannel($d['type'], $d['package'], $d['channel'], $d['version']);
}
$package->setPhpDep($require['php']);
$package->setPearinstallerDep($require['pear_installer']);
$package->generateContents();
$result = $package->writePackageFile();
if (PEAR::isError($result)) {
echo $result->getMessage();
die();
}
exit(0);