Skip to content
Browse files

preperations and layout for pear packaging

  • Loading branch information...
1 parent be63763 commit 704fb435158f650a6e74b2e66ced157ff418fc99 @zircote committed Apr 7, 2012
Showing with 489 additions and 0 deletions.
  1. +165 −0 CHANGELOG
  2. +1 −0 VERSION
  3. +128 −0 package.xml
  4. +195 −0 scripts/package.php
View
165 CHANGELOG
@@ -0,0 +1,165 @@
+commit be63763f8e22ae75ce79289aee8631ea6d9a5b89
+Merge: 8dc2a54 872151c
+Author: Robert Allen <zircote@gmail.com>
+Date: Fri Apr 6 16:35:24 2012 -0700
+
+ Merge pull request #1 from hradtke/links
+
+ Allow multiple href's per link relation.
+
+commit 872151ced307914989b39e6a59743980098fa024
+Author: Herman J. Radtke III <hermanradtke@gmail.com>
+Date: Fri Apr 6 15:25:45 2012 -0700
+
+ Allow multiple href's per link relation.
+
+commit 8dc2a542de66c7e770e00d321f4784cf26aa90e5
+Author: Robert Allen <zircote@gmail.com>
+Date: Fri Apr 6 09:25:28 2012 -0500
+
+ Added link to hal spec repository
+
+commit 8816b87b42c8e84f427624694ca3b92a14c12fe2
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 21:57:24 2012 -0500
+
+ Updated Links and readme
+
+commit a518dbbbaa295454db577c4670f4b8b996743079
+Merge: 33e2a43 a66640f
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 13:30:59 2012 -0500
+
+ merged changes from @hradtke resolved conflicts
+ detabbed
+
+commit 33e2a43bd5761a3d9a52a39fb039b0880a21b127
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:44:25 2012 -0500
+
+ minors editing of readme for readability sake
+
+commit 926ae6fcb1f40ea91d02b96ee4547a4fff106fb2
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:41:38 2012 -0500
+
+ removed the ^Ms as line delimters -.-
+
+commit 8ac4bf6fb59d46796517b65943eba1067cb1e0bf
+Merge: a1e39fb 1eddd70
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:35:49 2012 -0500
+
+ Merge branch 'develop'
+
+commit a1e39fb0f022dfc38eaaff2e2959a855e10e8aa7
+Merge: 3fe4d10 fb3f375
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:34:25 2012 -0500
+
+ refactoring of namespace, and incorporated the changes made by @hradtke
+
+commit 1eddd701c79b3bf7929563a65b20b30aeb6624a4
+Merge: 3fe4d10 fb3f375
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:34:25 2012 -0500
+
+ Merge branch 'master' into develop
+
+commit fb3f375dc9313fc3d64b7183be71b9e114020800
+Merge: c9e301e bc59106
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:31:55 2012 -0500
+
+ refactoring of namespace, and incorporated the changes made by @hradtke
+
+commit 3fe4d1012fdc316a17d9c128cfcd5b65c70dbec0
+Merge: c9e301e bc59106
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:31:55 2012 -0500
+
+ Merge branch 'master' into develop
+
+commit bc59106e0af0ea14ce71d1c8aaef89b43aecf569
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:29:51 2012 -0500
+
+ refactoring of namespace, and incorporated the changes made by @hradtke
+
+commit c9e301e64c8c1faf820be60970cd53ad9ee121ed
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Apr 5 12:29:51 2012 -0500
+
+ refactoring of namespace, and incorporated the changes made by @hradtke
+
+commit a66640f469fe7ec3a625c708a434f12d40b6efa1
+Author: Herman J. Radtke III <hermanradtke@gmail.com>
+Date: Wed Mar 28 17:29:50 2012 -0700
+
+ Fixed the Hal_Resource interface and fixed format of code.
+
+ The Hal_Resource contstructor was asking for a rel tag and never used it. A
+ more common use case is to set the data in the constructor so the client does
+ not have to call the setData() method after the fact.
+
+commit 9ba56231b1eb2ea203eb4dd71c1cb726c5353bb3
+Author: Herman J. Radtke III <hermanradtke@gmail.com>
+Date: Wed Mar 28 11:59:13 2012 -0700
+
+ Remove Zircote namespace and Zend Framework dependency.
+
+commit 5472967c41be0bf4b62e60726b71616713010a9f
+Author: Robert Allen <zircote@gmail.com>
+Date: Fri Mar 9 17:55:21 2012 -0600
+
+ corrected bug with data entity general
+
+commit 652a6f764c7d6b58f18ca096fa572ba816ad72f1
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Mar 8 09:21:44 2012 -0600
+
+ added license information
+
+commit c99ae924e4037295a929de77f22416621cf521da
+Author: Robert Allen <zircote@gmail.com>
+Date: Thu Mar 8 09:17:09 2012 -0600
+
+ added Apache 2.0 License
+
+commit 5338ce8c098309901a2844990926798273d933b2
+Author: Robert Allen <zircote@gmail.com>
+Date: Fri Mar 2 17:52:10 2012 -0600
+
+ updated docs, added test for simple
+
+commit ee23c867614171c7823c430e52368775165416d6
+Author: Robert Allen <zircote@gmail.com>
+Date: Fri Mar 2 16:01:45 2012 -0600
+
+ Added XML serialization support.
+
+commit 293eab5cc9e4036850179a385f9d8bc1e10dd40d
+Author: zircote <zircote@gmail.com>
+Date: Wed Feb 29 01:16:38 2012 -0600
+
+ Updated docblox and added relevant comments as stated in the spec.
+ Refactored classes removed unnecasary Abstract.
+ Change-Id: I3427b012ba52504ec44539c7e8eca32c47b54543
+
+commit 204a37e0dae483e40ab0f207ecbaf2a02f159fa8
+Author: Robert Allen <zircote@gmail.com>
+Date: Tue Feb 28 10:31:43 2012 -0600
+
+ added links
+
+commit a0b32a419b95f54a67a4d6d3058d195ed96318fa
+Author: Robert Allen <zircote@gmail.com>
+Date: Tue Feb 28 10:21:58 2012 -0600
+
+ Added examples and links
+
+commit 01e9534cfd17271b02c2a7ed5945cd05875e597e
+Author: Robert Allen <zircote@gmail.com>
+Date: Tue Feb 28 10:00:14 2012 -0600
+
+ initial commit
View
1 VERSION
@@ -0,0 +1 @@
+0.1.0
View
128 package.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
+ http://pear.php.net/dtd/tasks-1.0.xsd
+ http://pear.php.net/dtd/package-2.0
+ http://pear.php.net/dtd/package-2.0.xsd">
+ <name>Hal</name>
+ <channel>pear.zircote.com</channel>
+ <summary>Hal - A PHP library for HAL generation</summary>
+ <description>HAL is a simple way of linking with JSON or XML.
+
+It provides a set of conventions for expressing hyperlinks to, and embeddedness
+of, related resources - the rest of a HAL document is just plain old JSON or XML.
+
+HAL is a bit like HTML for machines, in that it is designed to drive many
+different types of application. The difference is that HTML is intended for
+presenting a graphical hypertext interface to a &apos;human actor&apos;, whereas HAL is
+intended for presenting a machine hypertext interface to &apos;automated actors&apos;.
+
+This document contains a formalised specification of HAL. For a friendlier, more
+ pracitcal introduction to HAL you can read this article: JSON Linking with HAL
+
+HAL has two main components: Resources and Links.
+
+ * https://github.com/zircote/Hal
+ * http://groups.google.com/group/hal-discuss
+ * http://stateless.co/hal_specification.html
+ * http://blog.stateless.co/post/13296666138/json-linking-with-hal
+ * http://www.mnot.net/blog/2011/11/25/linking_in_json
+ * https://gist.github.com/2289546
+ </description>
+ <lead>
+ <name>Robert Allen</name>
+ <user>zircote</user>
+ <email>zircote@gmail.com</email>
+ <active>yes</active>
+ </lead>
+ <date>2012-04-07</date>
+ <time>11:28:47</time>
+ <version>
+ <release>0.1.0</release>
+ <api>0.1.0</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</license>
+ <notes>
+This is an alpha release, see readme.md for examples.
+ </notes>
+ <contents>
+ <dir baseinstalldir="/" name="/">
+ <dir name="library">
+ <dir name="Hal">
+ <file baseinstalldir="/" name="AbstractHal.php" role="php">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ <file baseinstalldir="/" name="Link.php" role="php">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ <file baseinstalldir="/" name="Resource.php" role="php">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ </dir> <!-- /library/Hal -->
+ </dir> <!-- /library -->
+ <dir name="tests">
+ <dir name="library">
+ <dir name="Hal">
+ <file baseinstalldir="/" name="LinkTest.php" role="test">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ <file baseinstalldir="/" name="ResourceTest.php" role="test">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ </dir> <!-- /tests/library/Hal -->
+ </dir> <!-- /tests/library -->
+ <file baseinstalldir="/" name="bootstrap.php" role="test">
+ <tasks:replace from="@name@" to="name" type="package-info" />
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
+ </dir> <!-- /tests -->
+ <file baseinstalldir="/" name="CHANGELOG" role="doc" />
+ <file baseinstalldir="/" name="LICENSE-2.0.txt" role="doc" />
+ <file baseinstalldir="/" name="readme.md" role="doc" />
+ <file baseinstalldir="/" name="VERSION" role="doc" />
+ </dir> <!-- / -->
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.1</min>
+ </php>
+ <pearinstaller>
+ <min>1.7.0</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease>
+ <filelist>
+ <install as="Hal/AbstractHal.php" name="library/Hal/AbstractHal.php" />
+ <install as="Hal/Link.php" name="library/Hal/Link.php" />
+ <install as="Hal/Resource.php" name="library/Hal/Resource.php" />
+ </filelist>
+ </phprelease>
+ <phprelease />
+ <changelog>
+ <release>
+ <version>
+ <release>0.1.0</release>
+ <api>0.1.0</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <date>2012-04-07</date>
+ <license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</license>
+ <notes>
+This is an alpha release, see readme.md for examples.
+ </notes>
+ </release>
+ </changelog>
+</package>
View
195 scripts/package.php
@@ -0,0 +1,195 @@
+#!/usr/bin/env php
+<?php
+
+// Fix warinigs
+// pirum add target_dir Pirum-1.0.0.tgz
+// scp Skulk-0.1.5.tgz pear.zircote.com:/export/sites/pear.zircote.com/
+error_reporting(error_reporting() ^ E_DEPRECATED);
+if (version_compare(PHP_VERSION, '5.3.2') >= 0) {
+ error_reporting(error_reporting() ^ E_DEPRECATED);
+}
+date_default_timezone_set('America/Chicago');
+
+require_once 'PEAR/PackageFileManager2.php';
+PEAR::setErrorHandling(PEAR_ERROR_DIE);
+
+/**
+ * Recursively populated $GLOBALS['files']
+ *
+ * @param string $path The path to glob through.
+ *
+ * @return void
+ * @uses $GLOBALS['files']
+ */
+function readDirectory($path)
+{
+ foreach (glob($path . '/*') as $file) {
+ if (!is_dir($file)) {
+ $GLOBALS['files'][] = $file;
+ } else {
+ readDirectory($file);
+ }
+ }
+}
+
+$outsideDir = realpath(dirname(dirname(__FILE__)));
+
+$version = file_get_contents($outsideDir . '/VERSION');
+
+$api_version = $version;
+$api_state = 'beta';
+
+$release_version = $version;
+$release_state = 'beta';
+$release_notes = "This is an alpha release, see readme.md for examples.";
+
+$summary = "Hal - A PHP library for HAL generation";
+
+$description =<<<EOF
+HAL is a simple way of linking with JSON or XML.
+
+It provides a set of conventions for expressing hyperlinks to, and embeddedness
+of, related resources - the rest of a HAL document is just plain old JSON or XML.
+
+HAL is a bit like HTML for machines, in that it is designed to drive many
+different types of application. The difference is that HTML is intended for
+presenting a graphical hypertext interface to a 'human actor', whereas HAL is
+intended for presenting a machine hypertext interface to 'automated actors'.
+
+This document contains a formalised specification of HAL. For a friendlier, more
+ pracitcal introduction to HAL you can read this article: JSON Linking with HAL
+
+HAL has two main components: Resources and Links.
+
+ * https://github.com/zircote/Hal
+ * http://groups.google.com/group/hal-discuss
+ * http://stateless.co/hal_specification.html
+ * http://blog.stateless.co/post/13296666138/json-linking-with-hal
+ * http://www.mnot.net/blog/2011/11/25/linking_in_json
+ * https://gist.github.com/2289546
+
+EOF;
+
+$package = new PEAR_PackageFileManager2();
+
+$package->setOptions(
+ array(
+ 'filelistgenerator' => 'file',
+ 'outputdirectory' => dirname(dirname(__FILE__)),
+ 'simpleoutput' => true,
+ 'baseinstalldir' => '/',
+ 'packagedirectory' => $outsideDir,
+ 'dir_roles' => array(
+ 'benchmarks' => 'doc',
+ 'examples' => 'doc',
+ 'library' => 'php',
+ 'library/Hal' => 'php',
+ 'tests' => 'test',
+ ),
+ 'exceptions' => array(
+ 'CHANGELOG' => 'doc',
+ 'readme.md' => 'doc',
+ 'VERSION' => 'doc',
+ 'LICENSE-2.0.txt' => 'doc',
+ ),
+ 'ignore' => array(
+ 'build/*',
+ 'package.xml',
+ 'build.xml',
+ 'scripts/*',
+ '.git',
+ '.gitignore',
+ 'tests/phpunit.xml',
+ 'tests/build*',
+ '.project',
+ '.buildpath',
+ '.settings',
+ '*.tgz'
+ )
+ )
+);
+
+$package->setPackage('Hal');
+$package->setSummary($summary);
+$package->setDescription($description);
+$package->setChannel('pear.zircote.com');
+$package->setPackageType('php');
+$package->setLicense(
+ 'Apache 2.0',
+ 'http://www.apache.org/licenses/LICENSE-2.0'
+);
+
+$package->setNotes($release_notes);
+$package->setReleaseVersion($release_version);
+$package->setReleaseStability($release_state);
+$package->setAPIVersion($api_version);
+$package->setAPIStability($api_state);
+/**
+ * Dependencies
+ */
+
+$maintainers = array(
+ array(
+ 'name' => 'Robert Allen',
+ 'user' => 'zircote',
+ 'email' => 'zircote@gmail.com',
+ 'role' => 'lead',
+ )
+);
+
+foreach ($maintainers as $_m) {
+ $package->addMaintainer(
+ $_m['role'],
+ $_m['user'],
+ $_m['name'],
+ $_m['email']
+ );
+}
+
+$files = array(); // classes and tests
+readDirectory($outsideDir . '/library');
+readDirectory($outsideDir . '/tests');
+
+$base = $outsideDir . '/';
+
+foreach ($files as $file) {
+
+ $file = str_replace($base, '', $file);
+
+ $package->addReplacement(
+ $file,
+ 'package-info',
+ '@name@',
+ 'name'
+ );
+
+ $package->addReplacement(
+ $file,
+ 'package-info',
+ '@package_version@',
+ 'version'
+ );
+}
+
+$files = array(); // reset global
+readDirectory($outsideDir . '/library');
+
+foreach ($files as $file) {
+ $file = str_replace($base, '', $file);
+ $package->addInstallAs($file, str_replace('library/', '', $file));
+}
+
+
+$package->setPhpDep('5.2.1');
+
+$package->setPearInstallerDep('1.7.0');
+$package->generateContents();
+$package->addRelease();
+
+if ( isset($_GET['make'])
+ || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')
+) {
+ $package->writePackageFile();
+} else {
+ $package->debugPackageFile();
+}

0 comments on commit 704fb43

Please sign in to comment.
Something went wrong with that request. Please try again.