This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
/
generate-package.php
executable file
·143 lines (122 loc) · 3.35 KB
/
generate-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/php
<?php
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('date.timezone', 'Europe/Berlin');
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
function handleError($error) {
var_dump($error); exit;
}
$api_version = '0.4.1';
$api_state = 'beta';
$release_version = '0.4.1';
$release_state = 'beta';
$release_notes = "Small bugfixes:\n";
$release_notes .= "https://github.com/easybib/EasyBib_Form_Decorator/pulls?direction=desc&page=1&sort=created&state=closed\n";
$description = "EasyBib_Form Decorator supports four modes: \n"
. " * Table \n"
. " * Div \n"
. " * Twitter Bootstrap \n\n"
. " * Twitter Bootstrap Minimal \n\n"
. "The default is 'Twitter Bootstrap'.\n";
/** @var PEAR_PackageFile_v2_rw $package */
$package = new PEAR_PackageFileManager2();
$package->setOptions(
array(
'filelistgenerator' => 'file',
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagedirectory' => './',
'dir_roles' => array(
'library' => 'php',
'tests' => 'test',
'docs' => 'doc',
),
'exceptions' => array(
'README.md' => 'doc',
),
'ignore' => array(
'.git*',
'generate-package.php',
'*.tgz',
'composer.*',
'vendor/',
)
)
);
$package->setPackage('EasyBib_Form_Decorator');
$package->setSummary('A set of decorators for Zend_Form');
$package->setDescription($description);
$package->setChannel('easybib.github.com/pear');
$package->setPackageType('php');
$package->setLicense(
'Apache-2.0',
'http://www.apache.org/licenses/LICENSE-2.0'
);
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
$package->addMaintainer(
'lead',
'mischosch',
'Michael Scholl',
'michael@sch0ll.de'
);
$package->addMaintainer(
'lead',
'till',
'Till Klampaeckel',
'till@lagged.biz'
);
/**
* Generate the list of files in {@link $GLOBALS['files']}
*
* @param string $path
*
* @return void
*/
function readDirectory($path) {
foreach (glob($path . '/*') as $file) {
if (!is_dir($file)) {
$GLOBALS['files'][] = $file;
} else {
readDirectory($file);
}
}
}
$files = array();
readDirectory(__DIR__ . '/library');
/**
* @desc Strip this from the filename for 'addInstallAs'
*/
$base = __DIR__ . '/';
foreach ($files as $file) {
$file2 = str_replace($base, '', $file);
$package->addReplacement(
$file2,
'package-info',
'@package_version@',
'version'
);
$file2 = str_replace($base, '', $file);
$package->addInstallAs($file2, str_replace('library/', '', $file2));
}
$package->setPhpDep('5.2.0');
$package->addPackageDepWithChannel(
'optional',
'ZF',
'pear.zfcampus.org',
'1.10.0'
);
$package->addExtensionDep('required', 'spl');
$package->setPearInstallerDep('1.4.0a7');
$package->generateContents();
if ( isset($_GET['make'])
|| (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')
) {
$package->writePackageFile();
} else {
$package->debugPackageFile();
}