3 * Plugin stanza for use in .deb or .rpm packages
5 * Copyright (C) 2014 Inria (Sylvain Beucler)
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 // Don't try to connect to the DB, just reading plugin metadata
24 putenv('FUSIONFORGE_NO_DB=true');
26 require (dirname(__FILE__).'/../common/include/env.inc.php');
27 require_once $gfcommon.'include/pre.php';
29 require_once dirname(__FILE__).'/../common/include/PluginManager.class.php';
30 require_once dirname(__FILE__).'/../common/include/Plugin.class.php';
31 require_once dirname(__FILE__).'/../common/include/SCMPlugin.class.php';
33 if (count($argv) != 3) {
34 file_put_contents('php://stderr', "Usage: {$argv[0]} plugin_name {deb|rpm}\n");
37 $pluginname = $argv[1];
40 forge_reset_config_item('plugins_path', 'core', dirname(__FILE__).'/../plugins');
41 $pm = plugin_manager_get_object();
42 $pm->LoadPlugin($pluginname);
43 $plugin = plugin_get_object($pluginname);
44 if ($plugin == null) {
45 file_put_contents('php://stderr', "Couldn't load plugin $pluginname.\n");
49 $shortdesc_prefix = _("collaborative development tool");
51 _("FusionForge provides many tools to aid collaboration in a
52 development project, such as bug-tracking, task management,
53 mailing-lists, SCM repository, forums, support request helper,
54 web/FTP hosting, release management, etc. All these services are
55 integrated into one web site and managed through a web interface.");
58 if ($method == 'deb') {
60 $desc_prefix = implode("\n ", preg_split('/\R/', $desc_prefix));
61 $desc = implode("\n ", preg_split('/\R/', $plugin->pkg_desc));
62 echo "Description: {$shortdesc_prefix} - {$plugin->text}\n";
63 echo " $desc_prefix\n";
67 } else if ($method == 'rpm') {
69 echo "Summary: {$shortdesc_prefix} - {$plugin->text}\n";
70 echo "%description plugin-{$plugin->name}\n";
71 echo "$desc_prefix\n";
73 echo "{$plugin->pkg_desc}\n";