diff --git a/.gitignore b/.gitignore index eb5af91..bccceab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ +clog glpi-0.72.4-11497.tar.gz /glpi-0.78.5.tar.gz /glpi-0.78-14966.tar.gz @@ -16,3 +17,4 @@ glpi-0.72.4-11497.tar.gz /glpi-0.83.8.tar.gz /glpi-0.83.9.tar.gz /glpi-0.83.91.tar.gz +/glpi-0.84.2.tar.gz diff --git a/glpi-0.83-cron.patch b/glpi-0.83-cron.patch deleted file mode 100644 index 25906e5..0000000 --- a/glpi-0.83-cron.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -up install/install.php.orig install/install.php ---- install/install.php.orig 2012-01-24 12:22:16.000000000 +0100 -+++ install/install.php 2012-02-26 10:04:57.482199413 +0100 -@@ -351,6 +351,15 @@ function step4 ($host, $user, $password, - $query = "UPDATE `glpi_users` - SET `language` = NULL"; - $DB->query($query) or die("4203 ".$LANG['update'][90].$DB->error()); -+ -+ // RPM provides a good system cron -+ $query = "UPDATE `glpi_crontasks` SET `mode`=2 WHERE `name`!='watcher' AND (`allowmode` & 2)"; -+ $DB->query($query) -+ or die("RPM update of glpi_crontasks. " . $LANG['update'][90] . $DB->error()); -+ -+ $query = "UPDATE `glpi_configs` SET `cron_limit` = '3'"; -+ $DB->query($query) -+ or die("RPM update of glpi_configs. " . $LANG['update'][90] . $DB->error()); - } - - -diff -up install/update.php.orig install/update.php ---- install/update.php.orig 2012-02-09 21:19:30.000000000 +0100 -+++ install/update.php 2012-02-26 10:07:24.899206029 +0100 -@@ -770,6 +770,11 @@ function updateDbUpTo031() { - $plugin = new Plugin(); - $plugin->unactivateAll(); - -+ // RPM provides a good system cron -+ $query = "UPDATE `glpi_crontasks` SET `mode`=2 WHERE `name`!='watcher' AND (`allowmode` & 2)"; -+ $DB->query($query) -+ or die("RPM update of glpi_crontasks. " . $LANG['update'][90] . $DB->error()); -+ - DBmysql::optimize_tables($migration); - - return $ret; diff --git a/glpi-0.84-cron.patch b/glpi-0.84-cron.patch new file mode 100644 index 0000000..de3b6d7 --- /dev/null +++ b/glpi-0.84-cron.patch @@ -0,0 +1,31 @@ +diff -up install/install.php.orig install/install.php +--- install/install.php.orig 2013-09-29 17:04:16.326382959 +0200 ++++ install/install.php 2013-09-29 17:08:07.616396210 +0200 +@@ -350,6 +350,13 @@ function step4 ($databasename, $newdatab + $query = "UPDATE `glpi_users` + SET `language` = NULL"; + $DB->queryOrDie($query, "4203"); ++ ++ // RPM provides a good system cron ++ $query = "UPDATE `glpi_crontasks` SET `mode`=2 WHERE `name`!='watcher' AND (`allowmode` & 2)"; ++ $DB->queryOrDie($query, "4203"); ++ ++ $query = "UPDATE `glpi_configs` SET `cron_limit` = '3'"; ++ $DB->queryOrDie($query, "4203"); + } + + $link = new mysqli($host, $user, $password); +diff -up install/update.php.orig install/update.php +--- install/update.php.orig 2013-09-12 21:17:15.000000000 +0200 ++++ install/update.php 2013-09-29 17:07:53.124390070 +0200 +@@ -776,6 +776,10 @@ function updateDbUpTo031() { + $plugin = new Plugin(); + $plugin->unactivateAll(); + ++ // RPM provides a good system cron ++ $query = "UPDATE `glpi_crontasks` SET `mode`=2 WHERE `name`!='watcher' AND (`allowmode` & 2)"; ++ $DB->queryOrDie($query); ++ + DBmysql::optimize_tables($migration); + + return $ret; diff --git a/glpi-0.84-zend.patch b/glpi-0.84-zend.patch new file mode 100644 index 0000000..f8de812 --- /dev/null +++ b/glpi-0.84-zend.patch @@ -0,0 +1,55 @@ +Index: branches/0.84-bugfixes/config/based_config.php +=================================================================== +--- branches/0.84-bugfixes/config/based_config.php (revision 21914) ++++ branches/0.84-bugfixes/config/based_config.php (revision 21915) +@@ -138,11 +138,10 @@ + + // Default Zend_Loader path + if (!defined("GLPI_ZEND_PATH")) { +- define("GLPI_ZEND_PATH", GLPI_ROOT."/lib"); ++ define("GLPI_ZEND_PATH", GLPI_ROOT."/lib/Zend"); + +- # if Zend installed, use (in config_path.php) +- # define("GLPI_ZEND_PATH", "/usr/share/php/"); // if not in standard include_path +- # define("GLPI_ZEND_PATH", ""); // if already in include_path ++ # if Zend Framework 2 available in system, use (in config_path.php) ++ # define('GLPI_ZEND_PATH', '/usr/share/php/Zend'); + } + + // Default SimplePie path +Index: branches/0.84-bugfixes/inc/autoload.function.php +=================================================================== +--- branches/0.84-bugfixes/inc/autoload.function.php (revision 21914) ++++ branches/0.84-bugfixes/inc/autoload.function.php (revision 21915) +@@ -289,16 +289,6 @@ + ezcBase::autoload($classname); + return true; + } +- // Is Zend class ? +-// if (preg_match('/^Zend/',$classname,$matches)) { +-// if (GLPI_ZEND_PATH) { +-// set_include_path(GLPI_ZEND_PATH . PATH_SEPARATOR . get_include_path()); +-// } +-// require_once("Zend/Loader.php"); +-// +-// Zend_Loader::loadClass($classname); +-// return true; +-// } + + // Do not try to load phpcas using GLPI autoload + if (preg_match('/^CAS_.*/', $classname)) { +@@ -323,11 +313,9 @@ + } + } + +-require_once (GLPI_ROOT . '/lib/Zend/Loader/ClassMapAutoloader.php'); +-$loader = new Zend\Loader\ClassMapAutoloader(); +-// Register the class map: +-$loader->registerAutoloadMap(GLPI_ROOT . '/lib/Zend/autoload_classmap.php'); +-// Register with spl_autoload: ++require_once (GLPI_ZEND_PATH . '/Loader/StandardAutoloader.php'); ++$option = array(Zend\Loader\StandardAutoloader::LOAD_NS => array('Zend' => GLPI_ZEND_PATH)); ++$loader = new Zend\Loader\StandardAutoloader($option); + $loader->register(); + + // SimplePie autoloader diff --git a/glpi-config_path.php b/glpi-config_path.php index 1027223..a76c3da 100644 --- a/glpi-config_path.php +++ b/glpi-config_path.php @@ -13,6 +13,11 @@ define('GLPI_SESSION_DIR', '/var/lib/glpi/files/_sessions'); define('GLPI_PLUGIN_DOC_DIR', '/var/lib/glpi/files/_plugins'); define('GLPI_LOCK_DIR', '/var/lib/glpi/files/_lock/'); define('GLPI_GRAPH_DIR', '/var/lib/glpi/files/_graphs/'); +define('GLPI_PICTURE_DIR', '/var/lib/glpi/files/_pictures/'); +define('GLPI_TMP_DIR', '/var/lib/glpi/files/_tmp/'); +define('GLPI_RSS_DIR', '/var/lib/glpi/files/_rss/'); +define('GLPI_UPLOAD_DIR', '/var/lib/glpi/files/_uploads/'); +//define('GLPI_SCRIPT_DIR', // Log define('GLPI_LOG_DIR', '/var/log/glpi'); @@ -23,6 +28,8 @@ define('GLPI_PHPMAILER_DIR', 'PHPMailer'); define('GLPI_EZC_BASE', 'ezc/Base/base.php'); define('GLPI_PHPCAS', 'CAS.php'); define('GLPI_HTMLAWED', 'htmLawed/htmLawed.php'); +define('GLPI_ZEND_PATH', '/usr/share/php/Zend'); +define("GLPI_SIMPLEPIE_PATH", '/usr/share/php/php-simplepie'); // Fonts define('GLPI_FONT_FREESANS', '/usr/share/fonts/gnu-free/FreeSans.ttf'); diff --git a/glpi.spec b/glpi.spec index 894f530..63f932d 100644 --- a/glpi.spec +++ b/glpi.spec @@ -1,45 +1,64 @@ +# spec file for glpi +# +# Copyright (c) 2007-2013 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/3.0/ +# +# Please, preserve the changelog entries +# %global useselinux 1 Name: glpi -Version: 0.83.9.1 -Release: 4%{?dist} +Version: 0.84.2 +Release: 1%{?dist} Summary: Free IT asset management software Summary(fr): Gestion Libre de Parc Informatique Group: Applications/Internet License: GPLv2+ and GPLv3+ URL: http://www.glpi-project.org/ -Source0: https://forge.indepnet.net/attachments/download/1501/glpi-0.83.91.tar.gz +Source0: https://forge.indepnet.net/attachments/download/1593/glpi-0.84.2.tar.gz Source1: glpi-httpd.conf Source2: glpi-config_path.php Source3: glpi-logrotate # Switch all internal cron tasks to system -Patch0: glpi-0.83-cron.patch +Patch0: glpi-0.84-cron.patch +# https://forge.indepnet.net/repositories/revision/glpi/21915 +Patch1: glpi-0.84-zend.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: gettext Requires: httpd, mod_php -Requires: php-mysql +Requires: php(language) >= 5.3 +Requires: php-date Requires: php-gd -Requires: php-ldap +Requires: php-fileinfo Requires: php-imap +Requires: php-json +Requires: php-ldap Requires: php-mbstring +Requires: php-mysqli +Requires: php-pcre +Requires: php-session Requires: php-xml -Requires: php-json Requires: php-pear(Cache_Lite) >= 1.7.4 Requires: php-PHPMailer Requires: php-pear-CAS >= 1.2.0 Requires: php-htmLawed -%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 +Requires: php-simplepie +Requires: php-ZendFramework2-Cache +Requires: php-ZendFramework2-Cache-apc +Requires: php-ZendFramework2-I18n +Requires: php-ZendFramework2-Loader +Requires: php-ZendFramework2-ServiceManager +Requires: php-ZendFramework2-Stdlib +Requires: php-ZendFramework2-Version Requires: php-pear(components.ez.no/Graph) >= 1.5 Requires: gnu-free-sans-fonts -%else -Requires: freefont -%endif Requires: %{_sysconfdir}/logrotate.d Requires(postun): /sbin/service Requires(post): /sbin/service @@ -74,6 +93,8 @@ techniciens grâce à une maintenance plus cohérente. %setup -q -n glpi %patch0 -p0 +%patch1 -p2 + find . -name \*.orig -exec rm {} \; -print # Drop bundled Flash files @@ -84,16 +105,11 @@ rm -rf lib/cache_lite rm -rf lib/phpmailer rm -rf lib/phpcas rm -rf lib/htmlawed - -%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 +rm -rf lib/Zend +rm -rf lib/simplepie rm -rf lib/ezcomponents -cp %{SOURCE2} config/config_path.php -%else -# fix font path on old version -sed -e '/GLPI_FONT_FREESANS/s/gnu-free/freefont/' \ - -e '/GLPI_EZC_BASE/d' \ - %{SOURCE2} >config/config_path.php -%endif + +cp %{SOURCE2} config/config_path.php mv lib/tiny_mce/license.txt LICENSE.tiny_mce mv lib/extjs/gpl-3.0.txt LICENSE.extjs @@ -114,12 +130,14 @@ EOF %build -# empty build +# Regenerate the locales +for po in locales/*.po +do + msgfmt $po -o $(dirname $po)/$(basename $po .po).mo +done %install -rm -rf %{buildroot} - # ===== application ===== mkdir -p %{buildroot}/%{_datadir}/%{name} cp -a COPYING.txt *.php *.js %{buildroot}/%{_datadir}/%{name}/ @@ -175,10 +193,6 @@ do done >%{name}.lang -%clean -rm -rf %{buildroot} - - %post %if %{useselinux} ( @@ -211,7 +225,6 @@ fi %files -f %{name}.lang -%defattr(-,root,root,-) %doc *.txt LICENSE.* %attr(750,apache,root) %dir %{_sysconfdir}/%{name} @@ -244,6 +257,11 @@ fi %changelog +* Wed Oct 2 2013 Remi Collet - 0.84.2-1 +- update to 0.84.2 +- add upstream patch for Zend autoload +- use system ZendFramework2 and SimplePie + * Thu Sep 12 2013 Remi Collet - 0.83.9.1-4 - restrict access for install to local for security diff --git a/sources b/sources index e1b67a7..89b56e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -11190df46de3435832f6120d8e78c57b glpi-0.83.91.tar.gz +ad4d0e2830b316182e4028349ab6bcc1 glpi-0.84.2.tar.gz