You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by ku...@apache.org on 2009/05/19 09:57:11 UTC

svn commit: r776223 - in /incubator/log4php/trunk: CHANGELOG build.xml package-config.php package.php

Author: kurdalen
Date: Tue May 19 07:57:10 2009
New Revision: 776223

URL: http://svn.apache.org/viewvc?rev=776223&view=rev
Log:
fixed #LOG4PHP-44 (initial version of PEAR packaging)

Added:
    incubator/log4php/trunk/package-config.php
    incubator/log4php/trunk/package.php
Modified:
    incubator/log4php/trunk/CHANGELOG
    incubator/log4php/trunk/build.xml

Modified: incubator/log4php/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/CHANGELOG?rev=776223&r1=776222&r2=776223&view=diff
==============================================================================
--- incubator/log4php/trunk/CHANGELOG (original)
+++ incubator/log4php/trunk/CHANGELOG Tue May 19 07:57:10 2009
@@ -31,6 +31,7 @@
 - Enh #38: Replace is_a() with instanceof (Knut Urdalen)
 - Enh #39: Remove deprecated methods (Knut Urdalen)
 - Enh #40: Merge LoggerAppender and LoggerAppenderSkeleton (Christian Grobmeier)
+- Enh #44: PEAR package (Knut Urdalen)
 - Enh: Initial port to PHP 5 (Knut Urdalen)
 - Enh: Established new unit test suite (Knut Urdalen)
 - Enh: Added a range of examples (Knut Urdalen)

Modified: incubator/log4php/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/build.xml?rev=776223&r1=776222&r2=776223&view=diff
==============================================================================
--- incubator/log4php/trunk/build.xml (original)
+++ incubator/log4php/trunk/build.xml Tue May 19 07:57:10 2009
@@ -139,5 +139,31 @@
 		    <arg value="commit"/>
 		</exec>
 	</target>
-        
+	
+	<target name="pear-package">
+		<delete dir="target/pear"/>
+		<mkdir dir="target/pear/log4php"/>
+		<copy file="package.php" todir="target/pear"/>
+		<copy file="package-config.php" todir="target/pear"/>
+		<copy file="CHANGELOG" todir="target/pear"/>
+		<copy file="LICENSE" todir="target/pear"/>
+		<copy file="README" todir="target/pear"/>
+		<copy todir="target/pear">
+			<fileset dir="src">
+				<include name="examples/**/*"/>
+			</fileset>
+		</copy>
+		<copy todir="target/pear/log4php">
+			<fileset dir="src/main/php">
+				<include name="**/*.php"/>
+			</fileset>
+		</copy>
+		<exec executable="php" dir="target/pear" output="package.xml">
+			<arg line="package.php"/>
+		</exec>
+		<exec executable="pear" dir="target/pear">
+			<arg line="package"/>
+		</exec>
+	</target>
+
 </project>

Added: incubator/log4php/trunk/package-config.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/package-config.php?rev=776223&view=auto
==============================================================================
--- incubator/log4php/trunk/package-config.php (added)
+++ incubator/log4php/trunk/package-config.php Tue May 19 07:57:10 2009
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+$name = 'log4php';
+$summary = 'log4Php is a PHP port of log4j framework';
+$version = '2.0.0';
+$versionBuild = 'b1';
+$apiVersion = '2.0.0';
+$state = 'beta';
+$apiStability = 'stable';
+
+$description = <<<EOT
+log4Php is a PHP port of log4j framework. It supports XML configuration, 
+logging to files, stdout/err, syslog, socket, configurable output layouts 
+and logging levels.
+EOT;
+
+$notes = <<<EOT
+Changes since 0.9:
+ - 
+EOT;
+
+$options = array(
+	'license' => 'Apache License 2.0',
+	//'filelistgenerator' => 'svn',
+	'ignore' => array('package.php', 'package-config.php'),
+	'simpleoutput' => true,
+	'baseinstalldir' => '/',
+	'packagedirectory' => '.',
+	'dir_roles' => array(
+		'examples' => 'doc',
+	),
+	'exceptions' => array(
+		'CHANGELOG' => 'doc',
+		'LICENSE' => 'doc',
+		'README' => 'doc',
+	),
+);
+
+$license = array(
+	'name' => 'Apache License 2.0',
+	'url' => 'http://www.apache.org/licenses/LICENSE-2.0'
+);
+
+$maintainer = array();
+$maintainer[]  =   array(
+	'role' => 'lead',
+	'handle' => 'kurdalen',
+	'name' => 'Knut Urdalen',
+	'email' => 'kurdalen@apache.org',
+	'active' => 'yes'
+);
+$maintainer[]   =   array(
+	'role' => 'lead',
+	'handle' => 'grobmeier',
+	'name' => 'Christian Grobmeier',
+	'email' => 'grobmeier@gmail.com',
+	'active' => 'yes'
+);
+
+$dependency = array();
+
+$channel = 'pear.php.net';
+$require = array(
+	'php' => '5.2.0',
+	'pear_installer' => '1.8.0',
+);

Added: incubator/log4php/trunk/package.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/package.php?rev=776223&view=auto
==============================================================================
--- incubator/log4php/trunk/package.php (added)
+++ incubator/log4php/trunk/package.php Tue May 19 07:57:10 2009
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@include 'PEAR/PackageFileManager2.php';
+if(!class_exists('PEAR_PackageFileManager2')) {
+	echo "\nYou need to install PEAR_PackageFileManager2 in order to run this script\n\n";
+	echo "Installation tips:\n\n";
+	echo "  $ sudo pear upgrade PEAR\n";
+	echo "  $ sudo pear install XML_Serializer-0.19.2\n";
+	echo "  $ sudo pear install --alldeps PEAR_PackageFileManager2\n\n";
+	exit(0);
+}
+
+include dirname(__FILE__).'/package-config.php';
+
+$package = new PEAR_PackageFileManager2();
+$result = $package->setOptions($options);
+if(PEAR::isError($result)) {
+    echo $result->getMessage();
+    die( __LINE__ . "\n" );
+}
+
+$package->setPackage($name);
+$package->setSummary($summary);
+$package->setDescription($description);
+
+$package->setChannel($channel);
+$package->setAPIVersion($apiVersion);
+$package->setReleaseVersion($version);
+$package->setReleaseStability($state);
+$package->setAPIStability($apiStability);
+$package->setNotes($notes);
+$package->setPackageType('php'); // this is a PEAR-style php script package
+$package->setLicense($license['name'], $license['url']);
+
+foreach($maintainer as $m) {
+	$package->addMaintainer($m['role'], $m['handle'], $m['name'], $m['email'], $m['active']);
+}
+
+foreach($dependency as $d) {
+    $package->addPackageDepWithChannel($d['type'], $d['package'], $d['channel'], $d['version']);
+}
+
+$package->setPhpDep( $require['php'] );
+$package->setPearinstallerDep($require['pear_installer']);
+
+$package->generateContents();
+
+$package->debugPackageFile();
+
+$result = $package->writePackageFile();
+if(PEAR::isError($result)) {
+    echo $result->getMessage();
+    die();
+}
+exit(0);