summaryrefslogtreecommitdiff
path: root/pear/docs/rfc01_PEAR_pecl-binaries.txt
blob: 767a4865032c6c2cf9afe1c87b5a91a7578003ec (plain)
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
Author:    Tomas V.V.Cox <cox@idecnet.com>
Revision:  $Id$
Abstract:  Open discussion on how to handle PECL binary packages


pecl package name
-----------------

The name of the extension would be:

peclfoo-bin-<OS>-<ARCH>-3.1.2.tgz

The os (Operating system) and arch (CPU type), would be the value
returned by the OS_Guess class.

package creation
----------------

pear package [-t <type>] <package>

-t <type> The type of package you want to generate (pear, rpm,
msi, src, etc)

Without args it will package the extension as it does nowadays (the
same as "-t src").

We have now native pear packages, rpm, msi is planned and others
will surely come. Additionally of generating the native package description
file, we could perhaps also call the tools for generating the whole package.

An idea would be to create in addition a BUILDINFO.txt file with some data about
the env where the extension was compiled at, like the
php version, the php_uname(), the extra libs versions, os vendor
version, pear version, etc.

package.xml
-----------

As a binary release shares the same release data with the source
distrib, the same package.xml file could be used for all kind of
distribs. Let's say something like:

<release>
         <version>...
         <date>
         <notes>
         <filelist>..
            <file role="ext" platform="">
         </filelist>
</release>

A package may contain many compiled extensions for different platforms,
one single extension or the sources.


Installation
------------

pear install -t bin peclfoo (download and install the binary distrib of
peclfoo for your current OS-ARCH)

pear install peclfoo (download, build and install peclfoo)

All the files with role="ext" would be installed
in "ext_dir" (pear cmd setting). The user can config it with "pear config-set ext_dir=XXX".
If this var is not explicitly set, the following will be used for
finding a default location:

if (getenv('PHP_PEAR_EXTENSION_DIR')) {
     define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR'));
 } else {
    if (ini_get('extension_dir')) {
        define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir'));
    } elseif (defined('PEAR_EXTENSION_DIR') && @is_dir(PEAR_EXTENSION_DIR)) {
        define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR);
    } elseif (defined('PHP_EXTENSION_DIR')) {
        define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR);
    } else {
        define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.');
    }
}

Listing in the web
------------------

A new column "Type" should be added to the release listing under the
package home page at pear.php.net, saying that the package is a binary
distrib compiled for OS X and ARCH Y or sources.