[glpi/epel7] update to 0.84.3

Remi Collet remi at fedoraproject.org
Tue Jan 21 07:49:12 UTC 2014


commit f31004a35da6980f8e9cfd47093500cd18716466
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Jan 21 08:49:25 2014 +0100

    update to 0.84.3

 .gitignore           |    3 +
 glpi-0.83-cron.patch |   34 ----------------
 glpi-0.84-cron.patch |   31 +++++++++++++++
 glpi-0.84-zend.patch |   55 ++++++++++++++++++++++++++
 glpi-config_path.php |    6 +++
 glpi.spec            |  103 ++++++++++++++++++++++++++++++++------------------
 sources              |    2 +-
 7 files changed, 162 insertions(+), 72 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index eb5af91..50d7a9b 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,5 @@ 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
+/glpi-0.84.3.tar.gz
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..7293422 100644
--- a/glpi-config_path.php
+++ b/glpi-config_path.php
@@ -13,6 +13,10 @@ 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_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 +27,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 e675ddf..41d1369 100644
--- a/glpi.spec
+++ b/glpi.spec
@@ -1,45 +1,61 @@
+# spec file for glpi
+#
+# Copyright (c) 2007-2014 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.3
+Release:        2%{?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/1615/glpi-0.84.3.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
 
-
-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 +90,7 @@ techniciens grâce à une maintenance plus cohérente.
 %setup -q -n glpi
 
 %patch0 -p0
+
 find . -name \*.orig -exec rm {} \; -print
 
 # Drop bundled Flash files
@@ -84,16 +101,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 +126,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,20 +189,18 @@ do
 done >%{name}.lang
 
 
-%clean
-rm -rf %{buildroot} 
-
-
 %post
 %if %{useselinux}
 (
 # New File context
-semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_sysconfdir}/glpi(/.*)?" 
-semanage fcontext -a -s system_u -t httpd_log_t           -r s0 "%{_localstatedir}/log/glpi(/.*)?"
-# keep httpd_sys_script_rw_t (httpd_var_lib_t prevent dir creation)
-semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/lib/glpi(/.*)?"
+semanage fcontext -a -s system_u -t httpd_sys_rw_content_t -r s0 "%{_sysconfdir}/%{name}(/.*)?"
+semanage fcontext -a -s system_u -t httpd_sys_content_t    -r s0 "%{_datadir}/%{name}(/.*)?"
+semanage fcontext -a -s system_u -t httpd_log_t            -r s0 "%{_localstatedir}/log/%{name}(/.*)?"
+# keep httpd_sys_rw_content_t (httpd_var_lib_t prevent dir creation)
+semanage fcontext -a -s system_u -t httpd_sys_rw_content_t -r s0 "%{_localstatedir}/lib/%{name}(/.*)?"
 # files created by app
 restorecon -R %{_sysconfdir}/%{name}
+restorecon -R %{_datadir}/%{name}
 restorecon -R %{_localstatedir}/lib/%{name}
 restorecon -R %{_localstatedir}/log/%{name}
 ) &>/dev/null
@@ -201,9 +213,10 @@ restorecon -R %{_localstatedir}/log/%{name}
 if [ "$1" -eq "0" ]; then
     # Remove the File Context
     (
-    semanage fcontext -d "%{_sysconfdir}/glpi(/.*)?"
-    semanage fcontext -d "%{_localstatedir}/log/glpi(/.*)?"
-    semanage fcontext -d "%{_localstatedir}/lib/glpi(/.*)?"
+    semanage fcontext -d "%{_sysconfdir}/%{name}(/.*)?"
+    semanage fcontext -d "%{_datadir}/%{name}(/.*)?"
+    semanage fcontext -d "%{_localstatedir}/log/%{name}(/.*)?"
+    semanage fcontext -d "%{_localstatedir}/lib/%{name}(/.*)?"
     ) &>/dev/null
 fi
 %endif
@@ -211,7 +224,6 @@ fi
 
 
 %files -f %{name}.lang
-%defattr(-,root,root,-)
 %doc *.txt LICENSE.*
 
 %attr(750,apache,root) %dir %{_sysconfdir}/%{name}
@@ -244,9 +256,26 @@ fi
 
 
 %changelog
+* Tue Jan 21 2014 Remi Collet <remi at fedoraproject.org> - 0.84.3-2
+- fix SELinux context #1032995
+  use httpd_sys_rw_content_t instead of httpd_sys_script_rw_t
+
+* Sun Nov  3 2013 Remi Collet <remi at fedoraproject.org> - 0.84.3-1
+- update to 0.84.3
+  https://forge.indepnet.net/projects/glpi/versions/973
+
+* Wed Oct  2 2013 Remi Collet <remi at fedoraproject.org> - 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 <remi at fedoraproject.org> - 0.83.9.1-4
 - restrict access for install to local for security
+
+* Fri Aug 23 2013 Remi Collet <remi at fedoraproject.org> - 0.83.9.1-3
 - drop bundled Flash files files, #1000251
+
+* Sat Jul 27 2013 Jóhann B. Guðmundsson <johannbg at fedoraproject.org> - 0.83.9.1-2
 - Add a missing requirement on crontabs to spec file
 
 * Tue Jun 25 2013 Remi Collet <remi at fedoraproject.org> - 0.83.9.1-1
diff --git a/sources b/sources
index e1b67a7..f096a91 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-11190df46de3435832f6120d8e78c57b  glpi-0.83.91.tar.gz
+2e0df4a27c80a23825abe610d4f11cd1  glpi-0.84.3.tar.gz


More information about the scm-commits mailing list