-
Notifications
You must be signed in to change notification settings - Fork 8
/
makepackage.php
115 lines (110 loc) · 4.72 KB
/
makepackage.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
<?php
/**
* This file creates a package.xml which describes the pear package to be built.
*
* It provides the package.xml from which you can run pear package and create a
* distributable Package.tgz installable through the PEAR installer.
*
* <code>
* php makepackage.php make && pear package && pear install _______.tgz
* </code>
*
* PHP version 5
*
* @category Events
* @package UNL_UCBCN_Frontend
* @author Brett Bieber <[email protected]>
* @copyright 2009 Regents of the University of Nebraska
* @license http://www1.unl.edu/wdn/wiki/Software_License BSD License
* @link http://code.google.com/p/unl-event-publisher/
*/
ini_set('display_errors', true);
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/PackageFileManager/File.php';
require_once 'PEAR/Task/Postinstallscript/rw.php';
require_once 'PEAR/Config.php';
require_once 'PEAR/Frontend.php';
/**
* @var PEAR_PackageFileManager
*/
PEAR::setErrorHandling(PEAR_ERROR_DIE);
chdir(dirname(__FILE__));
$pfm = PEAR_PackageFileManager2::importOptions('package.xml', array(
//$pfm = new PEAR_PackageFileManager2();
//$pfm->setOptions(array(
'packagedirectory' => dirname(__FILE__),
'baseinstalldir' => '/',
'filelistgenerator' => 'svn',
'ignore' => array( 'package.xml',
'.project',
'*.tgz',
'*.sh',
'*.svg',
'makepackage.php',
'*CVS/*',
'.cache',
'install.sh',
'*tests*'),
'simpleoutput' => true,
'roles'=>array('php'=>'data'),
'exceptions'=>array('UNL/UCBCN/Frontend_setup.php'=>'php',
'UNL/UCBCN/Frontend.php'=>'php',
'UNL/UCBCN/Frontend/Month.php'=>'php',
'UNL/UCBCN/Frontend/Day.php'=>'php',
'UNL/UCBCN/Frontend/MonthWidget.php'=>'php',
'UNL/UCBCN/Frontend/NoEvents.php'=>'php',
'UNL/UCBCN/Frontend/Year.php'=>'php',
'UNL/UCBCN/Frontend/Search.php'=>'php',
'UNL/UCBCN/Frontend/Upcoming.php'=>'php',
'UNL/UCBCN/Frontend/Week.php'=>'php')
));
$pfm->setPackage('UNL_UCBCN_Frontend');
$pfm->setPackageType('php'); // this is a PEAR-style php script package
$pfm->setSummary('A public frontend for a University Event Publishing system.');
$pfm->setDescription('This class extends the UNL UCBCN backend system to create
a client frontend. It allows users to view the calendar in a list view, thirty
day view.');
$pfm->setChannel('pear.unl.edu');
$pfm->setAPIStability('beta');
$pfm->setReleaseStability('beta');
$pfm->setAPIVersion('0.8.0');
$pfm->setReleaseVersion('0.8.1');
$pfm->setNotes('
0.8.1 Changes:
Post-install script would create template directories with no permissions
resulting in "template error, examine fetch() result."
');
//$pfm->addMaintainer('lead','saltybeagle','Brett Bieber','[email protected]');
//$pfm->addMaintainer('developer','alvinwoon','Alvin Woon','[email protected]');
$pfm->setLicense('BSD License', 'http://www1.unl.edu/wdn/wiki/Software_License');
$pfm->clearDeps();
$pfm->setPhpDep('5.1.2');
$pfm->setPearinstallerDep('1.5.4');
$pfm->addPackageDepWithChannel('required', 'UNL_UCBCN', 'pear.unl.edu', '0.8.0');
$pfm->addPackageDepWithChannel('required', 'Calendar', 'pear.php.net', '0.5.3');
foreach (array('UNL/UCBCN/Frontend.php','UNL/UCBCN/Frontend_setup.php','index.php') as $file) {
$pfm->addReplacement($file, 'pear-config', '@PHP_BIN@', 'php_bin');
$pfm->addReplacement($file, 'pear-config', '@PHP_DIR@', 'php_dir');
$pfm->addReplacement($file, 'pear-config', '@DATA_DIR@', 'data_dir');
$pfm->addReplacement($file, 'pear-config', '@DOC_DIR@', 'doc_dir');
}
$config = PEAR_Config::singleton();
$log = PEAR_Frontend::singleton();
$task = new PEAR_Task_Postinstallscript_rw($pfm, $config, $log,
array('name' => 'UNL/UCBCN/Frontend_setup.php', 'role' => 'php'));
$task->addParamGroup('questionCreate', array(
$task->getParam('createtemplate', 'Create/Upgrade default templates?', 'string', 'yes'),
$task->getParam('createindex', 'Create/Upgrade sample index page?', 'string', 'yes'),
));
$task->addParamGroup('fileSetup', array(
$task->getParam('docroot', 'Path to root of webserver', 'string', '/Library/WebServer/Documents/events'),
$task->getParam('template', 'Template style to use', 'string', 'vanilla')
));
$pfm->addPostinstallTask($task, 'UNL/UCBCN/Frontend_setup.php');
$pfm->generateContents();
if (isset($_SERVER['argv']) && $_SERVER['argv'][1] == 'make') {
$pfm->writePackageFile();
} else {
$pfm->debugPackageFile();
}
?>