Permalink
Browse files

- fixed coding style

- added documentation


git-svn-id: http://svn.php.net/repository/pear/packages/Net_IPv4/trunk@201729 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent e188db2 commit 0cfead80d8e308f43b3f81e220bb557490486250 @bate bate committed Nov 30, 2005
Showing with 161 additions and 58 deletions.
  1. +90 −0 generate_package_xml.php
  2. +71 −58 package.xml
View
90 generate_package_xml.php
@@ -0,0 +1,90 @@
+<?php
+
+require_once 'PEAR/PackageFileManager.php';
+
+$pkg = new PEAR_PackageFileManager();
+
+$build = (isset($argv[1]) && strcmp($argv[1], 'build')!==false) ? true : false;
+
+/**
+ * directory settings
+ */
+$cvsdir = dirname(__FILE__);
+$packagedir = &$cvsdir;
+
+/**
+ * package configuration
+ */
+$category = 'Net';
+$package = 'Net_IPv4';
+$version = '1.3';
+$state = 'stable';
+
+$summary = 'IPv4 network calculations and validation.';
+
+$description = <<<EOT
+Class used for calculating IPv4 (AF_INET family) address information
+such as network as network address, broadcast address, and IP address
+validity.
+EOT;
+
+$notes = <<<EOT
+* Fixed all pending bugs
+* Fixed coding styles
+* Added class documentation
+EOT;
+
+$e = $pkg->setOptions(array(
+ 'simpleoutput' => true,
+ 'baseinstalldir' => $category,
+ 'summary' => $summary,
+ 'description' => $description,
+ 'version' => $version,
+ 'license' => 'PHP License 3.01',
+ 'packagedirectory' => $packagedir,
+ 'pathtopackagefile' => $packagedir,
+ 'state' => $state,
+ 'filelistgenerator' => 'cvs',
+ 'notes' => $notes,
+ 'package' => $package,
+ 'dir_roles' => array(
+ 'docs' => 'doc'
+ ),
+ 'ignore' => array(
+ '*.xml',
+ '*.tgz',
+ 'generate_package*',
+ ),
+ ));
+
+if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+}
+
+$e = $pkg->addMaintainer('bate', 'lead', 'Marco Kaiser', 'bate@php.net');
+$e = $pkg->addMaintainer('fa', 'developer', 'Florian Anderiasch', 'fa@php.net');
+//$e = $pkg->addMaintainer('ekilfoil', 'lead', 'Eric Kilfoil', 'eric@ypass.net', 'no');
+
+if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+}
+
+//$e = $pkg->addDependency('php', '4.2', 'ge', 'php');
+//$e = $pkg->addDependency('mhash', null, 'has', 'ext');
+
+$e = $pkg->addGlobalReplacement('package-info', '@package_version@', 'version');
+$e = $pkg->addGlobalReplacement('pear-config', '@data_dir@', 'data_dir');
+
+if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+}
+
+
+if ($build) {
+ $e = $pkg->writePackageFile();
+} else {
+ $e = $pkg->debugPackageFile();
+}
View
129 package.xml
@@ -1,65 +1,78 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
-<!-- do not use the "Type" attribute here, that one is only for
- generated package.xml files -->
-<package version="1.0">
- <name>Net_IPv4</name>
- <summary>IPv4 network calculations and validation</summary>
- <description>
- Class used for calculating IPv4 (AF_INET family) address information
- such as network as network address, broadcast address, and IP address
- validity.
- </description>
- <maintainers>
- <maintainer>
- <user>bate</user>
- <name>Marco Kaiser</name>
- <email>bate@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>fa</user>
- <name>Florian Anderiasch</name>
- <email>fa@php.net</email>
- <role>developer</role>
- </maintainer>
+<package version="1.0" packagerversion="1.4.5">
+ <name>Net_IPv4</name>
+ <summary>IPv4 network calculations and validation.</summary>
+ <description>Class used for calculating IPv4 (AF_INET family) address information
+such as network as network address, broadcast address, and IP address
+validity.
+ </description>
+ <maintainers>
+ <maintainer>
+ <user>bate</user>
+ <name>Marco Kaiser</name>
+ <email>bate@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>fa</user>
+ <name>Florian Anderiasch</name>
+ <email>fa@php.net</email>
+ <role>developer</role>
+ </maintainer>
</maintainers>
- <release>
+ <release>
+ <version>1.3</version>
+ <date>2005-11-30</date>
+ <license>PHP License 3.01</license>
+ <state>stable</state>
+ <notes>* Fixed all pending bugs
+* Fixed coding styles
+* Added class documentation
+ </notes>
+ <filelist>
+ <dir name="/" baseinstalldir="Net">
+ <file role="php" name="IPv4.php">
+ <replace type="package-info" from="@package_version@" to="version"/>
+ <replace type="pear-config" from="@data_dir@" to="data_dir"/>
+ </file>
+ </dir> <!-- / -->
+ </filelist>
+ </release>
+ <changelog>
+ <release>
+ <version>1.0</version>
+ <date>2002-08-20</date>
+ <license>PHP 2.0</license>
+ <state>stable</state>
+ <notes>Initial Release
+ </notes>
+ </release>
+ <release>
+ <version>1.1</version>
+ <date>2003-06-22</date>
+ <license>PHP 2.0</license>
+ <state>stable</state>
+ <notes>Created an ip2double method as a workaround for PHP long ints being unsigned
+ </notes>
+ </release>
+ <release>
<version>1.2</version>
<date>2004-04-27</date>
<license>PHP 2.0</license>
<state>stable</state>
- <notes>Added ipInNetwork method. Fixed some reported bugs. Net_IPv4 no longer extends the base PEAR class to speed instantiation</notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">IPv4.php</file>
- </dir>
- </filelist>
- </release>
- <changelog>
- <release>
- <version>1.1</version>
- <date>2003-06-22</date>
- <license>PHP 2.0</license>
- <state>stable</state>
- <notes>Created an ip2double method as a workaround for PHP long ints being unsigned</notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">IPv4.php</file>
- </dir>
- </filelist>
- </release>
- <release>
- <version>1.0</version>
- <date>2002-08-20</date>
- <license>PHP 2.0</license>
- <state>stable</state>
- <notes>Initial Release</notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">IPv4.php</file>
- </dir>
- </filelist>
- </release>
- </changelog>
+ <notes>Added ipInNetwork method. Fixed some reported bugs. Net_IPv4 no longer extends the base PEAR class to speed instantiation
+ </notes>
+ </release>
+ <release>
+ <version>1.3</version>
+ <date>2005-11-30</date>
+ <license>PHP License 3.01</license>
+ <state>stable</state>
+ <notes>* Fixed all pending bugs
+* Fixed coding styles
+* Added class documentation
+ </notes>
+ </release>
+ </changelog>
</package>

0 comments on commit 0cfead8

Please sign in to comment.