Permalink
Browse files

fully implement PECL package generation, basically ext_skel with know…

…ledge of new stuff like classes (gasp).

add both the PEAR2 and PECL generation commands to the default pyrus, re-generate
save the release in trunk.  I'll let Brett merge it to LIVE :)
  • Loading branch information...
1 parent 3ccf471 commit de11500eaf2877a08eb1f748a3d0df38558d5aac @cellog cellog committed Aug 5, 2009
Showing with 558 additions and 5 deletions.
  1. +48 −1 customcommand/commands.xml
  2. +63 −0 data/config.m4
  3. +13 −0 data/config.w32
  4. +16 −2 package.xml
  5. +22 −2 package_compatible.xml
  6. +396 −0 src/Pyrus/Developer/PackageFile/Commands.php
@@ -119,7 +119,7 @@ such as --package=phar,tar,zip
<name>packagename</name>
<multiple>0</multiple>
<optional>1</optional>
- <doc>Name of the package to create. If blank, the name is drawn from existng package.xml</doc>
+ <doc>Name of the package to create. If blank, the name is drawn from existing package.xml</doc>
</argument>
<argument>
<name>channel</name>
@@ -324,4 +324,51 @@ This command is used to create a bare skeleton for a new PEAR2 package as it
will reside in Subversion. It creates everything needed except the source code.
</doc>
</command>
+ <command>
+ <name>generate-ext</name>
+ <class>pear2\Pyrus\Developer\PackageFile\Commands</class>
+ <function>extSkeleton</function>
+ <autoloadpath></autoloadpath>
+ <summary>Generate the subversion source layout for a new PHP extension that is PECL-ready</summary>
+ <shortcut>es</shortcut>
+ <options>
+ <option>
+ <name>proto</name>
+ <shortopt>p</shortopt>
+ <type><string/></type>
+ <doc>Path to a file containing function prototypes</doc>
+ </option>
+ <option>
+ <name>nohelp</name>
+ <shortopt>n</shortopt>
+ <type><bool/></type>
+ <doc>Don't generate comments and helper functions to test if the code compiled</doc>
+ </option>
+ </options>
+ <arguments>
+ <argument>
+ <name>extension</name>
+ <multiple>0</multiple>
+ <optional>0</optional>
+ <doc>Extension name</doc>
+ </argument>
+ </arguments>
+ <doc>Create the subversion source layout for a new PHP extension package.
+
+This command is used to create a bare skeleton for a new PECL package or PHP extension as it
+will reside in Subversion. This is designed to provide all of the functionality of
+the ext_skel command but also generates a package.xml and other files that can be used
+to automatically update for a release.
+
+If the --proto option is specified, the file passed to this option must contain only function prototypes,
+one per line. Here are 2 examples showing all of the supported types for a function or a method:
+
+int myfunc(string firstarg, unicode secondarg, array thirdarg, object fourtharg [, double optionalarg1
+[, float optionalarg2 [, callback optionalarg3 [, text optionalarg4)
+void Myclass::myfunc(array|object arg1, bool arg2, class arg3, resource arg4, mixed arg5 [, ... varargs])
+
+This command automatically creates class definitions as well as ZEND_ARG_INFO for parameters to
+provide useful reflection to your extension's users.
+ </doc>
+ </command>
</commands>
View
@@ -0,0 +1,63 @@
+dnl $Id$
+dnl config.m4 for extension @extname@
+
+dnl Comments in this file start with the string 'dnl'.
+dnl Remove where necessary. This file will not work
+dnl without editing.
+
+dnl If your extension references something external, use with:
+
+dnl PHP_ARG_WITH(@extname@, for @extname@ support,
+dnl Make sure that the comment is aligned:
+dnl [ --with-@extname@ Include @extname@ support])
+
+dnl Otherwise use enable:
+
+dnl PHP_ARG_ENABLE(@extname@, whether to enable @extname@ support,
+dnl Make sure that the comment is aligned:
+dnl [ --enable-@extname@ Enable @extname@ support])
+
+if test "$PHP_@EXTNAME@" != "no"; then
+ dnl Write more examples of tests here...
+
+ dnl # --with-@extname@ -> check with-path
+ dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
+ dnl SEARCH_FOR="/include/@extname@.h" # you most likely want to change this
+ dnl if test -r $PHP_@EXTNAME@/$SEARCH_FOR; then # path given as parameter
+ dnl @EXTNAME@_DIR=$PHP_@EXTNAME@
+ dnl else # search default path list
+ dnl AC_MSG_CHECKING([for @extname@ files in default path])
+ dnl for i in $SEARCH_PATH ; do
+ dnl if test -r $i/$SEARCH_FOR; then
+ dnl @EXTNAME@_DIR=$i
+ dnl AC_MSG_RESULT(found in $i)
+ dnl fi
+ dnl done
+ dnl fi
+ dnl
+ dnl if test -z "$@EXTNAME@_DIR"; then
+ dnl AC_MSG_RESULT([not found])
+ dnl AC_MSG_ERROR([Please reinstall the @extname@ distribution])
+ dnl fi
+
+ dnl # --with-@extname@ -> add include path
+ dnl PHP_ADD_INCLUDE($@EXTNAME@_DIR/include)
+
+ dnl # --with-@extname@ -> check for lib and symbol presence
+ dnl LIBNAME=@extname@ # you may want to change this
+ dnl LIBSYMBOL=@extname@ # you most likely want to change this
+
+ dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+ dnl [
+ dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $@EXTNAME@_DIR/lib, @EXTNAME@_SHARED_LIBADD)
+ dnl AC_DEFINE(HAVE_@EXTNAME@LIB,1,[ ])
+ dnl ],[
+ dnl AC_MSG_ERROR([wrong @extname@ lib version or lib not found])
+ dnl ],[
+ dnl -L$@EXTNAME@_DIR/lib -lm
+ dnl ])
+ dnl
+ dnl PHP_SUBST(@EXTNAME@_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(@extname@, @extname@.c, $ext_shared)
+fi
View
@@ -0,0 +1,13 @@
+// $Id$
+// vim:ft=javascript
+
+// If your extension references something external, use ARG_WITH
+// ARG_WITH("@extname@", "for @extname@ support", "no");
+
+// Otherwise, use ARG_ENABLE
+// ARG_ENABLE("@extname@", "enable @extname@ support", "no");
+
+if (PHP_@EXTNAME@ != "no") {
+ EXTENSION("@extname@", "@extname@.c");
+}
+
View
@@ -14,8 +14,8 @@ and commands to create a package from an existing package.xml</description>
<email>cellog@php.net</email>
<active>yes</active>
</lead>
- <date>2009-07-06</date>
- <time>12:29:24</time>
+ <date>2009-08-04</date>
+ <time>21:23:50</time>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
@@ -32,6 +32,20 @@ and commands to create a package from an existing package.xml</description>
<file role="customcommand" name="commands.xml"/>
</dir>
<dir name="data" baseinstalldir="/">
+ <dir name="skeleton">
+ <dir name="tests" baseinstalldir="/">
+ <file role="data" name="001.phpt"/>
+ </dir>
+ <file role="data" name="create_stubs"/>
+ <file role="data" name="CREDITS"/>
+ <file role="data" name="EXPERIMENTAL"/>
+ <file role="data" name="php_skeleton.h"/>
+ <file role="data" name="skeleton.c"/>
+ <file role="data" name="skeleton.dsp"/>
+ <file role="data" name="skeleton.php"/>
+ </dir>
+ <file role="data" name="config.m4"/>
+ <file role="data" name="config.w32"/>
<file role="data" name="phartemplate.php"/>
</dir>
<dir name="src" baseinstalldir="pear2">
@@ -14,8 +14,8 @@ and commands to create a package from an existing package.xml</description>
<email>cellog@php.net</email>
<active>yes</active>
</lead>
- <date>2009-07-06</date>
- <time>12:29:24</time>
+ <date>2009-08-04</date>
+ <time>21:23:50</time>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
@@ -57,7 +57,17 @@ and commands to create a package from an existing package.xml</description>
<file role="php" name="php/pear2/Pyrus/Developer/CoverageAnalyzer/DefaultSourceDecorator.php"/>
<file role="php" name="php/pear2/Pyrus/Developer/CoverageAnalyzer/Aggregator.php"/>
<file role="php" name="php/pear2/Pyrus/Developer/CoverageAnalyzer/AbstractSourceDecorator.php"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/tests/skeleton/tests/001.phpt"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.php"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.dsp"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.c"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/php_skeleton.h"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/EXPERIMENTAL"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/CREDITS"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/create_stubs"/>
<file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/phartemplate.php"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/config.w32"/>
+ <file role="data" name="data/PEAR2_Pyrus_Developer/pear2.php.net/config.m4"/>
<file role="data" name="customcommand/PEAR2_Pyrus_Developer/pear2.php.net/commands.xml"/>
</dir>
</contents>
@@ -74,7 +84,17 @@ and commands to create a package from an existing package.xml</description>
<phprelease>
<filelist>
<install name="customcommand/PEAR2_Pyrus_Developer/pear2.php.net/commands.xml" as="pear2.php.net/commands.xml"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/config.m4" as="pear2.php.net/config.m4"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/config.w32" as="pear2.php.net/config.w32"/>
<install name="data/PEAR2_Pyrus_Developer/pear2.php.net/phartemplate.php" as="pear2.php.net/phartemplate.php"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/create_stubs" as="pear2.php.net/skeleton/skeleton/create_stubs"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/CREDITS" as="pear2.php.net/skeleton/skeleton/CREDITS"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/EXPERIMENTAL" as="pear2.php.net/skeleton/skeleton/EXPERIMENTAL"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/php_skeleton.h" as="pear2.php.net/skeleton/skeleton/php_skeleton.h"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.c" as="pear2.php.net/skeleton/skeleton/skeleton.c"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.dsp" as="pear2.php.net/skeleton/skeleton/skeleton.dsp"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/skeleton/skeleton.php" as="pear2.php.net/skeleton/skeleton/skeleton.php"/>
+ <install name="data/PEAR2_Pyrus_Developer/pear2.php.net/skeleton/tests/skeleton/tests/001.phpt" as="pear2.php.net/skeleton/tests/skeleton/tests/001.phpt"/>
<install name="php/pear2/Pyrus/Developer/CoverageAnalyzer/AbstractSourceDecorator.php" as="pear2/Pyrus/Developer/CoverageAnalyzer/AbstractSourceDecorator.php"/>
<install name="php/pear2/Pyrus/Developer/CoverageAnalyzer/Aggregator.php" as="pear2/Pyrus/Developer/CoverageAnalyzer/Aggregator.php"/>
<install name="php/pear2/Pyrus/Developer/CoverageAnalyzer/DefaultSourceDecorator.php" as="pear2/Pyrus/Developer/CoverageAnalyzer/DefaultSourceDecorator.php"/>
Oops, something went wrong. Retry.

0 comments on commit de11500

Please sign in to comment.