function main()
	{
		$pkg = new PEAR_PackageFileManager2();

		$e = $pkg->setOptions(array
		(
			'baseinstalldir'    => 'yii',
			'packagedirectory'  => $this->pkgdir,
			'filelistgenerator' => 'file',
			'simpleoutput'      => true,
			'ignore'            => array(),
			'roles' => array('*' => 'php'),
			)
		);

		// PEAR error checking
		if (PEAR::isError($e))
			die($e->getMessage());
		$pkg->setPackage($this->package);
		$pkg->setSummary($this->summary);
		$pkg->setDescription($this->pkgdescription);
		$pkg->setChannel($this->channel);

		$pkg->setReleaseStability($this->state);
		$pkg->setAPIStability($this->state);
		$pkg->setReleaseVersion($this->version);
		$pkg->setAPIVersion($this->version);

		$pkg->setLicense($this->license);
		$pkg->setNotes($this->notes);
		$pkg->setPackageType('php');
		$pkg->setPhpDep('5.1.0');
		$pkg->setPearinstallerDep('1.4.2');

		$pkg->addRelease();
		$pkg->addMaintainer('lead','qxue','Qiang Xue','qiang.xue@gmail.com');

		$test = $pkg->generateContents();

		$e = $pkg->writePackageFile();

		if (PEAR::isError($e))
			echo $e->getMessage();
	}