├── .gitignore ├── README.maintainer.md ├── build-and-upload.sh ├── build-php.pl ├── build-php.sh ├── deletePeclSources.sh ├── extras ├── common │ └── package │ │ ├── .gitignore │ │ ├── Description.plist │ │ ├── Info.plist │ │ └── resources │ │ └── background.tif ├── gettext │ └── gettext.patch ├── iconv │ └── leopard-iconv-include-override │ │ └── iconv.h ├── imap │ ├── README │ └── c-client.tar.Z.2004g └── php5 │ ├── disable_pdo_oci_lib_check.patch │ ├── dist │ ├── activate-entropy-php.py │ └── entropy-php.conf │ ├── package │ ├── .gitignore │ ├── Description.plist │ ├── Info.plist │ └── resources │ │ ├── background.tif │ │ └── postflight │ ├── php-configure-time-endianness-check-fix.c │ ├── php-entropy-imap.patch │ └── php-entropy.patch ├── lib ├── Config.pm ├── Imports.pm ├── Obj.pm ├── Package.pm ├── Package │ ├── apc.pm │ ├── apcu.pm │ ├── bytekit.pm │ ├── curl.pm │ ├── gettext.pm │ ├── gmp.pm │ ├── iconv.pm │ ├── icu.pm │ ├── idn.pm │ ├── igbinary.pm │ ├── imapcclient.pm │ ├── intl.pm │ ├── libevent.pm │ ├── libfreetype.pm │ ├── libgif.pm │ ├── libiodbc.pm │ ├── libjpeg.pm │ ├── libmemcached.pm │ ├── libpng.pm │ ├── libssh2.pm │ ├── libtiff.pm │ ├── libxml2.pm │ ├── libxslt.pm │ ├── mcrypt.pm │ ├── memcache.pm │ ├── memcached.pm │ ├── mhash.pm │ ├── mongodb.pm │ ├── mssql.pm │ ├── mysql.pm │ ├── oauth.pm │ ├── openssl.pm │ ├── pearbase.pm │ ├── pecl_http.pm │ ├── peclbase.pm │ ├── php5.pm │ ├── phpunit.pm │ ├── postgresql.pm │ ├── propro.pm │ ├── raphf.pm │ ├── readline.pm │ ├── redis.pm │ ├── solr.pm │ ├── ssh2.pm │ ├── tidy.pm │ ├── twig.pm │ ├── uploadprogress.pm │ ├── xdebug.pm │ ├── xhprof.pm │ ├── xslcache.pm │ └── yaml.pm ├── PackageBase.pm ├── PackageBinary.pm ├── PackageSplice.pm ├── PackageSystemProvided.pm └── UBSplicer.pm └── test ├── httpd ├── conf │ └── httpd.conf └── serverroot │ ├── .gitignore │ └── documentroot │ ├── favicon.ico │ ├── index.php │ ├── test-domxml.php │ ├── test-mcrypt.php │ ├── test-mhash.php │ ├── test-mysql.php │ ├── test-openssl.php │ └── test-sum.php ├── run-test.pl ├── run-test.sh ├── tail-test-logs.sh ├── test-mysqld-start.sh └── test-mysqld-stop.sh /.gitignore: -------------------------------------------------------------------------------- 1 | 5b33c259792bac72411502642d67ff74bffb76f5 2 | download 3 | src 4 | create_package.sh 5 | .svn 6 | deploy 7 | HOW_TO_RELEASE -------------------------------------------------------------------------------- /README.maintainer.md: -------------------------------------------------------------------------------- 1 | # how to build new packages and upload to php-osx.liip.ch 2 | 3 | The best thing is to have virtual machines with OS X 10.6 and OS X 10.8 with just the needed tools installed. This is mainly XCode from the AppStore, but additionally I installed homebrew with the following packages: 4 | 5 | autoconf automake bash-completion git rpl wget 6 | 7 | (If you're at Liip ask chregu for the images) 8 | 9 | Then checkout 10 | 11 | git clone git@github.com:liip/build-entropy-php.git 12 | and 13 | 14 | git clone git@github.com:liip/php-osx.git 15 | 16 | preferably in the same parent directory. 17 | 18 | Now go into the build-entropy-php directory, checkout a branch and try compiling it with 19 | 20 | sudo bash build-php.sh 21 | 22 | this may take a while (up to an hour the first time). 23 | 24 | For another branch, clean the build with 25 | 26 | sudo bash deletePeclSources.sh 27 | 28 | This will delete all PHP stuff and the extensions, so that you don't have to recompile everything (like icu und libxml) for the next run, if you want a totally clean build, delete /usr/local/php5 and src/* as well. 29 | 30 | When you're finished compiling, go to the _php-osx_ directory and call 31 | 32 | bash create_package.sh 33 | 34 | This should package and upload all necesseary files. 35 | 36 | ## The branches 37 | 38 | We currently support four PHP versions, 5.3, 5.4, 5.5 and 5.6. Unfortunately I wasn't able to have a compilation process which can target 10.6, 10.7 and 10.8/9 and 10.10. Therefor you have to compile every version twice. Once for 10.6/7 and once for 10.8, on two different virtual machines with 10.6 and 10.8 (we may ditch older OS Versions one day, and I don't update 10.6/7 every time) 39 | 40 | The in total 10 branches are 41 | 42 | * 5_3_snowleopard (end of life) 43 | * 5_4_snowleopard 44 | * 5_5_snowleopard 45 | * 5_3_mountainlion (end of life) 46 | * 5_4_mountainlion 47 | * 5_5_mountainlion 48 | * 5_6_mountainlion 49 | * 5_4_yosemite 50 | * 5_5_yosemite 51 | * 5_6_yosemite 52 | 53 | Since 5.3 is end of life, we don't upgrade that anymore, except for very special reasons 54 | 55 | ## Doing a new PHP version 56 | 57 | If there's a new PHP version (watch http://php.net/), then you have to do the following 58 | 59 | * checkout the right branch in _build-entropy-php_ 60 | * adjust the config variable "version" in build-php.pl to the new version (around line 40) 61 | * run _sudo bash deletePeclSources.sh_ 62 | * run _sudo bash build-php.sh_ 63 | * go to _../php-osx/_ and run _bash create_package.sh_ 64 | * repeat for every major version and on both OS 65 | 66 | ## Merging stuff 67 | 68 | If you change something besides the PHP version number, you have to be careful with merging it correctly. Don't just change it in every branch and commit, do it the following way (idea taken from https://wiki.php.net/vcs/gitworkflow) 69 | 70 | First, make the adjustements in the _5_5_mountainlion_ branch, commit it and then 71 | 72 | git checkout 5_6_mountainlion 73 | git merge --log --no-ff 5_5_mountainlion 74 | 75 | and on 10.6, we merge from the same PHP version branch from the mountainlion branches (not from the version "below") 76 | 77 | git checkout 5_5_snowleopard 78 | git merge --log --no-ff origin/5_5_mountainlion 79 | 80 | and the same for 10.10 81 | 82 | git checkout 5_5_yosemite 83 | git merge --log --no-ff origin/5_5_mountainlion 84 | git checkout 5_6_yosemite 85 | git merge --log --no-ff origin/5_6_mountainlion 86 | git checkout 7_0_yosemite 87 | git merge --log --no-ff origin/5_6_yosemite 88 | 89 | 90 | This way, we can keep the logs somehow clean and can make sure, everything is merged correctly and everywhere. 91 | 92 | This makes for noisy logs somehow, but with 93 | 94 | git log --no-merges 95 | 96 | it suddenly is much clearer again (or even better in pretty colors: 97 | 98 | git log --graph --pretty=format:'%Cred%h%Creset %C(cyan)%an%Creset -%C(blue)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --no-merges 99 | 100 | ) 101 | 102 | 103 | ## Community feedback and communication 104 | 105 | ### Twitter 106 | 107 | * Tweet as @php_osx, if you do a new release 108 | * Follow on twitter, if someone mentions @php_osx and asks for something 109 | 110 | ### Github 111 | 112 | * Watch https://github.com/liip/php-osx/issues for new issues 113 | 114 | ### Stackoverflow 115 | 116 | * Check http://stackoverflow.com/questions/tagged/php+osx from time to time, if there are any questions there. 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /build-and-upload.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | bash deletePeclSources.sh 4 | bash build-php.sh 5 | cd ../php-osx 6 | bash create_package.sh 7 | 8 | -------------------------------------------------------------------------------- /build-php.pl: -------------------------------------------------------------------------------- 1 | # Main driver script for the PHP build process 2 | # 3 | # Invoke with 4 | # sudo perl -Ilib build-php.pl 5 | # 6 | 7 | use strict; 8 | use warnings; 9 | 10 | use Imports; 11 | use Package::php5; 12 | use Package::xdebug; 13 | use Package::uploadprogress; 14 | use Package::libmemcached; 15 | use Package::libevent; 16 | use Package::intl; 17 | use Package::memcached; 18 | #use Package::memcache; 19 | use Package::xhprof; 20 | use Package::twig; 21 | use Package::APC; 22 | use Package::solr; 23 | use Package::oauth; 24 | use Package::xslcache; 25 | #use Package::yaml; 26 | use Package::mongodb; 27 | use Package::redis; 28 | use Package::propro; 29 | use Package::raphf; 30 | use Package::pecl_http; 31 | use Package::apcu; 32 | use Package::igbinary; 33 | #use Package::phpunit; 34 | use Package::libssh2; 35 | use Package::ssh2; 36 | 37 | my $basedir = qx(pwd); 38 | chomp $basedir; 39 | die "you must run this script in the build-entropy-php directory" unless ($basedir =~ m#/build-entropy-php$#); 40 | 41 | check_dotpear(); 42 | check_arch(); 43 | check_ltdl(); 44 | 45 | # putting cpus to 1 to disable parallel builds because it breaks libxml2 build 46 | my $config = Config->new( 47 | cpus => 2, 48 | basedir => $basedir, 49 | prefix => '/usr/local/php5', 50 | phpsrcdir => undef, 51 | orahome => "$basedir/install", 52 | mysql_install_prefix => undef, 53 | variants => { 54 | apache1 => { 55 | apxs_option => '--with-apxs', 56 | suffix => '', 57 | }, 58 | apache2 => { 59 | apxs_option => '--with-apxs2=/usr/sbin/apxs', 60 | suffix => '-apache2', 61 | }, 62 | }, 63 | version => '7.0.31', 64 | release => 1, 65 | debug => 0, 66 | ); 67 | my $php = Package::php5->new(config => $config, variant => 'apache2'); 68 | $config->{phpsrcdir} = $php->packagesrcdir(); 69 | $php->install(); 70 | 71 | my $xdebug = Package::xdebug->new(config => $config, variant => 'apache2'); 72 | $xdebug->install(); 73 | 74 | # TODO: adjust for 7.0 75 | #my $upload = Package::uploadprogress->new(config => $config, variant => 'apache2'); 76 | #$upload->install(); 77 | 78 | my $intl = Package::intl->new(config => $config, variant => 'apache2'); 79 | $intl->install(); 80 | 81 | # TODO: adjust for 7.0 82 | my $memcached = Package::memcached->new(config => $config, variant => 'apache2'); 83 | $memcached->install(); 84 | 85 | # TODO: adjust for 7.0 86 | #my $xhprof = Package::xhprof->new(config => $config, variant => 'apache2'); 87 | #$xhprof->install(); 88 | 89 | # TODO: adjust for 7.0 90 | #my $twig = Package::twig->new(config => $config, variant => 'apache2'); 91 | #$twig->install(); 92 | 93 | #my $APC = Package::APC->new(config => $config, variant => 'apache2'); 94 | #$APC->install(); 95 | 96 | # TODO: adjust for 7.0 97 | my $solr = Package::solr->new(config => $config, variant => 'apache2'); 98 | $solr->install(); 99 | 100 | # TODO: adjust for 7.0 101 | #my $oauth = Package::oauth->new(config => $config, variant => 'apache2'); 102 | #$oauth->install(); 103 | 104 | #my $xslcache = Package::xslcache->new(config => $config, variant => 'apache2'); 105 | #$xslcache->install(); 106 | 107 | # Needs libYAML to be integrated as well, left for later 108 | #my $yaml = Package::yaml->new(config => $config, variant => 'apache2'); 109 | #$yaml->install(); 110 | 111 | 112 | # TODO: adjust for 7.0 113 | my $mongodb = Package::mongodb->new(config => $config, variant => 'apache2'); 114 | $mongodb->install(); 115 | 116 | my $redis = Package::redis->new(config => $config, variant => 'apache2'); 117 | $redis->install(); 118 | 119 | my $propro = Package::propro->new(config => $config, variant => 'apache2'); 120 | $propro->install(); 121 | 122 | my $raphf = Package::raphf->new(config => $config, variant => 'apache2'); 123 | $raphf->install(); 124 | 125 | my $pecl_http = Package::pecl_http->new(config => $config, variant => 'apache2'); 126 | $pecl_http->install(); 127 | 128 | my $apcu = Package::apcu->new(config => $config, variant => 'apache2'); 129 | $apcu->install(); 130 | 131 | # TODO: adjust for 7.0 132 | my $igbinary = Package::igbinary->new(config => $config, variant => 'apache2'); 133 | $igbinary->install(); 134 | 135 | # TODO: adjust for 7.0 136 | my $libssh2 = Package::libssh2->new(config => $config, variant => 'apache2'); 137 | $libssh2->install(); 138 | 139 | # TODO: adjust for 7.0 140 | my $ssh2 = Package::ssh2->new(config => $config, variant => 'apache2'); 141 | $ssh2->install(); 142 | 143 | #my $phpunit = Package::phpunit->new(config => $config, variant => 'apache2'); 144 | #$phpunit->install(); 145 | 146 | # If there is a ~/.pear directory, "make install-pear" will not work properly 147 | sub check_dotpear { 148 | if (-e "$ENV{HOME}/.pear" || -e "$ENV{HOME}/.pearrc") { 149 | die "There is a ~/.pear directory and/or ~/.pearrc file, please move it aside temporarily for the build\n"; 150 | } 151 | } 152 | 153 | # If Xcode is installed then the mcrypt extension build picks up libltdl, 154 | # which will be missing on target systems without Xcode. 155 | sub check_ltdl { 156 | if (glob('/usr/lib/libltdl.*')) { 157 | die "/usr/lib/libltdl.* files are present on this system but will be missing on target systems, please move them aside temporarily for the build:\nsudo mkdir -p /usr/lib/off && sudo mv /usr/lib/libltdl.* /usr/lib/off/\n"; 158 | } 159 | if (glob('/usr/local/lib/libltdl.*')) { 160 | die "/usr/local/lib/libltdl.* files are present on this system but will be missing on target systems, please move them aside temporarily for the build\n"; 161 | } 162 | } 163 | 164 | # if we don't build on x86_64, the resulting mcrypt extension will 165 | # work on i386 but crash on x86_64 166 | sub check_arch { 167 | my $x86_64 = `sysctl -n hw.optional.x86_64`; chomp $x86_64; 168 | unless ($x86_64) { 169 | die "This build process must be run on an x86_64 architecture system\n"; 170 | } 171 | } 172 | 173 | -------------------------------------------------------------------------------- /build-php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export YACC="/usr/local/Cellar/bison/3.0.2/bin/bison -y" 3 | rm -rf /tmp/build-entropy-php-pkg/php5/ /tmp/build-entropy-php-pkgdst/entropy-php.pkg 4 | nice -n 19 perl -Ilib build-php.pl && git diff 5 | -------------------------------------------------------------------------------- /deletePeclSources.sh: -------------------------------------------------------------------------------- 1 | for i in `find src -name config.nice -maxdepth 4` 2 | do 3 | echo `dirname $i` 4 | rm -rf `dirname $i` 5 | done 6 | 7 | 8 | for i in `ls -d src/xhprof*` 9 | do 10 | echo $i 11 | rm -rf $i 12 | done 13 | 14 | for i in `ls -d src/php-*` 15 | do 16 | echo $i 17 | rm -rf $i 18 | done 19 | 20 | rm -rf download/php-* 21 | rm -rf download/master.tar.gz 22 | 23 | rm ~/.pearrc 24 | 25 | rm /usr/local/php5/libphp5.so 26 | rm /usr/local/php5/libphp7.so 27 | rm -rf /usr/local/php5/lib/php 28 | rm -rf /usr/local/php5/php.d/ 29 | rm -rf /usr/local/php5/bin/php* 30 | 31 | -------------------------------------------------------------------------------- /extras/common/package/.gitignore: -------------------------------------------------------------------------------- 1 | /*.out 2 | -------------------------------------------------------------------------------- /extras/common/package/Description.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IFPkgDescriptionTitle 6 | PHP Extension {shortname} 7 | IFPkgDescriptionDescription 8 | PHP Extension {shortname} 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /extras/common/package/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | ch.entropy.php.extension.{shortname} 7 | CFBundleName 8 | Entropy PHP {shortname} Extension 9 | CFBundleGetInfoString 10 | Entropy PHP Extension {shortname} {version}-{release} 11 | CFBundleShortVersionString 12 | {version} 13 | IFPkgFlagAuthorizationAction 14 | RootAuthorization 15 | IFPkgFlagDefaultLocation 16 | {prefix} 17 | IFPkgFlagFollowLinks 18 | 19 | IFPkgFlagInstallFat 20 | 21 | IFPkgFormatVersion 22 | 0.10000000149011612 23 | IFPkgFlagInstalledSize 24 | 0 25 | 26 | 27 | -------------------------------------------------------------------------------- /extras/common/package/resources/background.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liip/build-entropy-php/747a4664b116641a7b623b39b4dd71ccf565430a/extras/common/package/resources/background.tif -------------------------------------------------------------------------------- /extras/gettext/gettext.patch: -------------------------------------------------------------------------------- 1 | --- a/gettext-tools/gnulib-lib/stpncpy.c.orig 2007-10-07 23:29:35.000000000 +0300 2 | +++ b/gettext-tools/gnulib-lib/stpncpy.c 2011-03-11 23:34:40.000000000 +0200 3 | @@ -24,7 +24,7 @@ 4 | #include 5 | 6 | #ifndef weak_alias 7 | -# define __stpncpy stpncpy 8 | +//# define __stpncpy stpncpy 9 | #endif 10 | 11 | /* Copy no more than N bytes of SRC to DST, returning a pointer past the -------------------------------------------------------------------------------- /extras/iconv/leopard-iconv-include-override/iconv.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1999-2003, 2005-2006 Free Software Foundation, Inc. 2 | This file is part of the GNU LIBICONV Library. 3 | 4 | The GNU LIBICONV Library is free software; you can redistribute it 5 | and/or modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | The GNU LIBICONV Library is distributed in the hope that it will be 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. 16 | If not, write to the Free Software Foundation, Inc., 51 Franklin Street, 17 | Fifth Floor, Boston, MA 02110-1301, USA. */ 18 | 19 | /* When installed, this file is called "iconv.h". */ 20 | 21 | #ifndef _LIBICONV_H 22 | #define _LIBICONV_H 23 | 24 | #define _LIBICONV_VERSION 0x010B /* version number: (major<<8) + minor */ 25 | 26 | #if 1 && BUILDING_LIBICONV 27 | #define LIBICONV_DLL_EXPORTED __attribute__((__visibility__("default"))) 28 | #else 29 | #define LIBICONV_DLL_EXPORTED 30 | #endif 31 | extern LIBICONV_DLL_EXPORTED int _libiconv_version; /* Likewise */ 32 | 33 | /* We would like to #include any system header file which could define 34 | iconv_t, 1. in order to eliminate the risk that the user gets compilation 35 | errors because some other system header file includes /usr/include/iconv.h 36 | which defines iconv_t or declares iconv after this file, 2. when compiling 37 | for LIBICONV_PLUG, we need the proper iconv_t type in order to produce 38 | binary compatible code. 39 | But gcc's #include_next is not portable. Thus, once libiconv's iconv.h 40 | has been installed in /usr/local/include, there is no way any more to 41 | include the original /usr/include/iconv.h. We simply have to get away 42 | without it. 43 | Ad 1. The risk that a system header file does 44 | #include "iconv.h" or #include_next "iconv.h" 45 | is small. They all do #include . 46 | Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It 47 | has to be a scalar type because (iconv_t)(-1) is a possible return value 48 | from iconv_open().) */ 49 | 50 | /* Define iconv_t ourselves. */ 51 | #undef iconv_t 52 | #define iconv_t libiconv_t 53 | typedef void* iconv_t; 54 | 55 | /* Get size_t declaration. 56 | Get wchar_t declaration if it exists. */ 57 | #include 58 | 59 | /* Get errno declaration and values. */ 60 | #include 61 | /* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS, 62 | have EILSEQ in a different header. On these systems, define EILSEQ 63 | ourselves. */ 64 | #ifndef EILSEQ 65 | #define EILSEQ 66 | #endif 67 | 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | 74 | /* Allocates descriptor for code conversion from encoding `fromcode' to 75 | encoding `tocode'. */ 76 | #ifndef LIBICONV_PLUG 77 | #define iconv_open libiconv_open 78 | #endif 79 | extern LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode); 80 | 81 | /* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes 82 | starting at `*inbuf', writing at most `*outbytesleft' bytes starting at 83 | `*outbuf'. 84 | Decrements `*inbytesleft' and increments `*inbuf' by the same amount. 85 | Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */ 86 | #ifndef LIBICONV_PLUG 87 | #define iconv libiconv 88 | #endif 89 | extern LIBICONV_DLL_EXPORTED size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft); 90 | 91 | /* Frees resources allocated for conversion descriptor `cd'. */ 92 | #ifndef LIBICONV_PLUG 93 | #define iconv_close libiconv_close 94 | #endif 95 | extern LIBICONV_DLL_EXPORTED int iconv_close (iconv_t cd); 96 | 97 | 98 | #ifndef LIBICONV_PLUG 99 | 100 | /* Nonstandard extensions. */ 101 | 102 | /* Control of attributes. */ 103 | #define iconvctl libiconvctl 104 | extern LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument); 105 | 106 | /* Hook performed after every successful conversion of a Unicode character. */ 107 | typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data); 108 | /* Hook performed after every successful conversion of a wide character. */ 109 | typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data); 110 | /* Set of hooks. */ 111 | struct iconv_hooks { 112 | iconv_unicode_char_hook uc_hook; 113 | iconv_wide_char_hook wc_hook; 114 | void* data; 115 | }; 116 | 117 | /* Fallback function. Invoked when a small number of bytes could not be 118 | converted to a Unicode character. This function should process all 119 | bytes from inbuf and may produce replacement Unicode characters by calling 120 | the write_replacement callback repeatedly. */ 121 | typedef void (*iconv_unicode_mb_to_uc_fallback) 122 | (const char* inbuf, size_t inbufsize, 123 | void (*write_replacement) (const unsigned int *buf, size_t buflen, 124 | void* callback_arg), 125 | void* callback_arg, 126 | void* data); 127 | /* Fallback function. Invoked when a Unicode character could not be converted 128 | to the target encoding. This function should process the character and 129 | may produce replacement bytes (in the target encoding) by calling the 130 | write_replacement callback repeatedly. */ 131 | typedef void (*iconv_unicode_uc_to_mb_fallback) 132 | (unsigned int code, 133 | void (*write_replacement) (const char *buf, size_t buflen, 134 | void* callback_arg), 135 | void* callback_arg, 136 | void* data); 137 | #if 1 138 | /* Fallback function. Invoked when a number of bytes could not be converted to 139 | a wide character. This function should process all bytes from inbuf and may 140 | produce replacement wide characters by calling the write_replacement 141 | callback repeatedly. */ 142 | typedef void (*iconv_wchar_mb_to_wc_fallback) 143 | (const char* inbuf, size_t inbufsize, 144 | void (*write_replacement) (const wchar_t *buf, size_t buflen, 145 | void* callback_arg), 146 | void* callback_arg, 147 | void* data); 148 | /* Fallback function. Invoked when a wide character could not be converted to 149 | the target encoding. This function should process the character and may 150 | produce replacement bytes (in the target encoding) by calling the 151 | write_replacement callback repeatedly. */ 152 | typedef void (*iconv_wchar_wc_to_mb_fallback) 153 | (wchar_t code, 154 | void (*write_replacement) (const char *buf, size_t buflen, 155 | void* callback_arg), 156 | void* callback_arg, 157 | void* data); 158 | #else 159 | /* If the wchar_t type does not exist, these two fallback functions are never 160 | invoked. Their argument list therefore does not matter. */ 161 | typedef void (*iconv_wchar_mb_to_wc_fallback) (); 162 | typedef void (*iconv_wchar_wc_to_mb_fallback) (); 163 | #endif 164 | /* Set of fallbacks. */ 165 | struct iconv_fallbacks { 166 | iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback; 167 | iconv_unicode_uc_to_mb_fallback uc_to_mb_fallback; 168 | iconv_wchar_mb_to_wc_fallback mb_to_wc_fallback; 169 | iconv_wchar_wc_to_mb_fallback wc_to_mb_fallback; 170 | void* data; 171 | }; 172 | 173 | /* Requests for iconvctl. */ 174 | #define ICONV_TRIVIALP 0 /* int *argument */ 175 | #define ICONV_GET_TRANSLITERATE 1 /* int *argument */ 176 | #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */ 177 | #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */ 178 | #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */ 179 | #define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */ 180 | #define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */ 181 | 182 | /* Listing of locale independent encodings. */ 183 | #define iconvlist libiconvlist 184 | extern LIBICONV_DLL_EXPORTED void iconvlist (int (*do_one) (unsigned int namescount, 185 | const char * const * names, 186 | void* data), 187 | void* data); 188 | 189 | /* Canonicalize an encoding name. 190 | The result is either a canonical encoding name, or name itself. */ 191 | extern LIBICONV_DLL_EXPORTED const char * iconv_canonicalize (const char * name); 192 | 193 | /* Support for relocatable packages. */ 194 | 195 | /* Sets the original and the current installation prefix of the package. 196 | Relocation simply replaces a pathname starting with the original prefix 197 | by the corresponding pathname with the current prefix instead. Both 198 | prefixes should be directory names without trailing slash (i.e. use "" 199 | instead of "/"). */ 200 | extern LIBICONV_DLL_EXPORTED void libiconv_set_relocation_prefix (const char *orig_prefix, 201 | const char *curr_prefix); 202 | 203 | #endif 204 | 205 | 206 | #ifdef __cplusplus 207 | } 208 | #endif 209 | 210 | 211 | #endif /* _LIBICONV_H */ 212 | -------------------------------------------------------------------------------- /extras/imap/README: -------------------------------------------------------------------------------- 1 | we keep the 2004g version around here because currently the PHP5 IMAP extension doesn't seem to build with the new 2006a version 2 | -------------------------------------------------------------------------------- /extras/imap/c-client.tar.Z.2004g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liip/build-entropy-php/747a4664b116641a7b623b39b4dd71ccf565430a/extras/imap/c-client.tar.Z.2004g -------------------------------------------------------------------------------- /extras/php5/disable_pdo_oci_lib_check.patch: -------------------------------------------------------------------------------- 1 | diff -ru php-5.2.4RC2.ORIG/ext/pdo_oci/config.m4 php-5.2.4RC2/ext/pdo_oci/config.m4 2 | --- php-5.2.4RC2.ORIG/ext/pdo_oci/config.m4 2007-08-14 14:15:04.000000000 +0200 3 | +++ php-5.2.4RC2/ext/pdo_oci/config.m4 2007-08-19 11:46:31.000000000 +0200 4 | @@ -78,7 +78,7 @@ 5 | AC_MSG_RESULT([yes]) 6 | fi 7 | 8 | - AC_PDO_OCI_CHECK_LIB_DIR($PDO_OCI_DIR) 9 | +# AC_PDO_OCI_CHECK_LIB_DIR($PDO_OCI_DIR) 10 | 11 | if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then 12 | PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`" 13 | -------------------------------------------------------------------------------- /extras/php5/dist/activate-entropy-php.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | prefix = '{prefix}' 7 | 8 | # Create symlink to Apache conf file snippet which loads the PHP module. 9 | # Different places for the symlink in Mac OS X Client / Server 10 | # 11 | httpd_conf_path = prefix + '/entropy-php.conf' 12 | 13 | # os.system test results are reversed (shell exit status codes) 14 | if os.system("sw_vers -productName | grep -qi server"): 15 | httpd_conf_symlink = '/etc/apache2/other/+entropy-php.conf' 16 | mysql_socket = '/tmp/mysql.sock' 17 | product = 'Client' 18 | else: 19 | httpd_conf_symlink = '/etc/apache2/sites/+entropy-php.conf' 20 | mysql_socket = '/var/mysql/mysql.sock' 21 | product = 'Server' 22 | 23 | sys.stderr.write("Detected OS X %s, Entropy PHP httpd conf symlink goes to '%s', mysql socket set to at '%s'\n" % (product, httpd_conf_symlink, mysql_socket)) 24 | 25 | if os.system("test -h " + httpd_conf_symlink): 26 | sys.stderr.write("Entropy PHP httpd conf symlink not present, creating it...\n") 27 | os.symlink(httpd_conf_path, httpd_conf_symlink) 28 | else: 29 | sys.stderr.write("Entropy PHP httpd conf symlink already present\n") 30 | 31 | # Activate default php.ini and pear.conf files if they don't exist. 32 | # This prevents upgrade installs of the packge from clobbering local modifications 33 | os.chdir(prefix + "/lib") 34 | if not os.path.exists("php.ini"): 35 | sys.stderr.write("Entropy PHP %s/lib/php.ini not present, copying from php.ini-recommended\n" % prefix) 36 | os.system("sed -E -e 's#(mysqli?.default_socket =).*#\\1 " + mysql_socket + "#' < php.ini-recommended > php.ini") 37 | else: 38 | sys.stderr.write("Entropy PHP %s/lib/php.ini already present\n" % prefix) 39 | 40 | os.chdir(prefix + "/etc") 41 | if not os.path.exists("pear.conf"): 42 | os.system("cp pear.conf.default pear.conf") 43 | sys.stderr.write("Entropy PHP %s/etc/pear.conf not present, copying from pear.conf.default\n" % prefix) 44 | else: 45 | sys.stderr.write("Entropy PHP %s/etc/pear.conf already present\n" % prefix) 46 | 47 | result = os.system("apachectl restart") >> 8 48 | sys.stderr.write("apachectl restart exit status: %d\n" % result) 49 | sys.exit(result) 50 | -------------------------------------------------------------------------------- /extras/php5/dist/entropy-php.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Additional PHP Apache directives, 3 | # part of the entropy.ch PHP package for Mac OS X 4 | # 5 | # For more information, go to http://www.entropy.ch/software/macosx/php/ 6 | # 7 | 8 | LoadModule php7_module {prefix}/libphp7.so 9 | 10 | 11 | 12 | AddType application/x-httpd-php .php 13 | AddType application/x-httpd-php-source .phps 14 | 15 | 16 | DirectoryIndex index.html index.php 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /extras/php5/package/.gitignore: -------------------------------------------------------------------------------- 1 | /*.out 2 | -------------------------------------------------------------------------------- /extras/php5/package/Description.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IFPkgDescriptionTitle 6 | Entropy PHP 7 | IFPkgDescriptionDescription 8 | The PHP web and general purpose scripting language in a Mac OS X installation package. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /extras/php5/package/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | ch.entropy.php 7 | CFBundleName 8 | Entropy PHP 9 | CFBundleGetInfoString 10 | Entropy PHP {version}-{release} 11 | CFBundleShortVersionString 12 | {version} 13 | IFPkgFlagAuthorizationAction 14 | RootAuthorization 15 | IFPkgFlagDefaultLocation 16 | {prefix} 17 | IFPkgFlagFollowLinks 18 | 19 | IFPkgFlagInstallFat 20 | 21 | IFPkgFormatVersion 22 | 0.10000000149011612 23 | IFPkgFlagInstalledSize 24 | 0 25 | 26 | 27 | -------------------------------------------------------------------------------- /extras/php5/package/resources/background.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liip/build-entropy-php/747a4664b116641a7b623b39b4dd71ccf565430a/extras/php5/package/resources/background.tif -------------------------------------------------------------------------------- /extras/php5/package/resources/postflight: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo running activation script for Entropy PHP 4 | python $2/bin/activate-entropy-php.py 5 | -------------------------------------------------------------------------------- /extras/php5/php-configure-time-endianness-check-fix.c: -------------------------------------------------------------------------------- 1 | /* To be appended to main/php_config.h */ 2 | /* Taken from http://archive.netbsd.se/?ml=php-dev&a=2007-07&t=4772195 */ 3 | 4 | #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) 5 | # if defined(__LITTLE_ENDIAN__) 6 | # undef WORDS_BIGENDIAN 7 | # else if defined(__BIG_ENDIAN__) 8 | # define WORDS_BIGENDIAN 9 | # endif 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /extras/php5/php-entropy-imap.patch: -------------------------------------------------------------------------------- 1 | --- php-5.3.2/ext/imap/php_imap.c 2010-03-09 11:52:40.000000000 +0100 2 | +++ php-5.3.2-fixed/ext/imap/php_imap.c 2010-03-09 11:51:40.000000000 +0100 3 | @@ -2664,7 +2664,7 @@ 4 | #ifndef HAVE_NEW_MIME2TEXT 5 | utf8_mime2text(&src, &dest); 6 | #else 7 | - utf8_mime2text(&src, &dest, U8T_DECOMPOSE); 8 | + utf8_mime2text(&src, &dest, 0); 9 | #endif 10 | RETVAL_STRINGL(dest.data, dest.size, 1); 11 | if (dest.data) { 12 | -------------------------------------------------------------------------------- /extras/php5/php-entropy.patch: -------------------------------------------------------------------------------- 1 | --- php-5.4.13.ori/ext/standard/info.c 2013-03-18 08:24:27.000000000 +0100 2 | +++ php-5.4.13/ext/standard/info.c 2013-03-18 09:14:31.000000000 +0100 3 | @@ -691,6 +691,10 @@ 4 | 5 | if (!sapi_module.phpinfo_as_text) { 6 | php_info_printf("

PHP Version %s

\n", PHP_VERSION); 7 | +#ifdef __x86_64__ 8 | +#define ENTROPY_CH_THIS_ARCH "x86_64" 9 | +#endif 10 | + php_info_printf("

php-osx.liip.ch by Liip (originally developed by www.local.ch)

\n"); 11 | } else { 12 | php_info_print_table_row(2, "PHP Version", PHP_VERSION); 13 | } 14 | -------------------------------------------------------------------------------- /lib/Config.pm: -------------------------------------------------------------------------------- 1 | package Config; 2 | 3 | use base qw(Obj); 4 | 5 | use strict; 6 | use warnings; 7 | 8 | our $VERSION = '1.0'; 9 | 10 | 11 | sub init { 12 | 13 | my $self = shift @_; 14 | 15 | $self->{$_} ||= undef foreach qw(basedir downloaddir); 16 | $self->makedirs(); 17 | 18 | } 19 | 20 | 21 | sub downloaddir { 22 | my $self = shift @_; 23 | return $self->basedir() . '/download'; 24 | } 25 | 26 | sub srcdir { 27 | my $self = shift @_; 28 | return $self->basedir() . '/src'; 29 | } 30 | 31 | 32 | 33 | 34 | 35 | sub makedirs { 36 | 37 | my $self = shift @_; 38 | 39 | my @dirs = ( 40 | $self->downloaddir(), 41 | $self->prefix(), 42 | $self->srcdir(), 43 | ); 44 | 45 | foreach my $dir (@dirs) { 46 | die "Unable to mkdir() '$dir'" unless (-d $dir or mkdir($dir)); 47 | } 48 | 49 | return undef; 50 | 51 | } 52 | 53 | 54 | 55 | sub zend_module_api_no { 56 | my $self = shift @_; 57 | my $srcdir = $self->phpsrcdir(); 58 | #my $value = qx(grep 'define ZEND_MODULE_API_NO' $srcdir/php*/Zend/zend_modules.h | cut -f 3 -d ' '); 59 | my $value = qx(grep 'define ZEND_MODULE_API_NO' $srcdir/Zend/zend_modules.h | cut -f 3 -d ' '); 60 | chomp($value); 61 | die "Unable to find zend module api no, PHP source dir not yet unpacked?" unless ($value); 62 | return $value; 63 | } 64 | 65 | sub extdir { 66 | my $self = shift @_; 67 | return 'lib/php/extensions/no-debug-non-zts-' . $self->zend_module_api_no(); 68 | } 69 | 70 | sub extdir_path { 71 | my $self = shift @_; 72 | my ($filename) = @_; 73 | return $self->extdir() . "/$filename"; 74 | } 75 | 76 | #sub extension_dir { 77 | # my $self = shift @_; 78 | # my $srcdir = $self->srcdir(); 79 | # my $value = qx(grep 'EXTENSION_DIR =' $srcdir/php-*/Makefile | cut -f 3 -d ' '); 80 | # chomp($value); 81 | # die "Unable to find EXTENSION_DIR, PHP source dir not yet unpacked?" unless ($value); 82 | # return $value; 83 | #} 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 1; 94 | 95 | -------------------------------------------------------------------------------- /lib/Imports.pm: -------------------------------------------------------------------------------- 1 | package Imports; 2 | 3 | use Data::Dumper; 4 | use Package; 5 | use Config; 6 | #use Shell; 7 | use IO::File; 8 | use IO::Dir; 9 | use UBSplicer; 10 | 11 | 1; 12 | -------------------------------------------------------------------------------- /lib/Obj.pm: -------------------------------------------------------------------------------- 1 | package Obj; 2 | 3 | use strict; 4 | use warnings; 5 | use overload '""' => 'to_string'; 6 | 7 | use Imports; 8 | 9 | our $VERSION = '1.0'; 10 | use vars qw($AUTOLOAD); 11 | 12 | 13 | 14 | 15 | sub new { 16 | 17 | my $self = shift @_; 18 | my (%args) = @_; 19 | 20 | my $class = ref($self) || $self; 21 | $self = bless {%args}, $class; 22 | $self->{$_} ||= undef foreach qw(config); 23 | $self->init(%args); 24 | 25 | return $self; 26 | 27 | } 28 | 29 | 30 | sub init { 31 | } 32 | 33 | 34 | sub log { 35 | 36 | my $self = shift @_; 37 | my ($message) = @_; 38 | 39 | my ($sec,$min,$hour,$mday,$mon,$year) = localtime(); 40 | 41 | warn(sprintf("[%04d-%02d-%02d %02d:%02d:%02d] %s: %s\n", $year + 1900, $mon + 1, $mday, $hour, $min, $sec, $self, $message)); 42 | 43 | } 44 | 45 | 46 | 47 | sub cd { 48 | 49 | my $self = shift @_; 50 | my ($dir) = @_; 51 | 52 | chdir($dir) or die "Unable to chdir to '$dir'"; 53 | 54 | $self->log("directory is now $dir"); 55 | 56 | } 57 | 58 | # $self->shell('nonfatal', 'silent', ) 59 | # $self->shell({fatal => 0, silent => 1}, ) 60 | 61 | sub shell { 62 | 63 | my $self = shift @_; 64 | my (@items) = @_; 65 | 66 | my $options = ref($items[0]) ? shift @items : {}; 67 | $options->{fatal} = 1 unless exists($options->{fatal}); 68 | $options->{silent} = 1 unless exists($options->{silent}); 69 | $options->{log} = 1 unless exists($options->{log}); 70 | 71 | my $cmd = join(" ", @items, " 3>&1 2>&3"); 72 | $cmd .= " 1>>/tmp/build-entropy-php.log" if $options->{silent}; 73 | # $cmd .= " | tee /tmp/shell-$$.stdout"; 74 | 75 | $self->log("run shell: $cmd") if ($options->{log}); 76 | 77 | # my $output = `$cmd`; 78 | # my $output = ''; 79 | system($cmd); 80 | my $status = $? >> 8; 81 | 82 | if ($status) { 83 | my $msg = "shell command failed with status '$status': '$cmd'"; #, output='$output' 84 | if ($options->{fatal}) { 85 | $msg = "fatal: $msg"; 86 | Carp::confess($msg); 87 | } else { 88 | $msg = "nonfatal: $msg"; 89 | $self->log($msg); 90 | } 91 | } 92 | 93 | # return $output; 94 | 95 | } 96 | 97 | 98 | sub dir_content { 99 | my $self = shift @_; 100 | return grep {!/^\.+$/} IO::Dir->new($_[0])->read(); 101 | } 102 | 103 | sub file_content { 104 | my $self = shift @_; 105 | my ($filename) = @_; 106 | return do {undef local($/); IO::File->new($filename)->getline()}; 107 | } 108 | 109 | 110 | sub AUTOLOAD { 111 | 112 | my $self = shift @_; 113 | my ($value) = @_; 114 | 115 | my ($method) = $AUTOLOAD =~ /::([^:]+)$/; 116 | 117 | if ($method eq 'DESTROY') { 118 | return $self->can('DESTROY') ? $self->SUPER::DESTROY(@_) : undef; 119 | } 120 | 121 | die "AUTOLOAD call for '$method'" if ($method eq 'AUTOLOAD'); 122 | 123 | unless (exists($self->{$method})) { 124 | Carp::confess("No property named '$method'"); 125 | } 126 | 127 | return undef unless ($method); 128 | $self->{$method} = $value if (@_); 129 | return $self->{$method}; 130 | 131 | } 132 | 133 | 134 | 135 | 136 | sub to_string { 137 | my $self = shift @_; 138 | my $class = ref($self) || $self; 139 | return "[$class]"; 140 | } 141 | 142 | 1; 143 | 144 | -------------------------------------------------------------------------------- /lib/Package.pm: -------------------------------------------------------------------------------- 1 | package Package; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(PackageBase); 6 | 7 | our $VERSION = '1.0'; 8 | 9 | # superclass for simple packages which don't require splice build 10 | 11 | 12 | sub install { 13 | my $self = shift @_; 14 | return undef unless ($self->SUPER::install(@_)); 15 | my $dst = $self->install_prefix(); 16 | system("mkdir -p $dst"); 17 | die "Unable to find or create installation dir '$dst'" unless (-d $dst); 18 | my $install_override = $self->make_install_override_list(prefix => $dst); 19 | my @dirs = $self->make_install_sourcedirs(); 20 | foreach my $dir (@dirs) { 21 | $self->cd($dir); 22 | $self->shell($self->make_command() . " $install_override install"); 23 | } 24 | return 1; 25 | } 26 | 27 | sub make_install_sourcedirs { 28 | my $self = shift @_; 29 | return $self->build_sourcedirs(); 30 | } 31 | 32 | sub build_sourcedirs { 33 | my $self = shift @_; 34 | return ($self->packagesrcdir()); 35 | } 36 | 37 | sub build { 38 | my $self = shift @_; 39 | return unless ($self->SUPER::build(@_)); 40 | my (%args) = @_; 41 | 42 | $self->build_preconfigure(); 43 | 44 | $self->cd_packagesrcdir(); 45 | 46 | $self->build_configure(); 47 | 48 | $self->build_postconfigure(%args); 49 | 50 | foreach my $dir ($self->build_sourcedirs()) { 51 | $self->cd($dir); 52 | my $make_command = $self->make_command(); 53 | my $prefix = $self->config()->prefix(); 54 | 55 | $self->shell(' ' . $make_command); 56 | } 57 | } 58 | 59 | sub build_configure { 60 | my $self = shift @_; 61 | 62 | my $cflags = $self->cflags(); 63 | my $ldflags = $self->ldflags(); 64 | my $cxxflags = $self->compiler_archflags(); 65 | my $archflags = $self->compiler_archflags(); 66 | my $cc = $self->cc(); 67 | 68 | my $prefix = $self->config()->prefix(); 69 | $self->shell(qq(MACOSX_DEPLOYMENT_TARGET=10.10 CFLAGS="$cflags" LDFLAGS='$ldflags' CXXFLAGS='$cxxflags' CC='$cc' ./configure ) . $self->configure_flags()); 70 | } 71 | 72 | sub build_preconfigure { 73 | my $self = shift @_; 74 | my (%args) = @_; 75 | } 76 | 77 | sub build_postconfigure { 78 | my $self = shift @_; 79 | my (%args) = @_; 80 | } 81 | 82 | 1; 83 | -------------------------------------------------------------------------------- /lib/Package/apc.pm: -------------------------------------------------------------------------------- 1 | package Package::APC; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '3.1.13'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'APC'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | ## just for SVN, remove if you want to download official releases */ 18 | 19 | #sub svn_url { 20 | # return "https://svn.php.net/repository/pecl/apc/trunk"; 21 | #} 22 | 23 | #sub download { 24 | # my $self = shift @_; 25 | # $_->download() foreach $self->dependencies(); 26 | # return if ($self->is_downloaded()); 27 | # $self->cd_srcdir(); 28 | # my $url = $self->svn_url(); 29 | # $self->shell("/usr/bin/svn co $url " . $self->packagename()); 30 | #} 31 | 32 | 33 | #sub extract { 34 | #} 35 | 36 | #sub patch { 37 | #} 38 | 39 | ## end SVN*/ 40 | 41 | sub packagesrcdir { 42 | my $self = shift @_; 43 | return $self->config()->srcdir() . "/" . $self->packagename(); 44 | } 45 | 46 | sub extension_ini{ 47 | my ($self, $dst) = @_; 48 | $self->shell({silent => 0}, "echo ';extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 49 | # some default values 50 | $self->shell({silent => 0}, "echo ';[APC]' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 51 | $self->shell({silent => 0}, "echo ';apc.enabled = 1' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 52 | $self->shell({silent => 0}, "echo ';apc.shm_segments = 1' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 53 | $self->shell({silent => 0}, "echo ';apc.shm_size = 128M' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 54 | } 55 | 56 | return 1; 57 | -------------------------------------------------------------------------------- /lib/Package/apcu.pm: -------------------------------------------------------------------------------- 1 | package Package::apcu; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '5.1.8'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'apcu'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | sub extension_ini{ 23 | my ($self, $dst) = @_; 24 | $self->shell({silent => 0}, "echo 'extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 25 | # some default value 26 | $self->shell({silent => 0}, "echo '[APCu]' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 27 | $self->shell({silent => 0}, "echo 'apc.enabled = on' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 28 | } 29 | 30 | return 1; 31 | -------------------------------------------------------------------------------- /lib/Package/bytekit.pm: -------------------------------------------------------------------------------- 1 | package Package::bytekit; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '0.1.1'; 9 | 10 | sub base_url { 11 | my $self = shift; 12 | return "http://www.bytekit.org/download"; 13 | } 14 | 15 | sub packagename { 16 | return "bytekit-" . $VERSION; 17 | } 18 | 19 | sub filename { 20 | my ($self) = shift; 21 | return $self->packagename() . ".tgz"; 22 | } 23 | 24 | sub build_preconfigure { 25 | my $self = shift @_; 26 | $self->cd_packagesrcdir(); 27 | $self->shell($self->install_prefix() . '/bin/phpize 3>&1 2>&3 1>>/tmp/build-entropy-php.log'); 28 | } 29 | 30 | sub configure_flags { 31 | my $self = shift @_; 32 | return join " ", ( 33 | $self->SUPER::configure_flags(@_), 34 | '--enable-bytekit', 35 | '--with-php-config=' . $self->install_prefix() . '/bin/php-config' 36 | ); 37 | } 38 | 39 | sub install { 40 | my $self = shift @_; 41 | 42 | $self->build(); 43 | 44 | my $dst = $self->full_install_extension_dir(); 45 | $self->shell("sudo cp modules/bytekit.so $dst"); 46 | $self->shell({silent => 0}, "echo 'extension=" . $dst . $self->shortname() . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 47 | $self->shell("sudo mv /tmp/50-extension-" . $self->shortname() . ".ini " .$self->install_prefix() . "/php.d/") 48 | } 49 | 50 | sub subpath_for_check { 51 | return $self->install_extension_dir() . "bytekit.so"; 52 | } 53 | 54 | 1; 55 | -------------------------------------------------------------------------------- /lib/Package/curl.pm: -------------------------------------------------------------------------------- 1 | package Package::curl; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '7.54.0'; 9 | 10 | sub base_url { 11 | return "http://curl.haxx.se/download"; 12 | } 13 | 14 | sub packagename { 15 | return "curl-" . $VERSION; 16 | } 17 | 18 | sub subpath_for_check { 19 | return "lib/libcurl.dylib"; 20 | } 21 | 22 | sub configure_flags { 23 | my $self = shift @_; 24 | return join " ", ( 25 | $self->SUPER::configure_flags(@_), 26 | '--enable-ldaps', 27 | '--disable-dependency-tracking', 28 | '--with-ssl=/usr/local/php5', 29 | '--with-ca-bundle=/usr/local/php5/ssl/cert.pem', 30 | '--with-libidn='.$self->config()->prefix(), 31 | '--disable-ares', 32 | '--with-gssapi' 33 | 34 | ); 35 | } 36 | sub dependency_names { 37 | return qw(idn); 38 | } 39 | 40 | sub php_extension_configure_flags { 41 | my $self = shift @_; 42 | my (%args) = @_; 43 | return "--with-curl=shared," . $self->config()->prefix() . " "; 44 | } 45 | 46 | sub php_dso_extension_names { 47 | my $self = shift @_; 48 | return $self->shortname(); 49 | } 50 | 51 | sub package_filelist { 52 | my $self = shift @_; 53 | return $self->php_dso_extension_paths(), qw(lib/libcurl*.dylib php.d/50-extension-curl.ini share/curl); 54 | } 55 | 56 | 1; 57 | -------------------------------------------------------------------------------- /lib/Package/gettext.pm: -------------------------------------------------------------------------------- 1 | package Package::gettext; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '0.18.1.1'; 9 | 10 | 11 | 12 | 13 | sub dependency_names { 14 | return qw(); 15 | } 16 | 17 | 18 | sub base_url { 19 | return "ftp://sunsite.cnlab-switch.ch/mirror/gnu/gettext"; 20 | } 21 | 22 | 23 | sub packagename { 24 | return "gettext-" . $VERSION; 25 | } 26 | 27 | 28 | 29 | sub subpath_for_check { 30 | return "lib/libgettextlib.dylib"; 31 | } 32 | 33 | 34 | 35 | sub php_extension_configure_flags { 36 | 37 | my $self = shift @_; 38 | my (%args) = @_; 39 | 40 | # return "--with-gettext=shared," . $self->config()->prefix(); 41 | return "--with-gettext=" . $self->config()->prefix(); 42 | 43 | } 44 | 45 | 46 | #CFLAGS='-arch i386 -arch x86_64' LDFLAGS='-arch i386 -arch x86_64' CC='cc -DENTROPY_CH_RELEASE=2' ./configure --with-libiconv-prefix=/usr/local/php5 --without-emacs --disable-java --disable-native-java --disable-dependency-tracking --prefix=/usr/local/php5 47 | 48 | sub configure_flags { 49 | my $self = shift @_; 50 | return join " ", ( 51 | $self->SUPER::configure_flags(@_), 52 | # '--with-libiconv-prefix=' . $self->config()->prefix(), 53 | '--disable-java --disable-csharp --disable-native-java --without-emacs' 54 | ); 55 | } 56 | 57 | 58 | #sub php_dso_extension_names { 59 | # my $self = shift @_; 60 | # return $self->shortname(); 61 | #} 62 | 63 | 64 | 65 | # sub make_install_arch { 66 | # my $self = shift @_; 67 | # my (%args) = @_; 68 | # 69 | # $self->shell("mkdir -p $args{prefix}/bin"); 70 | # $self->SUPER::make_install_arch(%args); 71 | # } 72 | 73 | 74 | 75 | 76 | sub package_filelist { 77 | 78 | my $self = shift @_; 79 | 80 | # return $self->config()->extdir_path('gettext.so'), qw( 81 | # lib/libgettext*.dylib lib/libasprintf*.dylib lib/libintl*.dylib 82 | # php.d/50-extension-gettext.ini share/gettext 83 | # ); 84 | 85 | return qw( 86 | lib/libgettext*.dylib lib/libasprintf*.dylib lib/libintl*.dylib 87 | share/gettext 88 | ); 89 | } 90 | 91 | sub patchfiles { 92 | my $self = shift @_; 93 | 94 | return qw(gettext.patch); 95 | } 96 | 97 | 98 | 99 | 100 | 1; 101 | -------------------------------------------------------------------------------- /lib/Package/gmp.pm: -------------------------------------------------------------------------------- 1 | package Package::gmp; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | #our $VERSION = ''; 9 | our $VERSION = '6.1.2'; 10 | 11 | sub init { 12 | my $self = shift; 13 | $self->SUPER::init(@_); 14 | $self->{PACKAGE_NAME} = 'gmp'; 15 | $self->{VERSION} = $VERSION; 16 | } 17 | 18 | 19 | sub base_url { 20 | return "http://mirror.switch.ch/ftp/mirror/gnu/gmp" 21 | } 22 | 23 | sub packagename { 24 | my ($self) = shift; 25 | return $self->{PACKAGE_NAME} . "-" . $self->{VERSION}; 26 | } 27 | 28 | sub filename { 29 | my ($self) = shift; 30 | return $self->packagename() . ".tar.bz2"; 31 | } 32 | 33 | 34 | sub subpath_for_check { 35 | my $self = shift @_; 36 | return "lib/libgmp.dylib"; 37 | } 38 | 39 | sub configure_flags { 40 | my $self = shift @_; 41 | # check if we do a debug build: 42 | my $debugflag = $self->config()->debug() ? ' --with-debug' : ''; 43 | return $self->SUPER::configure_flags(@_); 44 | } 45 | 46 | sub install { 47 | 48 | my $self = shift @_; 49 | return undef unless ($self->SUPER::install(@_)); 50 | 51 | $self->cd_packagesrcdir(); 52 | $self->shell("make install"); 53 | } 54 | 55 | sub extract { 56 | my $self = shift @_; 57 | $self->shell('tar -xjf', $self->download_path()); 58 | } 59 | 60 | 61 | sub php_extension_configure_flags { 62 | my $self = shift @_; 63 | my (%args) = @_; 64 | return "--with-gmp=shared," . $self->config()->prefix(); 65 | } 66 | 67 | 68 | 69 | sub php_dso_extension_names { 70 | my $self = shift @_; 71 | return qw(gmp); 72 | } 73 | 74 | 75 | sub package_filelist { 76 | my $self = shift @_; 77 | return $self->php_dso_extension_paths(), qw(php.d/50-extension-gmp.ini lib/libgmp*.dylib); 78 | } 79 | 80 | 1; 81 | -------------------------------------------------------------------------------- /lib/Package/iconv.pm: -------------------------------------------------------------------------------- 1 | package Package::iconv; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | # our $VERSION = '1.13'; 9 | our $VERSION = '1.14'; 10 | 11 | 12 | 13 | 14 | 15 | sub base_url { 16 | return "ftp://sunsite.cnlab-switch.ch/mirror/gnu/libiconv"; 17 | } 18 | 19 | 20 | sub packagename { 21 | return "libiconv-" . $VERSION; 22 | } 23 | 24 | 25 | 26 | sub subpath_for_check { 27 | return "lib/libiconv.dylib"; 28 | } 29 | 30 | 31 | 32 | sub php_extension_configure_flags { 33 | my $self = shift @_; 34 | my (%args) = @_; 35 | return "--with-iconv=" . $self->config()->prefix(); 36 | } 37 | 38 | 39 | # 40 | # sub configure_flags { 41 | # my $self = shift @_; 42 | # return join " ", ( 43 | # $self->SUPER::configure_flags(@_), 44 | # '--with-libiconv-prefix=' . $self->config()->prefix(), 45 | # '--disable-java --disable-csharp --disable-native-java --without-emacs' 46 | # ); 47 | # } 48 | 49 | 50 | # sub php_dso_extension_names { 51 | # my $self = shift @_; 52 | # return $self->shortname() . '.so'; 53 | # } 54 | # 55 | 56 | 57 | 58 | # to ensure our custom iconv is found before the apple-supplied one 59 | sub cc { 60 | my $self = shift @_; 61 | return $self->SUPER::cc(@_) . ' -L' . $self->config()->prefix() . '/lib'; 62 | } 63 | 64 | 65 | 66 | 67 | sub package_filelist { 68 | my $self = shift @_; 69 | return qw( 70 | lib/libiconv*.dylib 71 | ); 72 | } 73 | 74 | 75 | 76 | 77 | 78 | 1; 79 | -------------------------------------------------------------------------------- /lib/Package/icu.pm: -------------------------------------------------------------------------------- 1 | package Package::icu; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '58.1'; 9 | 10 | sub base_url { 11 | return "http://download.icu-project.org/files/icu4c/" . $VERSION; 12 | } 13 | 14 | sub packagename { 15 | my $vers = $VERSION; 16 | $vers =~ s/\./_/g; 17 | # icu4c-4_6-src.tgz 18 | return "icu4c-" . $vers . "-src"; 19 | } 20 | 21 | sub filename { 22 | my ($self) = shift; 23 | return $self->packagename() . ".tgz"; 24 | } 25 | 26 | sub extract { 27 | my $self = shift @_; 28 | $self->shell('tar -xzf', $self->download_path()); 29 | ## patch config/mh-darwin to contain 30 | ## LD_SONAME ... $(libdir)/$(notdir $(MIDDLE_SO_TARGET)) 31 | $self->cd_packagesrcdir(); 32 | $self->shell('mv config/mh-darwin config/mh-darwin.org'); 33 | my $src = $self->packagesrcdir(); 34 | $self->shell({silent => 0}, "sed 's|\$(notdir \$(MIDDLE_SO_TARGET))|\$(libdir)\/\$(notdir \$(MIDDLE_SO_TARGET))|' " . $src . "/config/mh-darwin.org >" . $src . "/config/mh-darwin"); 35 | } 36 | 37 | sub packagesrcdir { 38 | my $self = shift @_; 39 | return $self->config()->srcdir() . "/icu/source"; 40 | } 41 | 42 | sub subpath_for_check { 43 | return "lib/libicui18n.dylib"; 44 | } 45 | 46 | sub build_configure { 47 | my $self = shift @_; 48 | my $cflags = $self->cflags(); 49 | my $ldflags = $self->ldflags(); 50 | my $cxxflags = $self->compiler_archflags(); 51 | my $archflags = $self->compiler_archflags(); 52 | my $cc = $self->cc(); 53 | 54 | $self->shell(qq(MACOSX_DEPLOYMENT_TARGET=10.10 CFLAGS="-mmacosx-version-min=10.10 -arch x86_64" LDFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" ./runConfigureICU MacOSX --with-library-bits=64 --disable-samples --enable-static ) . $self->configure_flags()); 55 | } 56 | 57 | sub make_command { 58 | my $self = shift @_; 59 | return "make"; 60 | } 61 | 62 | sub php_extension_configure_flags { 63 | my $self = shift @_; 64 | my (%args) = @_; 65 | return "--with-icu-dir=" . $self->config()->prefix(); #. " --enable-intl" 66 | } 67 | 68 | 69 | sub package_filelist { 70 | my $self = shift @_; 71 | return $self->php_dso_extension_paths(), qw(lib/libicudata*.dylib lib/libicui18n*.dylib lib/libicuio*.dylib lib/libicule*.dylib lib/libiculx*.dylib lib/libicutu*.dylib lib/libicuuc*.dylib lib/icu); 72 | } 73 | 74 | 1; 75 | -------------------------------------------------------------------------------- /lib/Package/idn.pm: -------------------------------------------------------------------------------- 1 | package Package::idn; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.20'; 9 | 10 | sub base_url { 11 | return "http://ftp.gnu.org/gnu/libidn/"; 12 | } 13 | 14 | sub packagename { 15 | return "libidn-" . $VERSION; 16 | } 17 | 18 | sub subpath_for_check { 19 | return "lib/libidn.dylib"; 20 | } 21 | 22 | 23 | 1; 24 | -------------------------------------------------------------------------------- /lib/Package/igbinary.pm: -------------------------------------------------------------------------------- 1 | package Package::igbinary; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.0.1'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'igbinary'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | return 1; 23 | -------------------------------------------------------------------------------- /lib/Package/imapcclient.pm: -------------------------------------------------------------------------------- 1 | package Package::imapcclient; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2007f'; 9 | #our $VERSION = '2004g'; 10 | #our $VERSION = '2006a'; 11 | 12 | 13 | 14 | 15 | sub base_url { 16 | return "ftp://ftp.cac.washington.edu/imap"; 17 | } 18 | 19 | 20 | sub packagename { 21 | return "imap-$VERSION"; 22 | } 23 | 24 | 25 | sub filename { 26 | return "c-client.tar.Z"; 27 | } 28 | 29 | sub php_dso_extension_names { 30 | my $self = shift @_; 31 | return qw(imap); 32 | } 33 | 34 | 35 | sub package_filelist { 36 | my $self = shift @_; 37 | return 38 | $self->php_dso_extension_paths(), 39 | qw( 40 | php.d/50-extension-imap.ini 41 | ); 42 | } 43 | 44 | sub make_command { 45 | my $self = shift @_; 46 | my $cflags = $self->cflags(); 47 | return qq(MACOSX_DEPLOYMENT_TARGET=10.10 EXTRACFLAGS="$cflags" make -e osx); 48 | } 49 | 50 | 51 | sub make_install_sourcedirs { 52 | return (); 53 | } 54 | 55 | 56 | sub build_configure { 57 | } 58 | 59 | 60 | sub is_installed { 61 | my $self = shift @_; 62 | return -e $self->packagesrcdir() . "/c-client/c-client.a"; 63 | } 64 | 65 | 66 | sub php_extension_configure_flags { 67 | my $self = shift @_; 68 | my (%args) = @_; 69 | my $packagename = $self->packagename(); 70 | return "--with-imap=shared,../$packagename --with-kerberos=/usr --with-imap-ssl=/usr/local/php5"; 71 | } 72 | 73 | 74 | 75 | 76 | 77 | 1; 78 | -------------------------------------------------------------------------------- /lib/Package/intl.pm: -------------------------------------------------------------------------------- 1 | package Package::intl; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | sub init { 9 | my $self = shift; 10 | $self->SUPER::init(@_); 11 | $self->{PACKAGE_NAME} = 'intl'; 12 | 13 | } 14 | 15 | sub unpack { 16 | } 17 | 18 | sub packagesrcdir { 19 | my $self = shift @_; 20 | return $self->config()->phpsrcdir . "/ext/intl"; 21 | } 22 | 23 | 24 | sub configure_flags { 25 | my $self = shift @_; 26 | return join " ", ( 27 | $self->SUPER::configure_flags(@_), 28 | '--with-icu-dir=' . $self->config()->prefix() 29 | ); 30 | 31 | } 32 | 33 | sub cc { 34 | my $self = shift @_; 35 | my $prefix = $self->config()->prefix(); 36 | 37 | # - the -L forces our custom iconv before the apple-supplied one 38 | # - the -I makes sure the libxml2 version number for phpinfo() is picked up correctly, 39 | # i.e. ours and not the system-supplied libxml 40 | return $self->SUPER::cc(@_) . " -I".$self->config()->phpsrcdir(); 41 | } 42 | 43 | 44 | return 1; 45 | -------------------------------------------------------------------------------- /lib/Package/libevent.pm: -------------------------------------------------------------------------------- 1 | package Package::libevent; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2.0.19-stable'; 9 | 10 | sub base_url { 11 | return "https://github.com/downloads/libevent/libevent"; 12 | } 13 | 14 | sub packagename { 15 | return "libevent-$VERSION"; 16 | } 17 | 18 | sub filename { 19 | return "libevent-$VERSION.tar.gz"; 20 | } 21 | 22 | #http://download.tangent.org/libmemcached-0.34.tar.gz 23 | 24 | sub is_built { 25 | my $self = shift @_; 26 | return -e $self->packagesrcdir() . "/libevent.dylib"; 27 | } 28 | 29 | sub subpath_for_check { 30 | my $self = shift @_; 31 | return "lib/libevent.dylib"; 32 | } 33 | 34 | sub configure_flags { 35 | my $self = shift @_; 36 | # check if we do a debug build: 37 | my $debugflag = $self->config()->debug() ? ' --with-debug' : ''; 38 | return $self->SUPER::configure_flags(@_); 39 | } 40 | 41 | sub install { 42 | 43 | my $self = shift @_; 44 | return undef unless ($self->SUPER::install(@_)); 45 | 46 | $self->cd_packagesrcdir(); 47 | $self->shell("make install"); 48 | } 49 | 50 | # sub php_extension_configure_flags { 51 | # 52 | # my $self = shift @_; 53 | # my (%args) = @_; 54 | # 55 | # return "--with-jpeg-dir=" . $self->config()->prefix(); 56 | # 57 | # } 58 | 59 | 60 | 1; 61 | -------------------------------------------------------------------------------- /lib/Package/libfreetype.pm: -------------------------------------------------------------------------------- 1 | package Package::libfreetype; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2.3.11'; 9 | 10 | 11 | 12 | sub base_url { 13 | return "http://switch.dl.sourceforge.net/sourceforge/freetype"; 14 | } 15 | 16 | 17 | sub packagename { 18 | return "freetype-$VERSION"; 19 | } 20 | 21 | 22 | sub subpath_for_check { 23 | return "lib/libfreetype.dylib"; 24 | } 25 | 26 | 27 | # sub configure_flags { 28 | # my $self = shift @_; 29 | # return $self->SUPER::configure_flags(@_) . " --without-x"; 30 | # } 31 | 32 | 33 | sub php_extension_configure_flags { 34 | my $self = shift @_; 35 | my (%args) = @_; 36 | return "--enable-gd-native-ttf --with-freetype-dir=" . $self->config()->prefix(); 37 | } 38 | 39 | 40 | 41 | 1; -------------------------------------------------------------------------------- /lib/Package/libgif.pm: -------------------------------------------------------------------------------- 1 | package Package::libgif; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '4.1.6'; 9 | 10 | sub base_url { 11 | my $self = shift @_; 12 | return "http://downloads.sourceforge.net/project/giflib/giflib-4.x/" . $self->packagename() ; 13 | } 14 | 15 | sub packagename { 16 | return "giflib-$VERSION"; 17 | } 18 | 19 | sub filename { 20 | return "giflib-$VERSION.tar.gz"; 21 | } 22 | 23 | #http://switch.dl.sourceforge.net/sourceforge/giflib/files/giflib-4.1.6.tar.gz 24 | 25 | sub is_built { 26 | my $self = shift @_; 27 | return -e $self->packagesrcdir() . "/libgif.a"; 28 | } 29 | 30 | sub subpath_for_check { 31 | my $self = shift @_; 32 | return "lib/libgif.a"; 33 | } 34 | 35 | sub configure_flags { 36 | my $self = shift @_; 37 | my $prefix = $self->config()->prefix(); 38 | 39 | return $self->SUPER::configure_flags(@_) . " --disable-dependency-tracking"; 40 | } 41 | 42 | sub install { 43 | 44 | my $self = shift @_; 45 | return undef unless ($self->SUPER::install(@_)); 46 | 47 | $self->cd_packagesrcdir(); 48 | $self->shell("make install"); 49 | } 50 | 51 | 1; -------------------------------------------------------------------------------- /lib/Package/libiodbc.pm: -------------------------------------------------------------------------------- 1 | package Package::libiodbc; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '3.52.12'; 9 | 10 | 11 | sub dependency_names { 12 | return qw(); 13 | } 14 | 15 | 16 | 17 | sub base_url { 18 | #return "ftp://fr.rpmfind.net/pub/libxml"; 19 | return "https://github.com/openlink/iODBC/releases/download/v$VERSION"; 20 | } 21 | 22 | 23 | sub packagename { 24 | return "libiodbc-" . $VERSION; 25 | } 26 | 27 | 28 | sub configure_flags { 29 | my $self = shift @_; 30 | my $prefix = $self->config()->prefix(); 31 | return $self->SUPER::configure_flags() . ""; 32 | } 33 | 34 | 35 | sub subpath_for_check { 36 | return "lib/libodbc.a"; 37 | } 38 | 39 | 40 | sub php_extension_configure_flags { 41 | my $self = shift @_; 42 | my (%args) = @_; 43 | return "--with-libxml-dir=" . $self->config()->prefix(); 44 | } 45 | 46 | sub make_flags { 47 | my $self = shift @_; 48 | return ""; 49 | } 50 | 51 | 52 | 53 | 54 | 1; 55 | 56 | -------------------------------------------------------------------------------- /lib/Package/libjpeg.pm: -------------------------------------------------------------------------------- 1 | package Package::libjpeg; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '7'; 9 | 10 | sub base_url { 11 | return "http://www.ijg.org/files"; 12 | } 13 | 14 | sub packagename { 15 | return "jpeg-$VERSION"; 16 | } 17 | 18 | sub filename { 19 | return "jpegsrc.v$VERSION.tar.gz"; 20 | } 21 | 22 | #http://www.ijg.org/files/jpegsrc.v7.tar.gz 23 | 24 | sub is_built { 25 | my $self = shift @_; 26 | return -e $self->packagesrcdir() . "/libjpeg.a"; 27 | } 28 | 29 | sub subpath_for_check { 30 | my $self = shift @_; 31 | return "lib/libjpeg.a"; 32 | } 33 | 34 | sub configure_flags { 35 | my $self = shift @_; 36 | return $self->SUPER::configure_flags(@_) . " --disable-dependency-tracking"; 37 | } 38 | 39 | sub install { 40 | 41 | my $self = shift @_; 42 | return undef unless ($self->SUPER::install(@_)); 43 | 44 | $self->cd_packagesrcdir(); 45 | $self->shell("make install-libLTLIBRARIES"); 46 | $self->shell("make install-includeHEADERS"); 47 | } 48 | 49 | sub php_extension_configure_flags { 50 | 51 | my $self = shift @_; 52 | my (%args) = @_; 53 | 54 | return "--with-jpeg-dir=" . $self->config()->prefix(); 55 | 56 | } 57 | 58 | 1; -------------------------------------------------------------------------------- /lib/Package/libmemcached.pm: -------------------------------------------------------------------------------- 1 | package Package::libmemcached; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.0.18'; 9 | 10 | sub dependency_names { 11 | return qw(libevent); 12 | } 13 | sub base_url { 14 | # return "http://download.tangent.org/"; 15 | return "https://launchpad.net/libmemcached/1.0/$VERSION/+download/"; 16 | 17 | } 18 | 19 | sub packagename { 20 | return "libmemcached-$VERSION"; 21 | } 22 | 23 | sub filename { 24 | return "libmemcached-$VERSION.tar.gz"; 25 | } 26 | 27 | 28 | #http://download.tangent.org/libmemcached-0.34.tar.gz 29 | #https://launchpad.net/libmemcached/1.0/0.38/+download/libmemcached-0.38.tar.gz 30 | 31 | sub is_built { 32 | my $self = shift @_; 33 | return -e $self->packagesrcdir() . "/libmemcached.dylib"; 34 | } 35 | 36 | sub subpath_for_check { 37 | my $self = shift @_; 38 | return "lib/libmemcached.dylib"; 39 | } 40 | 41 | sub configure_flags { 42 | my $self = shift @_; 43 | # check if we do a debug build: 44 | return $self->SUPER::configure_flags(@_) . " --without-mysql --disable-dependency-tracking"; 45 | } 46 | 47 | sub install { 48 | 49 | my $self = shift @_; 50 | return undef unless ($self->SUPER::install(@_)); 51 | 52 | $self->cd_packagesrcdir(); 53 | $self->shell("make install"); 54 | } 55 | 56 | # sub php_extension_configure_flags { 57 | # 58 | # my $self = shift @_; 59 | # my (%args) = @_; 60 | # 61 | # return "--with-jpeg-dir=" . $self->config()->prefix(); 62 | # 63 | # } 64 | 65 | 66 | sub patchfiles { 67 | my $self = shift @_; 68 | return qw(libmemcached.patch); 69 | #return qw(php-entropy.patch php-entropy-imap.patch); 70 | } 71 | 72 | 1; 73 | 74 | -------------------------------------------------------------------------------- /lib/Package/libpng.pm: -------------------------------------------------------------------------------- 1 | package Package::libpng; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.2.51'; 9 | 10 | sub base_url { 11 | return "http://downloads.sourceforge.net/project/libpng/libpng12/$VERSION"; 12 | } 13 | 14 | sub packagename { 15 | return "libpng-$VERSION"; 16 | } 17 | 18 | 19 | sub subpath_for_check { 20 | return "lib/libpng.dylib"; 21 | } 22 | 23 | 24 | sub configure_flags { 25 | my $self = shift @_; 26 | return $self->SUPER::configure_flags(@_) . " --without-x --disable-dependency-tracking"; 27 | } 28 | 29 | 30 | sub php_extension_configure_flags { 31 | my $self = shift @_; 32 | my (%args) = @_; 33 | return "--with-png-dir=" . $self->config()->prefix(); 34 | } 35 | 36 | 37 | 38 | 1; 39 | -------------------------------------------------------------------------------- /lib/Package/libssh2.pm: -------------------------------------------------------------------------------- 1 | package Package::libssh2; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.8.0'; 9 | 10 | sub base_url { 11 | return "http://libssh2.org/download"; 12 | } 13 | 14 | sub packagename { 15 | return "libssh2-$VERSION"; 16 | } 17 | 18 | sub filename { 19 | return "libssh2-$VERSION.tar.gz"; 20 | } 21 | 22 | sub subpath_for_check { 23 | return "lib/libssh2.1.dylib"; 24 | } 25 | 26 | sub configure_flags { 27 | my $self = shift @_; 28 | return $self->SUPER::configure_flags(@_) . " --disable-dependency-tracking"; 29 | } 30 | 31 | sub install { 32 | my $self = shift @_; 33 | return undef unless ($self->SUPER::install(@_)); 34 | 35 | $self->cd_packagesrcdir(); 36 | $self->shell("make install"); 37 | } 38 | 39 | 1; 40 | -------------------------------------------------------------------------------- /lib/Package/libtiff.pm: -------------------------------------------------------------------------------- 1 | package Package::libtiff; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '3.9.1'; 9 | 10 | sub base_url { 11 | return "http://download.osgeo.org/libtiff/"; 12 | } 13 | 14 | sub packagename { 15 | return "tiff-$VERSION"; 16 | } 17 | 18 | sub filename { 19 | return "tiff-$VERSION.tar.gz"; 20 | } 21 | 22 | #ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.1.tar.gz 23 | 24 | sub dependency_names { 25 | return qw(libjpeg); 26 | } 27 | 28 | sub is_built { 29 | my $self = shift @_; 30 | return -e $self->packagesrcdir() . "/libtiff.a"; 31 | } 32 | 33 | sub subpath_for_check { 34 | my $self = shift @_; 35 | return "lib/libtiff.a"; 36 | } 37 | 38 | sub configure_flags { 39 | my $self = shift @_; 40 | my $prefix = $self->config()->prefix(); 41 | 42 | return $self->SUPER::configure_flags(@_) . " --disable-dependency-tracking"; 43 | } 44 | 45 | sub install { 46 | 47 | my $self = shift @_; 48 | return undef unless ($self->SUPER::install(@_)); 49 | 50 | $self->cd_packagesrcdir(); 51 | $self->shell("make install"); 52 | } 53 | 54 | # sub php_extension_configure_flags { 55 | # 56 | # my $self = shift @_; 57 | # my (%args) = @_; 58 | # 59 | # return "--with-jpeg-dir=" . $self->config()->prefix(); 60 | # 61 | # } 62 | 63 | 1; -------------------------------------------------------------------------------- /lib/Package/libxml2.pm: -------------------------------------------------------------------------------- 1 | package Package::libxml2; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2.9.2'; 9 | 10 | 11 | sub dependency_names { 12 | return qw(); 13 | } 14 | 15 | 16 | 17 | sub base_url { 18 | #return "ftp://fr.rpmfind.net/pub/libxml"; 19 | return "http://xmlsoft.org/sources"; 20 | } 21 | 22 | 23 | sub packagename { 24 | return "libxml2-" . $VERSION; 25 | } 26 | 27 | 28 | sub configure_flags { 29 | my $self = shift @_; 30 | my $prefix = $self->config()->prefix(); 31 | return $self->SUPER::configure_flags() . " --disable-dependency-tracking --without-python"; 32 | } 33 | 34 | 35 | sub subpath_for_check { 36 | return "lib/libxml2.dylib"; 37 | } 38 | 39 | 40 | sub php_extension_configure_flags { 41 | my $self = shift @_; 42 | my (%args) = @_; 43 | return "--with-libxml-dir=" . $self->config()->prefix(); 44 | } 45 | 46 | sub make_flags { 47 | my $self = shift @_; 48 | return ""; 49 | } 50 | 51 | 52 | 53 | 54 | 1; 55 | -------------------------------------------------------------------------------- /lib/Package/libxslt.pm: -------------------------------------------------------------------------------- 1 | package Package::libxslt; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.1.28'; 9 | 10 | 11 | 12 | sub dependency_names { 13 | return qw(); 14 | } 15 | 16 | 17 | sub base_url { 18 | return "http://xmlsoft.org/sources"; 19 | } 20 | 21 | 22 | sub packagename { 23 | return "libxslt-" . $VERSION; 24 | } 25 | 26 | 27 | 28 | sub subpath_for_check { 29 | return "lib/libxslt.dylib"; 30 | } 31 | 32 | 33 | 34 | sub configure_flags { 35 | my $self = shift @_; 36 | return $self->SUPER::configure_flags() . " --without-crypto --disable-dependency-tracking --without-python --with-libxml-prefix=/usr" #. $self->install_prefix(); 37 | 38 | } 39 | 40 | 41 | 42 | sub php_extension_configure_flags { 43 | 44 | my $self = shift @_; 45 | my (%args) = @_; 46 | 47 | return "--with-xsl=shared," . $self->config()->prefix(); 48 | 49 | } 50 | 51 | 52 | 53 | sub php_dso_extension_names { 54 | my $self = shift @_; 55 | return qw(xsl); 56 | } 57 | 58 | 59 | sub package_filelist { 60 | my $self = shift @_; 61 | return $self->php_dso_extension_paths(), qw(php.d/50-extension-xsl.ini lib/libexslt*.dylib lib/libxslt*.dylib); 62 | } 63 | 64 | 65 | 66 | 1; 67 | -------------------------------------------------------------------------------- /lib/Package/mcrypt.pm: -------------------------------------------------------------------------------- 1 | package Package::mcrypt; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2.5.8'; 9 | 10 | 11 | sub base_url { 12 | return "http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/$VERSION"; 13 | } 14 | 15 | 16 | sub packagename { 17 | return "libmcrypt-" . $VERSION; 18 | } 19 | 20 | 21 | 22 | sub subpath_for_check { 23 | return "lib/libmcrypt.dylib"; 24 | } 25 | 26 | 27 | 28 | sub php_extension_configure_flags { 29 | my $self = shift @_; 30 | my (%args) = @_; 31 | return "--with-mcrypt=shared," . $self->config()->prefix(); 32 | } 33 | 34 | sub configure_flags { 35 | my $self = shift @_; 36 | return $self->SUPER::configure_flags(@_) . " --disable-dependency-tracking"; 37 | } 38 | 39 | sub php_dso_extension_names { 40 | my $self = shift @_; 41 | return $self->shortname(); 42 | } 43 | 44 | 45 | 46 | 47 | sub package_filelist { 48 | my $self = shift @_; 49 | return $self->php_dso_extension_paths(), qw( 50 | lib/libmcrypt*.dylib 51 | php.d/50-extension-mcrypt.ini 52 | ); 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 1; 60 | -------------------------------------------------------------------------------- /lib/Package/memcache.pm: -------------------------------------------------------------------------------- 1 | package Package::memcache; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '3.0.8'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'memcache'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | #from http://serverfault.com/questions/386392/troubles-with-memcache-so 18 | 19 | 20 | sub compiler_archflags { 21 | my $self = shift @_; 22 | return $self->SUPER::compiler_archflags(@_) . ' -fgnu89-inline' ; 23 | } 24 | 25 | 26 | return 1; 27 | 28 | 29 | -------------------------------------------------------------------------------- /lib/Package/memcached.pm: -------------------------------------------------------------------------------- 1 | package Package::memcached; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '3.0.3'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'memcached'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub dependency_names { 18 | return qw(libmemcached); 19 | } 20 | 21 | sub configure_flags { 22 | my $self = shift @_; 23 | return join " ", ( 24 | $self->SUPER::configure_flags(@_), 25 | '--with-libmemcached-dir=' . $self->config()->prefix() 26 | ); 27 | } 28 | 29 | return 1; 30 | -------------------------------------------------------------------------------- /lib/Package/mhash.pm: -------------------------------------------------------------------------------- 1 | package Package::mhash; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '0.9.9.9'; 9 | 10 | 11 | 12 | sub base_url { 13 | return "http://switch.dl.sourceforge.net/sourceforge/mhash"; 14 | } 15 | 16 | 17 | sub packagename { 18 | return "mhash-" . $VERSION; 19 | } 20 | 21 | 22 | sub subpath_for_check { 23 | return "lib/libmhash.dylib"; 24 | } 25 | 26 | 27 | sub php_extension_configure_flags { 28 | my $self = shift @_; 29 | my (%args) = @_; 30 | return "--with-mhash=shared," . $self->config()->prefix(); 31 | } 32 | 33 | 34 | sub php_dso_extension_names { 35 | my $self = shift @_; 36 | return $self->shortname(); 37 | } 38 | 39 | 40 | sub package_filelist { 41 | my $self = shift @_; 42 | return $self->php_dso_extension_paths(), qw( 43 | lib/libmhash*.dylib 44 | php.d/50-extension-mhash.ini 45 | ); 46 | } 47 | 48 | 49 | 50 | 51 | 1; 52 | -------------------------------------------------------------------------------- /lib/Package/mongodb.pm: -------------------------------------------------------------------------------- 1 | package Package::mongodb; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '1.2.9'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'mongodb'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub configure_flags { 18 | my $self = shift @_; 19 | return join " ", ( 20 | $self->SUPER::configure_flags(@_), 21 | '--with-openssl-dir=' . $self->config()->prefix() 22 | ); 23 | 24 | } 25 | 26 | sub packagesrcdir { 27 | my $self = shift @_; 28 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 29 | } 30 | 31 | return 1; 32 | -------------------------------------------------------------------------------- /lib/Package/mssql.pm: -------------------------------------------------------------------------------- 1 | package Package::mssql; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '0.91'; 9 | 10 | 11 | sub base_url { 12 | return "http://mirrors.ibiblio.org/freetds/stable/"; 13 | } 14 | 15 | 16 | sub packagename { 17 | return "freetds-" . $VERSION; 18 | } 19 | 20 | 21 | sub subpath_for_check { 22 | return "lib/libsybdb.dylib"; 23 | } 24 | 25 | sub configure_flags { 26 | my $self = shift @_; 27 | # check if we do a debug build: 28 | my $debugflag = $self->config()->debug() ? ' --enable-debug' : ''; 29 | return $self->SUPER::configure_flags(@_) . " --disable-rpath --enable-msdblib --with-tdsver=8.0 $debugflag"; 30 | } 31 | 32 | sub build_postconfigure { 33 | my $self = shift @_; 34 | $self->shell('cp /usr/local/bin/glibtool libtool'); 35 | $self->shell('sed -i "" "#../replacements/libreplacements.la#d" src/server/Makefile.in src/ctlib/Makefile.in src/odbc/Makefile.in src/dblib/Makefile.in src/apps/Makefile.in'); 36 | $self->shell('sed -i "" "#../../replacements/libreplacements.la#d" src/apps/fisql/Makefile.in src/dblib/unittests/Makefile.in src/tds/unittests/Makefile.in'); 37 | } 38 | 39 | sub php_extension_configure_flags { 40 | my $self = shift @_; 41 | my (%args) = @_; 42 | my $prefix = $self->config()->prefix(); 43 | return "--with-mssql=shared,$prefix --with-pdo-dblib=shared,$prefix"; 44 | } 45 | 46 | 47 | 48 | 49 | sub php_dso_extension_names { 50 | my $self = shift @_; 51 | return qw(mssql pdo_dblib); 52 | } 53 | 54 | 55 | sub build_configure { 56 | my $self = shift @_; 57 | 58 | my $cflags = $self->cflags(); 59 | my $ldflags = $self->ldflags(); 60 | my $cxxflags = $self->compiler_archflags(); 61 | my $archflags = $self->compiler_archflags(); 62 | my $cc = $self->cc(); 63 | 64 | my $prefix = $self->config()->prefix(); 65 | $self->shell(qq(MACOSX_DEPLOYMENT_TARGET=10.10 CFLAGS="$cflags" LDFLAGS='$ldflags' CXXFLAGS='$cxxflags' CC='$cc $archflags' CPP='cpp' ./configure ) . $self->configure_flags()); 66 | } 67 | 68 | 69 | sub package_filelist { 70 | my $self = shift @_; 71 | 72 | # the .so files as built by the FreeTDS build might be broken. might need to investigate. 73 | return $self->php_dso_extension_paths(), qw( 74 | etc/freetds.conf etc/locales.conf etc/pool.conf 75 | lib/libtds*.dylib lib/libct*.dylib lib/libsybdb*.dylib lib/libtdsodbc*.so lib/libtdssrv*.dylib 76 | php.d/50-extension-mssql.ini 77 | ); 78 | } 79 | 80 | 81 | 82 | 83 | 84 | 1; 85 | -------------------------------------------------------------------------------- /lib/Package/mysql.pm: -------------------------------------------------------------------------------- 1 | package Package::mysql; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '5.6.20'; 9 | 10 | 11 | sub init { 12 | my $self = shift @_; 13 | $self->SUPER::init(@_); 14 | $self->config()->mysql_install_prefix($self->install_prefix()); 15 | } 16 | 17 | 18 | sub base_url { 19 | my ($major, $minor, $patch) = $VERSION =~ /^(\d+)\.(\d+)\.(\d+)/; 20 | return "http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-$major.$minor/"; 21 | } 22 | 23 | 24 | sub packagename { 25 | return "mysql-" . $VERSION; 26 | } 27 | 28 | 29 | sub subpath_for_check { 30 | return "lib/mysql/libmysqlclient.dylib"; 31 | } 32 | 33 | 34 | sub configure_flags { 35 | my $self = shift @_; 36 | return $self->SUPER::configure_flags(@_) . " --without-server --enable-thread-safe-client"; 37 | } 38 | 39 | 40 | sub make_install_sourcedirs { 41 | my $self = shift @_; 42 | return map {$self->packagesrcdir() . "/$_"} qw(include libmysql scripts); 43 | } 44 | 45 | 46 | sub php_extension_configure_flags { 47 | my $self = shift @_; 48 | my (%args) = @_; 49 | my $mysql_prefix = $self->config()->mysql_install_prefix(); 50 | die "mysql install prefix '$mysql_prefix' does not exist" unless (-d $mysql_prefix); 51 | return "--with-mysql=shared,$mysql_prefix --with-mysqli=shared,$mysql_prefix/bin/mysql_config --with-pdo-mysql=shared,$mysql_prefix --with-mysql-sock=/tmp/mysql.sock"; 52 | } 53 | 54 | 55 | sub install { 56 | my $self = shift @_; 57 | $self->SUPER::install(@_); 58 | $self->cd_packagesrcdir(); 59 | my $prefix = $self->config()->prefix(); 60 | $self->shell("cp include/mysqld_error.h $prefix/include/mysql"); 61 | } 62 | 63 | 64 | sub php_dso_extension_names { 65 | my $self = shift @_; 66 | return qw(mysql mysqli pdo_mysql); 67 | } 68 | 69 | 70 | sub package_filelist { 71 | my $self = shift @_; 72 | return 73 | $self->php_dso_extension_paths(), 74 | qw( 75 | lib/mysql/lib*.dylib 76 | php.d/50-extension-*mysql*.ini 77 | ); 78 | } 79 | 80 | 81 | 1; 82 | -------------------------------------------------------------------------------- /lib/Package/oauth.pm: -------------------------------------------------------------------------------- 1 | package Package::oauth; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.0.2'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'oauth'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | return 1; 23 | -------------------------------------------------------------------------------- /lib/Package/openssl.pm: -------------------------------------------------------------------------------- 1 | package Package::openssl; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '1.0.2k'; 9 | 10 | sub base_url { 11 | return "https://www.openssl.org/source/"; 12 | } 13 | 14 | sub packagename { 15 | return "openssl-" . $VERSION; 16 | } 17 | 18 | sub filename { 19 | my ($self) = shift; 20 | return $self->packagename() . ".tar.gz"; 21 | } 22 | 23 | 24 | sub subpath_for_check { 25 | return "lib/libssl.a"; 26 | } 27 | 28 | sub build_configure { 29 | my ($self) = shift; 30 | $self->shell('./Configure darwin64-x86_64-cc --prefix=/usr/local/php5/'); 31 | $self->shell('make depend'); 32 | } 33 | 34 | sub make_command { 35 | my $self = shift @_; 36 | return "make"; 37 | } 38 | 39 | 40 | 1; 41 | -------------------------------------------------------------------------------- /lib/Package/pearbase.pm: -------------------------------------------------------------------------------- 1 | package Package::pearbase; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '1.0'; 9 | 10 | sub init { 11 | my $self = shift @_; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'PEAR'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub base_url { 18 | return "http://pear.php.net/get"; 19 | } 20 | 21 | sub packagename { 22 | my $self = shift @_; 23 | return $self->{PACKAGE_NAME} . "-" . $self->{VERSION}; 24 | } 25 | 26 | sub filename { 27 | my $self = shift @_; 28 | return $self->packagename() . ".tgz"; 29 | } 30 | 31 | sub install { 32 | my $self = shift @_; 33 | return undef if ($self->is_installed()); 34 | 35 | $self->unpack(); 36 | 37 | my $src = $self->packagesrcdir(); 38 | my $dst = $self->install_prefix() . '/lib/php/' . $self->{PACKAGE_NAME}; 39 | 40 | # move package folder to lib/php 41 | $self->shell({silent => 0}, "cp -R $src/" . $self->{PACKAGE_NAME} . " $dst"); 42 | } 43 | 44 | sub extension_ini{ 45 | } 46 | 47 | sub subpath_for_check { 48 | my $self = shift @_; 49 | return sprintf("lib/php/%s", lc($self->{PACKAGE_NAME})); 50 | } 51 | 52 | 1; -------------------------------------------------------------------------------- /lib/Package/pecl_http.pm: -------------------------------------------------------------------------------- 1 | package Package::pecl_http; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '3.0.1'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'pecl_http'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | sub configure_flags { 23 | my $self = shift @_; 24 | my (%args) = @_; 25 | return join " ", ( 26 | $self->SUPER::configure_flags(@_), 27 | '--with-http-libcurl-dir=' . $self->config()->prefix(), 28 | '--with-http-libevent-dir=' . $self->config()->prefix(), 29 | '--with-http-zlib-dir=' . $self->config()->prefix() 30 | ); 31 | } 32 | 33 | sub cc { 34 | my $self = shift @_; 35 | my $prefix = $self->config()->prefix(); 36 | 37 | # - the -L forces our custom iconv before the apple-supplied one 38 | # - the -I makes sure the libxml2 version number for phpinfo() is picked up correctly, 39 | # i.e. ours and not the system-supplied libxml 40 | return $self->SUPER::cc(@_) . " -I$prefix/include/php/ext/raphf -I$prefix/include/php/ext/propro"; 41 | } 42 | 43 | sub install { 44 | my $self = shift @_; 45 | return undef if ($self->is_installed()); 46 | 47 | $self->build(); 48 | 49 | my $dst = $self->full_install_extension_dir(); 50 | 51 | $self->shell(sprintf("sudo cp modules/%s.so $dst", "http")); 52 | $self->shell({silent => 0}, "echo 'extension=" . $dst . "http.so' > /tmp/60-extension-" . $self->shortname() . ".ini"); 53 | $self->shell("sudo mv /tmp/60-extension-" . $self->shortname() . ".ini " .$self->install_prefix() . "/php.d/") 54 | } 55 | 56 | return 1; 57 | -------------------------------------------------------------------------------- /lib/Package/peclbase.pm: -------------------------------------------------------------------------------- 1 | package Package::peclbase; 2 | 3 | =pod 4 | 5 | Base class for PECL packages. Packages that extend this class are intended to be built 6 | independently of the main PHP build ( i.e. as separate steps in build-php.pl ) 7 | 8 | =cut 9 | 10 | use strict; 11 | use warnings; 12 | 13 | use base qw(Package); 14 | 15 | sub init { 16 | my $self = shift; 17 | $self->SUPER::init(@_); 18 | $self->{PACKAGE_NAME} = undef; 19 | $self->{VERSION} = undef; 20 | } 21 | 22 | sub base_url { 23 | my $self = shift; 24 | return "http://pecl.php.net/get"; 25 | } 26 | 27 | sub packagename { 28 | my ($self) = shift; 29 | return $self->{PACKAGE_NAME} . "-" . $self->{VERSION}; 30 | } 31 | 32 | sub filename { 33 | my ($self) = shift; 34 | return $self->packagename() . ".tgz"; 35 | } 36 | 37 | sub build_preconfigure { 38 | my $self = shift @_; 39 | $self->cd_packagesrcdir(); 40 | $self->shell($self->install_prefix() . '/bin/phpize 3>&1 2>&3 1>>/tmp/build-entropy-php.log'); 41 | } 42 | 43 | sub configure_flags { 44 | my $self = shift @_; 45 | return join " ", ( 46 | $self->SUPER::configure_flags(@_), 47 | '--enable-' . lc($self->{PACKAGE_NAME}), 48 | '--with-php-config=' . $self->install_prefix() . '/bin/php-config' 49 | ); 50 | } 51 | 52 | sub install { 53 | my $self = shift @_; 54 | return undef if ($self->is_installed()); 55 | 56 | $self->build(); 57 | 58 | my $dst = $self->full_install_extension_dir(); 59 | $self->shell(sprintf("sudo cp modules/%s.so $dst", lc($self->{PACKAGE_NAME}))); 60 | $self->extension_ini($dst); 61 | $self->mv_ini_to_php_d(); 62 | } 63 | 64 | sub mv_ini_to_php_d { 65 | my $self = shift @_; 66 | $self->shell("sudo mv /tmp/50-extension-" . lc($self->shortname()) . ".ini " .$self->install_prefix() . "/php.d/") 67 | } 68 | 69 | sub extension_ini{ 70 | my ($self, $dst) = @_; 71 | $self->shell({silent => 0}, "echo 'extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 72 | } 73 | 74 | sub subpath_for_check { 75 | my $self = shift; 76 | return sprintf("%s/%s.so", $self->install_extension_dir(), lc($self->{PACKAGE_NAME})); 77 | } 78 | 79 | 1; 80 | -------------------------------------------------------------------------------- /lib/Package/php5.pm: -------------------------------------------------------------------------------- 1 | package Package::php5; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use IO::File; 7 | use IO::Dir; 8 | 9 | use base qw(Package); 10 | 11 | # todo: 12 | # rework this so it runs normally and a third time for the cli version. 13 | # add the new cli/cgi (?) as php-cli or php-cgi 14 | # enable --enable-pcntl and fastcgi for the cgi version 15 | 16 | sub base_url { 17 | my $self = shift @_; 18 | my $v = $self->config()->version(); 19 | 20 | if ($v ~~ /master/) { 21 | return "https://github.com/php/php-src/archive"; 22 | } else { 23 | #return "http://downloads.php.net/~ab"; 24 | return "http://ch1.php.net/distributions"; 25 | } 26 | } 27 | 28 | 29 | sub packagename { 30 | my $self = shift @_; 31 | my $v = $self->config()->version(); 32 | if ($v ~~ /master/) { 33 | return "" . $self->config()->version(); 34 | } else { 35 | return "php-" . $self->config()->version(); 36 | } 37 | } 38 | 39 | sub packagesrcdir { 40 | my $self = shift @_; 41 | my $dlpath = $self->download_path(); 42 | my $exists = -e $dlpath; 43 | $self->download() unless ($exists); 44 | 45 | my $srcdir = `tar -tzf $dlpath | head -1`; 46 | $srcdir =~ s/^\s+//; 47 | $srcdir =~ s/\s+$//; 48 | return $self->config()->srcdir() . "/" .$srcdir; 49 | } 50 | 51 | sub dependency_names { 52 | return qw( openssl icu libxslt imapcclient gettext curl libpng libjpeg libtiff libgif libfreetype postgresql mcrypt tidy gmp readline libiodbc); 53 | #before 10.8 54 | #return qw(iconv icu mssql libxml2 libxslt imapcclient gettext curl libpng libjpeg libtiff libgif libfreetype postgresql mcrypt tidy); 55 | } 56 | 57 | sub subpath_for_check { 58 | return "libphp7.so"; 59 | } 60 | 61 | 62 | # broken ming build setup can not handle distclean target 63 | sub cleanup_srcdir { 64 | my $self = shift @_; 65 | $self->cd_srcdir(); 66 | $self->shell("rm -rf php-*"); 67 | $self->unpack(); 68 | } 69 | 70 | 71 | sub configure_flags { 72 | my $self = shift @_; 73 | my %args = @_; 74 | my $prefix = $self->config()->prefix(); 75 | 76 | my @extension_flags = ( 77 | "--with-config-file-scan-dir=$prefix/php.d", 78 | '--with-libxml-dir=shared,/usr', 79 | '--with-openssl=/usr/local/php5', 80 | '--with-zlib=/usr', 81 | '--with-zlib-dir=/usr', 82 | '--with-gd', 83 | '--with-ldap', 84 | '--enable-exif', 85 | '--with-xmlrpc', 86 | '--enable-exif', 87 | '--enable-soap', 88 | '--enable-wddx', 89 | '--enable-ftp', 90 | '--with-iodbc', 91 | '--enable-sockets', 92 | '--with-bz2=/usr', 93 | '--enable-zip', 94 | '--enable-pcntl', 95 | '--enable-shmop', 96 | '--enable-sysvsem', 97 | '--enable-sysvshm', 98 | '--enable-sysvmsg', 99 | '--enable-mbstring', 100 | '--enable-bcmath', 101 | '--enable-calendar', 102 | '--with-mhash', 103 | '--enable-fpm', 104 | '--with-mysql=mysqlnd', 105 | '--with-mysqli=mysqlnd', 106 | '--with-pdo-mysql=mysqlnd', 107 | '--enable-pcntl', 108 | '--enable-dtrace', 109 | '--disable-phpdbg', 110 | '--enable-opcache', 111 | ); 112 | # Missing in 10.10 113 | # '--with-iodbc', 114 | 115 | push @extension_flags, $self->dependency_extension_flags(%args); 116 | 117 | my $apxs_option = $self->config()->variants()->{$self->{variant}}->{apxs_option}; 118 | return $self->SUPER::configure_flags() . " $apxs_option @extension_flags"; 119 | 120 | } 121 | 122 | sub build_postconfigure { 123 | my $self = shift @_; 124 | #$self->shell("sed -i '' -e 's#\$echo#\$ECHO#g' libtool"); 125 | } 126 | 127 | sub build_preconfigure { 128 | my $self = shift @_; 129 | my (%args) = @_; 130 | 131 | # give extension modules a chance to tweak the contents of the ext directory 132 | foreach my $dependency ($self->dependencies()) { 133 | $self->cd_packagesrcdir(); 134 | $self->cd('ext'); 135 | $dependency->php_build_pre(%args, php_package => $self); 136 | } 137 | 138 | $self->cd_packagesrcdir(); 139 | #$self->shell("aclocal"); 140 | $self->shell("./buildconf --force"); 141 | $self->shell({fatal => 0}, "ranlib " . $self->install_prefix() . "/lib/*.a"); 142 | $self->shell({fatal => 0}, "ranlib " . $self->install_tmp_prefix() . "/lib/*.a"); 143 | 144 | } 145 | 146 | sub dependency_extension_flags { 147 | my $self = shift @_; 148 | my (%args) = @_; 149 | 150 | # fixme: figure out something for extensions with fewer archs 151 | #return map {$_->php_extension_configure_flags()} grep {$_->supports_arch($args{arch})} $self->dependencies(); 152 | return map {$_->php_extension_configure_flags()} $self->dependencies(); 153 | } 154 | 155 | sub install { 156 | 157 | my $self = shift @_; 158 | return undef if ($self->is_installed()); 159 | 160 | $self->build(); 161 | 162 | my $dst = $self->install_prefix(); 163 | system("mkdir -p $dst"); 164 | die "Unable to find or create installation dir '$dst'" unless (-d $dst); 165 | 166 | my $install_override = $self->make_install_override_list(prefix => $dst); 167 | $self->shell($self->make_command() . " $install_override install-$_") foreach qw(cli build headers programs modules fpm cgi); 168 | 169 | $self->shell("cp libs/libphp7.so $dst"); 170 | $self->shell("rm $dst/lib/php/extensions/*/*.a"); 171 | 172 | 173 | # $self->SUPER::install(@_); 174 | 175 | my $extrasdir = $self->extras_dir(); 176 | my $prefix = $self->config()->prefix(); 177 | 178 | 179 | $self->cd_packagesrcdir(); 180 | $self->shell({silent => 0}, "cat $extrasdir/dist/entropy-php.conf | sed -e 's!{prefix}!$prefix!g' > $prefix/entropy-php.conf"); 181 | $self->shell({silent => 0}, "cat $extrasdir/dist/activate-entropy-php.py | sed -e 's!{prefix}!$prefix!g' > $prefix/bin/activate-entropy-php.py"); 182 | $self->shell({silent => 0}, "cp php.ini-production php.ini-recommended"); 183 | $self->shell({silent => 0}, "cp php.ini-recommended $prefix/lib/"); 184 | $self->shell({silent => 0}, "cp php.ini-development $prefix/lib/"); 185 | $self->shell({silent => 0}, "cp php.ini-development $prefix/lib/php.ini"); 186 | #unless (-e "$prefix/etc/pear.conf.default") { 187 | $self->shell($self->make_command(), "install-pear"); 188 | # $self->shell({silent => 0}, qq!sed -e 's#"[^"]*$prefix\\([^"]*\\)#"$prefix\\1"#g' < $prefix/etc/pear.conf > $prefix/etc/pear.conf.default!); 189 | # $self->shell({silent => 0}, "rm $prefix/etc/pear.conf"); 190 | # $self->shell({silent => 0}, "mv $prefix/etc/pear.conf $prefix/etc/pear.conf.default"); 191 | #} 192 | $self->shell({silent => 0}, "test -d $prefix/php.d || mkdir $prefix/php.d"); 193 | $self->shell({silent => 0}, "perl -p -i -e 's# -L\\S+c-client##' $prefix/bin/php-config"); 194 | $self->shell({silent => 0}, "curl -o $prefix/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem"); 195 | $self->shell({silent => 0}, "echo 'openssl.cafile=/usr/local/php5/ssl/cert.pem' >> $prefix/php.d/40-openssl.ini"); 196 | $self->shell({silent => 0}, "echo 'curl.cainfo=/usr/local/php5/ssl/cert.pem' >> $prefix/php.d/40-curl.ini"); 197 | 198 | $self->create_dso_ini_files(); 199 | 200 | $self->shell({silent => 0}, "sudo chown -R root:wheel '$prefix'"); 201 | $self->shell({silent => 0}, "test -e '$prefix/lib/php/build' || sudo ln -s '$prefix/lib/build' '$prefix/lib/php/'"); 202 | 203 | } 204 | 205 | sub create_dso_ini_files { 206 | my $self = shift @_; 207 | 208 | my @dso_names = grep {$_} map {$_->php_dso_extension_names()} $self->dependencies(); 209 | my $prefix = $self->config()->prefix(); 210 | my $extdir = $self->config()->extdir(); 211 | $self->shell({silent => 0}, "echo 'extension=$_.so' > $prefix/php.d/50-extension-$_.ini") foreach (@dso_names); 212 | $self->shell({silent => 0}, qq!echo 'extension_dir=$prefix/$extdir' > $prefix/php.d/10-extension_dir.ini!); 213 | 214 | # adding some default values 215 | # TODO: fixme 216 | $self->shell({silent => 0}, "echo 'mssql.charset = UTF-8' >> $prefix/php.d/50-extension-mssql.ini"); 217 | my $dst = $self->full_install_extension_dir(); 218 | $self->shell({silent => 0}, "echo 'zend_extension=" . $dst . "opcache.so' > $prefix/php.d/20-extension-opcache.ini"); 219 | # some default value 220 | $self->shell({silent => 0}, "echo '[opcache]' >> $prefix/php.d/20-extension-opcache.ini"); 221 | $self->shell({silent => 0}, "echo 'opcache.enable=0' >> $prefix/php.d/20-extension-opcache.ini"); 222 | } 223 | 224 | sub patchfiles { 225 | my $self = shift @_; 226 | return qw(php-entropy.patch); 227 | #return qw(php-entropy.patch php-entropy-imap.patch); 228 | } 229 | 230 | sub cflags { 231 | my $self = shift @_; 232 | my $supported_archs = join '/', $self->supported_archs(); 233 | my $prefix = $self->config()->prefix(); 234 | return $self->SUPER::cflags(@_) . qq( -no-cpp-precomp -DENTROPY_CH_ARCHS='$supported_archs' -DENTROPY_CH_RELEASE=) . $self->config()->release(); 235 | #-I$prefix/include 236 | } 237 | 238 | sub ldflags { 239 | my $self = shift @_; 240 | my $prefix = $self->config()->prefix(); 241 | 242 | #-bind_at_load 243 | return "-L$prefix/lib " . $self->compiler_archflags(); 244 | } 245 | 246 | sub cc { 247 | my $self = shift @_; 248 | my $prefix = $self->config()->prefix(); 249 | 250 | # - the -L forces our custom iconv before the apple-supplied one 251 | # - the -I makes sure the libxml2 version number for phpinfo() is picked up correctly, 252 | # i.e. ours and not the system-supplied libxml 253 | return $self->SUPER::cc(@_) . " -L$prefix/lib -I$prefix/include -I/usr/include/libxml2 -I$prefix/include/tidy -DENTROPY_CH_RELEASE=" . $self->config()->release(); 254 | } 255 | 256 | 257 | 1; 258 | -------------------------------------------------------------------------------- /lib/Package/phpunit.pm: -------------------------------------------------------------------------------- 1 | package Package::phpunit; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(Package::pearbase); 6 | 7 | our $VERSION = '3.5.6'; 8 | 9 | sub init { 10 | my $self = shift; 11 | $self->SUPER::init(@_); 12 | $self->{PACKAGE_NAME} = "PHPUnit"; 13 | $self->{VERSION} = $VERSION; 14 | } 15 | 16 | sub base_url { 17 | return "http://pear.phpunit.de/get"; 18 | } 19 | 20 | sub install { 21 | my $self = shift @_; 22 | # $self->SUPER::install(@_); 23 | return undef if ($self->is_installed()); 24 | 25 | my $prefix = $self->config()->prefix(); 26 | 27 | my $src = $self->packagesrcdir(); 28 | my $dst = $self->install_prefix() . '/bin'; 29 | $self->shell({fatal => 0, silent => 0},"$prefix/bin/pear channel-discover pear.phpunit.de"); 30 | $self->shell({fatal => 0, silent => 0},"$prefix/bin/pear channel-discover components.ez.no"); 31 | $self->shell({fatal => 0, silent => 0},"$prefix/bin/pear channel-discover pear.symfony-project.com"); 32 | $self->shell({fatal => 0,silent => 0},"$prefix/bin/pear install --force --alldeps phpunit/PHPUnit"); 33 | # create 2 binaries: phpunit and phpdb with sed 34 | # $self->shell({silent => 0}, "sed 's|\@php_bin\@|" . $dst . "\/php|' " . $src . "/phpunit.php >" . $dst . "/phpunit"); 35 | # $self->shell({silent => 0}, "chmod 0755 " . $dst . "/phpunit"); 36 | # $self->shell({silent => 0}, "sed 's|\@php_bin\@|" . $dst . "\/php|' " . $src . "/dbunit.php >" . $dst . "/dbunit"); 37 | # $self->shell({silent => 0}, "chmod 0755 " . $dst . "/dbunit"); 38 | } 39 | 40 | sub subpath_for_check { 41 | my $self = shift @_; 42 | return sprintf("bin/phpunit"); 43 | } 44 | 45 | return 1; -------------------------------------------------------------------------------- /lib/Package/postgresql.pm: -------------------------------------------------------------------------------- 1 | package Package::postgresql; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '9.3.5'; 9 | 10 | 11 | sub base_url { 12 | return "http://ftp.postgresql.org/pub/source/v$VERSION/" 13 | # return "ftp://ftp2.ch.postgresql.org/pub/mirrors/postgresql/source/v$VERSION/"; 14 | } 15 | 16 | 17 | sub packagename { 18 | return "postgresql-" . $VERSION; 19 | } 20 | 21 | 22 | sub subpath_for_check { 23 | return "lib/libpq.dylib"; 24 | } 25 | 26 | 27 | sub make_flags { 28 | return ''; 29 | } 30 | 31 | sub php_extension_configure_flags { 32 | my $self = shift @_; 33 | my (%args) = @_; 34 | my $prefix = $self->config()->prefix(); 35 | return "--with-pgsql=shared,$prefix --with-pdo-pgsql=shared,$prefix"; 36 | } 37 | 38 | 39 | 40 | sub php_dso_extension_names { 41 | my $self = shift @_; 42 | return qw(pgsql pdo_pgsql); 43 | } 44 | 45 | 46 | 47 | sub package_filelist { 48 | my $self = shift @_; 49 | return $self->php_dso_extension_paths(), qw( 50 | lib/libpgtypes*.dylib 51 | lib/libpq*.dylib 52 | php.d/50-extension-*pgsql*.ini 53 | ); 54 | } 55 | 56 | 57 | 58 | # sub configure_flags { 59 | # my $self = shift @_; 60 | # return $self->SUPER::configure_flags() . ' --disable-depend'; 61 | # } 62 | 63 | sub configure_flags { 64 | my $self = shift @_; 65 | return "--with-openssl --disable-depend --without-docdir --prefix=" . $self->install_prefix(); 66 | } 67 | 68 | 69 | 70 | 71 | 1; 72 | -------------------------------------------------------------------------------- /lib/Package/propro.pm: -------------------------------------------------------------------------------- 1 | package Package::propro; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.0.0'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'propro'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | sub install { 23 | 24 | my $self = shift @_; 25 | return undef if ($self->is_installed()); 26 | $self->SUPER::install(@_); 27 | $self->cd_packagesrcdir(); 28 | $self->shell("make install-headers"); 29 | } 30 | 31 | return 1; 32 | -------------------------------------------------------------------------------- /lib/Package/raphf.pm: -------------------------------------------------------------------------------- 1 | package Package::raphf; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.0.0'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'raphf'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | sub install { 23 | 24 | my $self = shift @_; 25 | return undef if ($self->is_installed()); 26 | $self->SUPER::install(@_); 27 | 28 | $self->cd_packagesrcdir(); 29 | $self->shell("make install-headers"); 30 | } 31 | 32 | return 1; 33 | -------------------------------------------------------------------------------- /lib/Package/readline.pm: -------------------------------------------------------------------------------- 1 | package Package::readline; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '6.3'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'readline'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | 18 | sub base_url { 19 | return "http://mirror.switch.ch/ftp/mirror/gnu/readline" 20 | } 21 | 22 | sub packagename { 23 | my ($self) = shift; 24 | return $self->{PACKAGE_NAME} . "-" . $self->{VERSION}; 25 | } 26 | 27 | sub filename { 28 | my ($self) = shift; 29 | return $self->packagename() . ".tar.gz"; 30 | } 31 | 32 | 33 | sub subpath_for_check { 34 | my $self = shift @_; 35 | return "lib/libreadline.a"; 36 | } 37 | 38 | sub configure_flags { 39 | my $self = shift @_; 40 | # check if we do a debug build: 41 | my $debugflag = $self->config()->debug() ? ' --with-debug' : ''; 42 | return $self->SUPER::configure_flags(@_); 43 | } 44 | 45 | sub install { 46 | 47 | my $self = shift @_; 48 | return undef unless ($self->SUPER::install(@_)); 49 | 50 | $self->cd_packagesrcdir(); 51 | $self->shell("make install"); 52 | } 53 | 54 | 55 | 56 | sub php_extension_configure_flags { 57 | my $self = shift @_; 58 | my (%args) = @_; 59 | return "--with-readline=shared," . $self->config()->prefix(); 60 | } 61 | 62 | 63 | 64 | sub php_dso_extension_names { 65 | my $self = shift @_; 66 | return qw(readline); 67 | } 68 | 69 | 70 | sub package_filelist { 71 | my $self = shift @_; 72 | return $self->php_dso_extension_paths(), qw(php.d/50-extension-readline.ini lib/libreadline.a); 73 | } 74 | 75 | 1; 76 | -------------------------------------------------------------------------------- /lib/Package/redis.pm: -------------------------------------------------------------------------------- 1 | package Package::redis; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '3.1.2'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'redis'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | return 1; 23 | -------------------------------------------------------------------------------- /lib/Package/solr.pm: -------------------------------------------------------------------------------- 1 | package Package::solr; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.4.0'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'solr'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/"; 20 | } 21 | 22 | return 1; 23 | -------------------------------------------------------------------------------- /lib/Package/ssh2.pm: -------------------------------------------------------------------------------- 1 | package Package::ssh2; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '1.0'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'ssh2'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | 18 | sub base_url { 19 | return "http://pecl.php.net/get"; 20 | } 21 | 22 | sub packagesrcdir { 23 | my $self = shift @_; 24 | return $self->config()->srcdir() . "/" . $self->packagename() . "/" ; 25 | } 26 | 27 | sub configure_flags { 28 | my $self = shift @_; 29 | return join " ", ( 30 | $self->SUPER::configure_flags(@_), 31 | '--enable-' . lc($self->{PACKAGE_NAME}), 32 | '--with-php-config=' . $self->install_prefix() . '/bin/php-config', 33 | '--with-ssh2=/usr/local/php5' 34 | ); 35 | } 36 | 37 | sub extension_ini{ 38 | my ($self, $dst) = @_; 39 | $self->shell({silent => 0}, "echo 'extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 40 | } 41 | 42 | 1; 43 | -------------------------------------------------------------------------------- /lib/Package/tidy.pm: -------------------------------------------------------------------------------- 1 | package Package::tidy; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | #our $VERSION = ''; 9 | our $VERSION = '20090325'; 10 | 11 | sub base_url { 12 | return "http://php-osx.liip.ch/install/tidy"; 13 | } 14 | 15 | sub packagename { 16 | return "tidy"; 17 | } 18 | 19 | sub filename { 20 | my ($self) = shift; 21 | return $self->packagename() . "-" . $VERSION . ".tar.gz"; 22 | } 23 | 24 | 25 | sub subpath_for_check { 26 | return "lib/libtidy.dylib"; 27 | } 28 | 29 | 30 | 31 | sub package_filelist { 32 | my $self = shift @_; 33 | return qw( 34 | lib/libtidy*.a 35 | ); 36 | } 37 | 38 | sub build_preconfigure { 39 | my $self = shift @_; 40 | $self->shell({silent => 0}, "/bin/sh build/gnuauto/setup.sh"); 41 | } 42 | 43 | sub configure_flags { 44 | my $self = shift @_; 45 | return $self->SUPER::configure_flags(@_) . " --enable-shared --enable-static --disable-dependency-tracking"; 46 | } 47 | 48 | sub build_sourcedirs { 49 | my $self = shift @_; 50 | return ($self->packagesrcdir()); 51 | } 52 | 53 | sub build_make { 54 | my $self = shift @_; 55 | $self->shell($self->make_command()); 56 | } 57 | 58 | sub build { 59 | my $self = shift @_; 60 | return undef if ($self->is_built()); 61 | # prepare 62 | $self->unpack(); 63 | $_->install() foreach $self->dependencies(); 64 | $self->log("building"); 65 | $self->cd_packagesrcdir(); 66 | # autoconf 67 | $self->build_preconfigure(); 68 | # configure 69 | $self->build_configure(); 70 | # build 71 | $self->build_make(); 72 | return 1; 73 | } 74 | 75 | sub php_extension_configure_flags { 76 | my $self = shift @_; 77 | my (%args) = @_; 78 | my $prefix = $self->install_prefix(); 79 | return "--with-tidy=$prefix"; 80 | } 81 | 82 | 1; 83 | -------------------------------------------------------------------------------- /lib/Package/twig.pm: -------------------------------------------------------------------------------- 1 | package Package::twig; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | #our $VERSION = ''; 9 | our $VERSION = '1.16.2'; 10 | 11 | sub init { 12 | my $self = shift; 13 | $self->SUPER::init(@_); 14 | $self->{PACKAGE_NAME} = 'twig'; 15 | $self->{VERSION} = $VERSION; 16 | } 17 | 18 | 19 | sub base_url { 20 | return "http://php-osx.liip.ch/vendorpkgs"; 21 | } 22 | 23 | sub packagesrcdir { 24 | my $self = shift @_; 25 | return $self->config()->srcdir() . "/" . $self->packagename() . "/ext/twig/" ; 26 | } 27 | 28 | sub extension_ini{ 29 | my ($self, $dst) = @_; 30 | $self->shell({silent => 0}, "echo ';extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 31 | } 32 | 33 | 1; 34 | -------------------------------------------------------------------------------- /lib/Package/uploadprogress.pm: -------------------------------------------------------------------------------- 1 | package Package::uploadprogress; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '1.0.3.1'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'uploadprogress'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | 18 | sub extension_ini{ 19 | my ($self, $dst) = @_; 20 | $self->shell({silent => 0}, "echo ';extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 21 | } 22 | 23 | return 1; 24 | -------------------------------------------------------------------------------- /lib/Package/xdebug.pm: -------------------------------------------------------------------------------- 1 | package Package::xdebug; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package); 7 | 8 | our $VERSION = '2.6.0'; 9 | 10 | sub base_url { 11 | return "http://xdebug.org/files/"; 12 | } 13 | 14 | sub packagename { 15 | return "xdebug-" . $VERSION; 16 | } 17 | 18 | sub filename { 19 | my $self = shift @_; 20 | return $self->packagename() .".tgz"; 21 | } 22 | 23 | sub subpath_for_check { 24 | my $self = shift @_; 25 | return $self->install_extension_dir() . 'xdebug.so'; 26 | } 27 | 28 | sub package_filelist { 29 | my $self = shift @_; 30 | return qw( 31 | $self->install_extension_dir() . 'xdebug.so' 32 | ); 33 | } 34 | 35 | sub build_preconfigure { 36 | my $self = shift @_; 37 | $self->cd_packagesrcdir(); 38 | $self->log("xdebug cd_packagesrcd: " . $self->packagesrcdir()); 39 | $self->shell($self->install_prefix() . '/bin/phpize 3>&1 2>&3 1>>/tmp/build-entropy-php.log'); 40 | } 41 | 42 | sub configure_flags { 43 | my $self = shift @_; 44 | return join " ", ( 45 | $self->SUPER::configure_flags(@_), 46 | '--enable-xdebug', 47 | '--with-php-config=' . $self->install_prefix() . '/bin/php-config' 48 | ); 49 | } 50 | 51 | sub install { 52 | my $self = shift @_; 53 | return undef if ($self->is_installed()); 54 | 55 | $self->build(); 56 | 57 | my $dst = $self->full_install_extension_dir(); 58 | 59 | $self->shell("sudo cp modules/xdebug.so $dst"); 60 | $self->shell({silent => 0}, "echo 'zend_extension=" . $dst . $self->shortname() . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 61 | # some default value 62 | $self->shell({silent => 0}, "echo '[xdebug]' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 63 | $self->shell({silent => 0}, "echo 'xdebug.remote_enable=on' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 64 | $self->shell({silent => 0}, "echo 'xdebug.default_enable=on' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 65 | $self->shell({silent => 0}, "echo 'xdebug.remote_autostart=off' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 66 | $self->shell({silent => 0}, "echo 'xdebug.remote_port=9000' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 67 | $self->shell({silent => 0}, "echo 'xdebug.remote_host=localhost' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 68 | $self->shell({silent => 0}, "echo 'xdebug.profiler_enable_trigger=1' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 69 | $self->shell({silent => 0}, "echo 'xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 70 | $self->shell({silent => 0}, "echo 'xdebug.var_display_max_children = 128' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 71 | $self->shell({silent => 0}, "echo 'xdebug.var_display_max_data = 512' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 72 | $self->shell({silent => 0}, "echo 'xdebug.var_display_max_depth = 3' >> /tmp/50-extension-" . $self->shortname() . ".ini"); 73 | 74 | $self->shell("sudo mv /tmp/50-extension-" . $self->shortname() . ".ini " .$self->install_prefix() . "/php.d/") 75 | } 76 | 77 | 1; 78 | -------------------------------------------------------------------------------- /lib/Package/xhprof.pm: -------------------------------------------------------------------------------- 1 | package Package::xhprof; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '0.9.4'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'xhprof'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub packagesrcdir { 18 | my $self = shift @_; 19 | return $self->config()->srcdir() . "/" . $self->packagename() . "/extension"; 20 | } 21 | 22 | ## The following code is needed, if you download from our own repo instead of pecl 23 | ## currently the pecl repo is current enough 24 | 25 | #sub base_url { 26 | # my $self = shift; 27 | # return "http://php-osx.liip.ch/vendorpkgs"; 28 | #} 29 | 30 | return 1; 31 | -------------------------------------------------------------------------------- /lib/Package/xslcache.pm: -------------------------------------------------------------------------------- 1 | package Package::xslcache; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '0.7.1'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'xslcache'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub extension_ini{ 18 | my ($self, $dst) = @_; 19 | $self->shell({silent => 0}, "echo ';extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 20 | } 21 | 22 | sub configure_flags { 23 | my $self = shift @_; 24 | my (%args) = @_; 25 | return "--with-xslcache=shared," . $self->config()->prefix(); 26 | } 27 | 28 | return 1; -------------------------------------------------------------------------------- /lib/Package/yaml.pm: -------------------------------------------------------------------------------- 1 | package Package::yaml; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Package::peclbase); 7 | 8 | our $VERSION = '2.0.0'; 9 | 10 | sub init { 11 | my $self = shift; 12 | $self->SUPER::init(@_); 13 | $self->{PACKAGE_NAME} = 'yaml'; 14 | $self->{VERSION} = $VERSION; 15 | } 16 | 17 | sub extension_ini{ 18 | my ($self, $dst) = @_; 19 | $self->shell({silent => 0}, "echo ';extension=" . $dst . lc($self->shortname()) . ".so' > /tmp/50-extension-" . $self->shortname() . ".ini"); 20 | } 21 | 22 | return 1; 23 | -------------------------------------------------------------------------------- /lib/PackageBase.pm: -------------------------------------------------------------------------------- 1 | package PackageBase; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(Obj); 6 | use File::Glob ':glob'; 7 | 8 | our $VERSION = '1.0'; 9 | 10 | sub init { 11 | my $self = shift @_; 12 | my (%args) = @_; 13 | 14 | $self->{dependencies} ||= []; 15 | 16 | foreach my $name ($self->dependency_names()) { 17 | my $class = 'Package::' . $name; 18 | eval "use $class"; 19 | die if ($@); 20 | push @{$self->{dependencies}}, $class->new(config => $self->config()); 21 | } 22 | } 23 | 24 | sub base_url { 25 | my ($self) = shift; 26 | Carp::croak(sprintf("class %s must override method %s", ref($self) || $self, (caller(0))[3])); 27 | } 28 | 29 | sub packagename { 30 | my ($self) = shift; 31 | Carp::croak(sprintf("class %s must override method %s", ref($self) || $self, (caller(0))[3])); 32 | } 33 | 34 | sub filename { 35 | my ($self) = shift; 36 | return $self->packagename() . ".tar.gz"; 37 | } 38 | 39 | sub packagesrcdir { 40 | my $self = shift @_; 41 | return $self->config()->srcdir() . "/" . $self->packagename(); 42 | } 43 | 44 | sub url { 45 | my $self = shift @_; 46 | return $self->base_url() . "/" . $self->filename(); 47 | } 48 | 49 | sub download_path { 50 | my $self = shift @_; 51 | return $self->config()->downloaddir() . "/" . $self->filename(); 52 | } 53 | 54 | # subclasses should override and call this and do 55 | # nothing if this does not return true 56 | # 57 | sub build { 58 | my $self = shift @_; 59 | return undef if ($self->is_built()); 60 | $self->unpack(); 61 | $_->install() foreach $self->dependencies(); 62 | $self->log("building"); 63 | return 1; 64 | } 65 | 66 | 67 | sub is_built { 68 | my $self = shift @_; 69 | return undef; 70 | } 71 | 72 | # subclasses should override and call this and do 73 | # nothing if this does not return true 74 | # 75 | sub install { 76 | my $self = shift @_; 77 | return undef if ($self->is_installed()); 78 | $self->build(); 79 | $self->log("installing"); 80 | 81 | return 1; 82 | } 83 | 84 | sub is_installed { 85 | my $self = shift @_; 86 | return undef unless ($self->are_dependencies_installed()); 87 | my $subpath = $self->subpath_for_check(); 88 | my $exists = -e $self->install_prefix() . "/$subpath"; 89 | $self->log("not installing because '$subpath' exists") if ($exists); 90 | return $exists; 91 | } 92 | 93 | sub are_dependencies_installed { 94 | my $self = shift @_; 95 | foreach ($self->dependencies()) { 96 | return undef unless ($_->is_installed()); 97 | } 98 | return 1; 99 | } 100 | 101 | sub subpath_for_check { 102 | Carp::confess "subclasses must implement this method or provide a different is_installed() implementation" 103 | } 104 | 105 | sub dependency_names { 106 | return (); 107 | } 108 | 109 | sub dependencies { 110 | my $self = shift; 111 | return @{$self->{dependencies}}; 112 | } 113 | 114 | sub is_downloaded { 115 | my $self = shift @_; 116 | return -f $self->download_path() 117 | } 118 | 119 | sub download { 120 | my $self = shift @_; 121 | $_->download() foreach $self->dependencies(); 122 | return if ($self->is_downloaded()); 123 | $self->log("downloading $self from " . $self->url()); 124 | $self->shell('/usr/bin/curl', '-L -o', $self->download_path(), $self->url()); 125 | } 126 | 127 | sub unpack { 128 | my $self = shift @_; 129 | 130 | return if ($self->is_unpacked()); 131 | $self->download(); 132 | $self->log('unpacking'); 133 | $self->cd_srcdir(); 134 | $self->extract(); 135 | $self->patch(); 136 | } 137 | 138 | sub is_unpacked { 139 | my $self = shift @_; 140 | # $self->log("is unpacked: " . $self->packagesrcdir() . ": " . -d $self->packagesrcdir()); 141 | return -d $self->packagesrcdir(); 142 | } 143 | 144 | sub extract { 145 | my $self = shift @_; 146 | $self->shell('tar -xzf', $self->download_path()); 147 | } 148 | 149 | sub patch { 150 | my $self = shift @_; 151 | 152 | my @patchfiles = $self->patchfiles(); 153 | return unless @patchfiles; 154 | 155 | $self->cd_packagesrcdir(); 156 | foreach my $patchfile (@patchfiles) { 157 | my $path = $self->extras_path($patchfile); 158 | die "patch file '$patchfile' not found in package extras dir" unless (-f $path); 159 | $self->shell("patch -p1 < $path"); 160 | } 161 | } 162 | 163 | sub patchfiles { 164 | return (); 165 | } 166 | 167 | sub cd_srcdir { 168 | my $self = shift @_; 169 | $self->cd($self->config()->srcdir()); 170 | } 171 | 172 | sub cd_packagesrcdir { 173 | my $self = shift @_; 174 | $self->cd($self->packagesrcdir()); 175 | } 176 | 177 | sub make_flags { 178 | my $self = shift @_; 179 | my $cpus = $self->config()->cpus(); 180 | return $cpus > 1 ? " -j $cpus " : ""; 181 | } 182 | 183 | sub make_command { 184 | my $self = shift @_; 185 | return "MACOSX_DEPLOYMENT_TARGET=10.10 make " . $self->make_flags(); 186 | } 187 | 188 | sub make_install_override_list { 189 | my $self = shift @_; 190 | my (%args) = @_; 191 | my $extdir = $self->config()->extdir(); 192 | return "prefix=$args{prefix} exec_prefix=$args{prefix} bindir=$args{prefix}/bin sbindir=$args{prefix}/sbin sysconfdir=$args{prefix}/etc datadir=$args{prefix}/share includedir=$args{prefix}/include libdir=$args{prefix}/lib libexecdir=$args{prefix}/libexec localstatedir=$args{prefix}/var sharedstatedir=$args{prefix}/com mandir=$args{prefix}/man infodir=$args{prefix}/info EXTENSION_DIR=$args{prefix}/$extdir"; 193 | } 194 | 195 | sub configure_flags { 196 | my $self = shift @_; 197 | return "--prefix=" . $self->install_prefix(); 198 | } 199 | 200 | sub shortname { 201 | my $self = shift @_; 202 | my $class = ref($self) || $self; 203 | my ($shortname) = $class =~ /::([^:]+)$/; 204 | 205 | return $shortname; 206 | 207 | } 208 | 209 | sub to_string { 210 | my $self = shift @_; 211 | my $shortname = $self->shortname(); 212 | return "[package $shortname]"; 213 | } 214 | 215 | sub extras_dir { 216 | my $self = shift @_; 217 | return $self->config()->basedir() . '/extras/' . $self->shortname(); 218 | } 219 | 220 | sub extras_path { 221 | my $self = shift @_; 222 | my ($filename) = @_; 223 | return $self->extras_dir() . "/$filename"; 224 | } 225 | 226 | sub cflags { 227 | my $self = shift @_; 228 | my $debugflag = $self->config()->debug() ? '-g -O' : '-Os'; 229 | my $prefix = $self->config()->prefix(); 230 | return "$debugflag -mmacosx-version-min=10.10 -I$prefix/include " . $self->compiler_archflags(); 231 | } 232 | 233 | sub ldflags { 234 | my $self = shift @_; 235 | my $prefix = $self->config()->prefix(); 236 | return "-L$prefix/lib " . $self->compiler_archflags(); 237 | } 238 | 239 | sub cc { 240 | my $self = shift @_; 241 | # this is a hack to override the shipping iconv.h header file with the one 242 | # from the darwin source. Fix taken from: 243 | # http://gorn.ch/archive/2007/11/01/leopard-native-apache-with-custom-64bit-php.html 244 | #my $iconv_include_override_dir = $self->config()->basedir() . "/extras/iconv/leopard-iconv-include-override"; 245 | #return "cc -I$iconv_include_override_dir"; 246 | return "cc"; 247 | } 248 | 249 | sub compiler_archflags { 250 | my $self = shift @_; 251 | return join " ", map {"-arch $_"} $self->all_archs(); 252 | } 253 | 254 | sub compiler_extraflags { 255 | # used to add EXTRA_CFLAGS to configure 256 | my $self = shift @_; 257 | return ""; 258 | } 259 | 260 | sub install_prefix { 261 | my $self = shift @_; 262 | return $self->config()->prefix(); 263 | } 264 | 265 | sub install_extension_dir { 266 | my $self = shift @_; 267 | return 'lib/php/extensions/no-debug-non-zts-20151012/'; 268 | } 269 | 270 | sub full_install_extension_dir { 271 | my $self = shift @_; 272 | return $self->install_prefix() . '/' . $self->install_extension_dir(); 273 | } 274 | 275 | # prefix for packages we don't want to bundle 276 | sub install_tmp_prefix { 277 | my $self = shift @_; 278 | return $self->config()->basedir() . "/install-tmp"; 279 | 280 | } 281 | 282 | sub php_build_pre { 283 | } 284 | 285 | sub supported_archs { 286 | return qw(i386 x86_64); 287 | } 288 | 289 | sub supports_arch { 290 | my $self = shift @_; 291 | my ($arch) = @_; 292 | return grep {$_ eq $arch} $self->supported_archs(); 293 | } 294 | 295 | sub php_extension_configure_flags { 296 | return ""; 297 | } 298 | 299 | sub php_dso_extension_names { 300 | return undef; 301 | } 302 | 303 | sub php_dso_extension_paths { 304 | my $self = shift; 305 | return map {$self->config()->extdir_path("$_.so")} $self->php_dso_extension_names(); 306 | } 307 | 308 | sub php_build_arch_pre { 309 | } 310 | 311 | sub all_archs { 312 | return qw(x86_64); 313 | } 314 | 315 | 1; 316 | -------------------------------------------------------------------------------- /lib/PackageBinary.pm: -------------------------------------------------------------------------------- 1 | package PackageBinary; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(PackageBase); 6 | 7 | 8 | our $VERSION = '1.0'; 9 | 10 | 11 | 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /lib/PackageSplice.pm: -------------------------------------------------------------------------------- 1 | package PackageSplice; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(PackageBase); 6 | 7 | use UBSplicer; 8 | 9 | 10 | our $VERSION = '1.0'; 11 | 12 | 13 | 14 | sub init { 15 | my $self = shift; 16 | $self->SUPER::init(@_); 17 | $self->{current_arch} = undef; 18 | } 19 | 20 | 21 | sub splice_dir { 22 | my $self = shift @_; 23 | my $shortname = $self->shortname(); 24 | return "/tmp/build-entropy-php/$shortname"; 25 | } 26 | 27 | 28 | sub splice_prefix { 29 | my $self = shift @_; 30 | return $self->splice_dir() . "/universal/" . $self->install_prefix(); 31 | } 32 | 33 | 34 | sub build { 35 | 36 | my $self = shift @_; 37 | 38 | return unless ($self->SUPER::build(@_)); 39 | 40 | my $shortname = $self->shortname(); 41 | my $splice_dir = $self->splice_dir(); 42 | 43 | foreach my $arch (qw(i386 x86_64)) { 44 | 45 | $self->cd_packagesrcdir(); 46 | $self->cleanup_srcdir() if (-e "Makefile"); 47 | $self->cd_packagesrcdir(); 48 | $self->build_arch_pre(arch => $arch); 49 | 50 | $self->build_arch(arch => $arch); 51 | 52 | $self->cd_packagesrcdir(); 53 | $self->build_arch_post(arch => $arch); 54 | 55 | my $prefix = "$splice_dir/$arch/" . $self->install_prefix(); 56 | $self->make_install_arch(arch => $arch, prefix => $prefix); 57 | 58 | } 59 | 60 | my $splicer = UBSplicer->new(basedir => $splice_dir); 61 | $splicer->run(); 62 | 63 | return 1; 64 | } 65 | 66 | 67 | sub build_arch_pre {} 68 | sub build_arch_post {} 69 | 70 | 71 | sub build_arch { 72 | my $self = shift @_; 73 | my (%args) = @_; 74 | 75 | $self->{current_arch} = $args{arch}; 76 | my $cflags = $self->cflags(); 77 | my $ldflags = $self->ldflags(); 78 | $self->cd_packagesrcdir(); 79 | $self->shell("CFLAGS='$cflags' LDFLAGS='$ldflags' CC='cc -arch $args{arch} -DENTROPY_CH_RELEASE=" . $self->config()->release() . "' CXX='c++ -arch $args{arch}' ./configure " . $self->configure_flags(arch => $args{arch})); 80 | $self->build_arch_make(%args); 81 | } 82 | 83 | 84 | sub compiler_archflags { 85 | my $self = shift @_; 86 | return "-arch " . $self->{current_arch}; 87 | } 88 | 89 | 90 | sub cleanup_srcdir { 91 | my $self = shift @_; 92 | $self->cd_packagesrcdir(); 93 | $self->shell({fatal => 0}, 'make distclean'); 94 | } 95 | 96 | 97 | sub build_arch_make { 98 | my $self = shift @_; 99 | my (%args) = @_; 100 | 101 | $self->shell("make" . $self->make_flags()); 102 | } 103 | 104 | 105 | sub make_install_arch { 106 | my $self = shift @_; 107 | my (%args) = @_; 108 | my $install_override = $self->make_install_override_list(prefix => $args{prefix}); 109 | $self->shell($self->make_command() . " $install_override install"); 110 | } 111 | 112 | 113 | 114 | 115 | sub install { 116 | 117 | my $self = shift @_; 118 | 119 | return undef unless ($self->SUPER::install(@_)); 120 | 121 | my $dst = $self->install_prefix(); 122 | system("mkdir -p $dst"); 123 | unless (-d $dst) { 124 | die "Unable to find or create installation dir '$dst'"; 125 | } 126 | my $shortname = $self->shortname(); 127 | 128 | my $src = $self->splice_prefix(); 129 | my $cmd = "cp -R $src/* $dst"; 130 | $self->shell($cmd); 131 | 132 | return 1; 133 | 134 | } 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | sub is_built { 144 | my $self = shift @_; 145 | my $subpath = $self->subpath_for_check(); 146 | my $exists = -e $self->splice_prefix() . "/$subpath"; 147 | 148 | if ($exists) { 149 | $self->log("not building because '$subpath' exists") 150 | } else { 151 | $self->log("building because '$subpath' does not exist") 152 | } 153 | 154 | return $exists; 155 | } 156 | 157 | 158 | 159 | 160 | 1; 161 | -------------------------------------------------------------------------------- /lib/PackageSystemProvided.pm: -------------------------------------------------------------------------------- 1 | package PackageSystemProvided; 2 | 3 | use strict; 4 | use warnings; 5 | use base qw(PackageBase); 6 | 7 | 8 | our $VERSION = '1.0'; 9 | 10 | 11 | 12 | sub is_downloaded { 13 | return 1; 14 | } 15 | 16 | sub is_installed { 17 | return 1 18 | }; 19 | 20 | 1; 21 | -------------------------------------------------------------------------------- /lib/UBSplicer.pm: -------------------------------------------------------------------------------- 1 | package UBSplicer; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use base qw(Obj); 7 | 8 | 9 | our $VERSION = '1.0'; 10 | 11 | our @KNOWN_ARCHS = qw(i386 x86_64); 12 | our $MASTER_ARCH = $KNOWN_ARCHS[0]; 13 | 14 | our @EXECUTABLE_REGEXES = ( 15 | qr/^Mach-O/, 16 | qr/ar archive/, 17 | ); 18 | 19 | 20 | 21 | sub init { 22 | my $self = shift @_; 23 | die "basedir constructor argument must point to a directory" unless (-d $self->basedir()); 24 | my @archs = grep {my $__ = $_; grep {$__ eq $_} @KNOWN_ARCHS} $self->dir_content($self->basedir()); 25 | # $self->log("found archs: @archs"); 26 | die "Number of archs != 2: '@archs'" if (@archs != 2); 27 | } 28 | 29 | 30 | sub run { 31 | my $self = shift @_; 32 | $self->process_dir(''); 33 | } 34 | 35 | 36 | sub process_dir { 37 | 38 | my $self = shift @_; 39 | my ($subpath) = @_; 40 | 41 | my $universaldir = $self->universal_path($subpath); 42 | 43 | unless (-d $universaldir || mkdir($universaldir)) { 44 | die "unable to find or create output directory '$universaldir'"; 45 | } 46 | 47 | my $subdir_path = $self->master_path($subpath); 48 | my @items = $self->dir_content($subdir_path); 49 | 50 | foreach my $item (@items) { 51 | 52 | my $itempath = "$subdir_path/$item"; 53 | my $subpath = "$subpath/$item"; 54 | 55 | if (-l $itempath) { 56 | $self->copy($subpath); 57 | } elsif (-d $itempath) { 58 | $self->process_dir($subpath); 59 | } elsif (-f $itempath) { 60 | $self->process_file($subpath); 61 | } else { 62 | die "encountered unknown file type of file '$itempath'"; 63 | } 64 | 65 | } 66 | 67 | } 68 | 69 | 70 | 71 | sub copy { 72 | 73 | my $self = shift @_; 74 | my ($subpath) = @_; 75 | 76 | my $master = $self->master_path($subpath); 77 | my $universal = $self->universal_path($subpath); 78 | 79 | $self->shell({log => 0}, "cp -Rp $master $universal"); 80 | 81 | } 82 | 83 | 84 | sub process_file { 85 | 86 | my $self = shift @_; 87 | my ($subpath) = @_; 88 | 89 | my $master = $self->master_path($subpath); 90 | 91 | my $filetype = `file -b $master`; 92 | 93 | my $is_executable = grep {$filetype =~ /$_/} @EXECUTABLE_REGEXES; 94 | 95 | # $self->log("filetype ($is_executable): $filetype"); 96 | 97 | my @archs = grep {-e $_} $self->arch_paths($subpath); 98 | return $self->copy($subpath) unless ($is_executable and @archs > 1); 99 | 100 | my $universal = $self->universal_path($subpath); 101 | $self->log("running lipo for $subpath"); 102 | $self->shell({log => 0}, "lipo -create @archs -output $universal"); 103 | 104 | } 105 | 106 | 107 | sub universal_path { 108 | my $self = shift @_; 109 | my ($subpath) = @_; 110 | return $self->basedir() . "/universal/$subpath"; 111 | } 112 | 113 | 114 | sub master_path { 115 | my $self = shift @_; 116 | my ($subpath) = @_; 117 | return $self->basedir() . "/$MASTER_ARCH/$subpath"; 118 | } 119 | 120 | 121 | sub arch_paths { 122 | my $self = shift @_; 123 | my ($subpath) = @_; 124 | return map {$self->basedir() . "/$_/$subpath"} @KNOWN_ARCHS; 125 | } 126 | 127 | 128 | sub to_string { 129 | my $self = shift @_; 130 | return "[UBSplicer at " . $self->basedir() . "]"; 131 | } 132 | 133 | 134 | 135 | 136 | 1; 137 | 138 | -------------------------------------------------------------------------------- /test/httpd/conf/httpd.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName 127.0.0.1 3 | Listen 127.0.0.1:12345 4 | 5 | PidFile logs/httpd.pid 6 | LockFile logs/accept.lock 7 | 8 | LoadModule mime_module /usr/libexec/apache2/mod_mime.so 9 | LoadModule dir_module /usr/libexec/apache2/mod_dir.so 10 | LoadModule log_config_module /usr/libexec/apache2/mod_log_config.so 11 | LoadModule php5_module /usr/local/php5/libphp5.so 12 | 13 | ErrorLog logs/error_log 14 | LogLevel info 15 | DefaultType text/plain 16 | DocumentRoot documentroot 17 | 18 | 19 | AddType application/x-httpd-php .php 20 | AddType application/x-httpd-php-source .phps 21 | 22 | DirectoryIndex index.html index.php 23 | 24 | 25 | 26 | 27 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 28 | CustomLog logs/access_log combined 29 | 30 | -------------------------------------------------------------------------------- /test/httpd/serverroot/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | -------------------------------------------------------------------------------- /test/httpd/serverroot/documentroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liip/build-entropy-php/747a4664b116641a7b623b39b4dd71ccf565430a/test/httpd/serverroot/documentroot/favicon.ico -------------------------------------------------------------------------------- /test/httpd/serverroot/documentroot/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/httpd/serverroot/documentroot/test-domxml.php: -------------------------------------------------------------------------------- 1 | loadXML(''); 5 | echo $doc->saveXML(); 6 | 7 | -------------------------------------------------------------------------------- /test/httpd/serverroot/documentroot/test-mcrypt.php: -------------------------------------------------------------------------------- 1 | \n"; 6 | $hash = mhash(MHASH_MD5, $input, "Jefe"); 7 | echo "The hmac is " . bin2hex($hash) . "
\n"; 8 | -------------------------------------------------------------------------------- /test/httpd/serverroot/documentroot/test-mysql.php: -------------------------------------------------------------------------------- 1 | 7; 9 | 10 | my %conf = @ARGV; 11 | my $content; 12 | 13 | $content = get_url_success('test-phpinfo.php'); 14 | ($content) = $content =~ /this machine runs: (\w+)/; 15 | is($content, $conf{current_test_arch}, "current_test_arch"); 16 | 17 | $content = get_url_success('test-mcrypt.php'); 18 | is($content, "This is very important data\n", 'mcrypt'); 19 | 20 | $content = get_url_success("test-mysql.php?mysql_socket=$conf{mysql_dir}/mysql-test.sock"); 21 | like($content, qr/Resource id #\d+, test value: 2/, "mysql connection"); 22 | 23 | $content = get_url_success("test-openssl.php"); 24 | like($content, qr/BEGIN RSA PRIVATE KEY/, "openssl"); 25 | 26 | $content = get_url_success("test-mhash.php"); 27 | like($content, qr/The hash is \w{32}/, "mhash"); 28 | 29 | $content = get_url_success("test-domxml.php"); 30 | like($content, qr##, "DOM XML"); 31 | 32 | 33 | sub ua { 34 | return LWP::UserAgent->new(); 35 | } 36 | 37 | 38 | sub get_url_success { 39 | my ($path) = @_; 40 | my $url = "$conf{base_url}/$path"; 41 | my $response = ua()->get($url); 42 | if (!$response->is_success()) { 43 | die "Request to '$url' failed: " . $response->status_line(); 44 | } 45 | return $response->decoded_content(); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /test/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | TESTDIR=/tmp/entropy-php-test 6 | rm -rf $TESTDIR 7 | mkdir $TESTDIR 8 | 9 | # launch mysql 10 | UNITTEST_MYSQL_DIR=$TESTDIR/mysql 11 | mkdir $UNITTEST_MYSQL_DIR 12 | . test-mysqld-start.sh 13 | 14 | set +e 15 | # run the tests 16 | mkdir -p httpd/serverroot/logs 17 | for arch in i386 x86_64; do 18 | echo Testing arch $arch 19 | arch -arch $arch httpd -X -k start -d "$PWD/httpd/serverroot" -f "$PWD/httpd/conf/httpd.conf" & 20 | sleep 3 21 | perl -I"$PWD/perl5lib" run-test.pl base_url http://127.0.0.1:12345/ mysql_dir "$UNITTEST_MYSQL_DIR" current_test_arch $arch 22 | arch -arch $arch httpd -k stop -d "$PWD/httpd/serverroot" -f "$PWD/httpd/conf/httpd.conf" 23 | sleep 3 24 | rm -f httpd/serverroot/logs/*.{pid,lock}* 25 | echo 26 | done 27 | 28 | # shut down mysql 29 | . test-mysqld-stop.sh 30 | -------------------------------------------------------------------------------- /test/tail-test-logs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | tail -F /tmp/entropy-php-test/mysql/mysql-test.log httpd/serverroot/logs/* 4 | -------------------------------------------------------------------------------- /test/test-mysqld-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -e "$UNITTEST_MYSQL_DIR" ] || { echo "UNITTEST_MYSQL_DIR variable must point to MySQL temp data directory"; exit 1; } 4 | 5 | MYSQLD_PIDFILE="$UNITTEST_MYSQL_DIR/mysql-test.pid" 6 | [ -e "$HOME/.my.cnf" ] && echo "******** .my.cnf file found in $HOME, this might affect the tests. Move it aside if MySQL based tests fail" 7 | 8 | for i in /usr /usr/local/mysql; do 9 | [ -e "$i/bin/mysql" ] && MYSQLDIR=$i 10 | done 11 | [ -e "$MYSQLDIR" ] || { echo "MYSQLDIR variable must point to MySQL installation directory"; exit 1; } 12 | 13 | for i in "$MYSQLDIR/scripts/mysql_install_db" "$MYSQLDIR/bin/mysql_install_db"; do 14 | [ -e "$i" ] && INSTALLDB=$i 15 | done 16 | [ $INSTALLDB ] || { echo unable to find mysql_install_db; exit 1; } 17 | 18 | "$INSTALLDB" --basedir="$MYSQLDIR" --datadir="$UNITTEST_MYSQL_DIR" --lower_case_table_names=1 19 | 20 | for i in "$MYSQLDIR/libexec/mysqld" "$MYSQLDIR/bin/mysqld"; do 21 | [ -e "$i" ] && MYSQLD=$i 22 | done 23 | [ $MYSQLD ] || { echo unable to find mysqld; exit 1; } 24 | 25 | [ -e "$MYSQLD_PIDFILE" ] && { echo "pid file $MYSQLD_PIDFILE exists (PID $(cat "$MYSQLD_PIDFILE")), stop the DB first."; exit 1; } 26 | 27 | #--skip-networking \ 28 | "$MYSQLD" \ 29 | --port=12346 \ 30 | --socket=mysql-test.sock \ 31 | --pid-file=mysql-test.pid \ 32 | --log-error=mysql-test.err \ 33 | --log=mysql-test.log \ 34 | --log-queries-not-using-indexes \ 35 | --log-slow-queries=mysql-test.slowqueries.log \ 36 | --lower_case_table_names=1 \ 37 | --basedir="$MYSQLDIR" \ 38 | --datadir="$UNITTEST_MYSQL_DIR" & 39 | 40 | sleep 2 41 | 42 | "$MYSQLDIR/bin/mysql" \ 43 | --protocol=SOCKET \ 44 | -u root \ 45 | --socket="$UNITTEST_MYSQL_DIR/mysql-test.sock" \ 46 | -e "GRANT ALL ON *.* TO unittest_dbuser@'localhost' IDENTIFIED BY '123456'" || exit 1 47 | -------------------------------------------------------------------------------- /test/test-mysqld-stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -e "$UNITTEST_MYSQL_DIR" ] || { echo "UNITTEST_MYSQL_DIR variable must point to MySQL temp data directory"; exit 1; } 4 | 5 | "$MYSQLDIR/bin/mysqladmin" \ 6 | --user=root \ 7 | --protocol=SOCKET \ 8 | --socket="$UNITTEST_MYSQL_DIR/mysql-test.sock" shutdown 9 | --------------------------------------------------------------------------------