summaryrefslogtreecommitdiffstats
path: root/glpi.spec
diff options
context:
space:
mode:
Diffstat (limited to 'glpi.spec')
-rw-r--r--glpi.spec185
1 files changed, 121 insertions, 64 deletions
diff --git a/glpi.spec b/glpi.spec
index 2b02d3c..d96674a 100644
--- a/glpi.spec
+++ b/glpi.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
-%global gh_commit 2683ce0cfe4cce4786e52eec3cf2a54f54f01225
+%global gh_commit f38701abbb7f5a451c25b3905e49e3cd8a10572a
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20160923
%global gh_owner glpi-project
@@ -42,18 +42,22 @@
%endif
Name: %{gh_project}
-Version: 9.1.6
-%global schema 9.1.3
+%global upstream_version 9.2
+%global upstream_prever RC2
+Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
+%global schema 9.2
Release: 1%{?dist}
Summary: Free IT asset management software
Summary(fr): Gestion Libre de Parc Informatique
Group: Applications/Internet
-License: GPLv2+ and GPLv3+
+License: GPLv2+ and GPLv3+ and MIT
URL: http://www.glpi-project.org/
# Upstream sources (not the github auto-generated archive)
Source0: https://github.com/%{gh_owner}/%{name}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
+Patch1: 2800.patch
+
Source1: %{name}-httpd.conf
Source2: %{name}-9.1-config_path.php
Source12: %{name}-9.1-config_path_test.php
@@ -65,34 +69,39 @@ BuildArch: noarch
BuildRequires: gettext
%if %{with_tests}
BuildRequires: php-cli
-%if 0%{?fedora} >= 26
-%global phpunit %{_bindir}/phpunit6
-%else
-%global phpunit %{_bindir}/phpunit
-%endif
-BuildRequires: %{phpunit}
BuildRequires: mariadb-server
# Missing in mariadb
BuildRequires: hostname
+BuildRequires: php-mysqli
+BuildRequires: php-xmlrpc
# PHP libs
BuildRequires: php-htmLawed
-BuildRequires: php-composer(zendframework/zend-cache) >= 2.4
-BuildRequires: php-composer(zendframework/zend-i18n) >= 2.4
-BuildRequires: php-composer(zendframework/zend-loader) >= 2.4
-BuildRequires: php-composer(guzzlehttp/guzzle) >= 5
-BuildRequires: php-composer(guzzlehttp/guzzle) < 6
+BuildRequires: php-composer(jasig/phpcas) < 2
BuildRequires: php-composer(jasig/phpcas) >= 1.3
+BuildRequires: php-composer(iamcal/lib_autolink) < 2
BuildRequires: php-composer(iamcal/lib_autolink) >= 1.7
-BuildRequires: php-composer(sabre/vobject) >= 3.4
-BuildRequires: php-composer(michelf/php-markdown) >= 1.6
-BuildRequires: php-composer(true/punycode) >= 2
-BuildRequires: php-composer(simplepie/simplepie) >= 1.5
+BuildRequires: php-composer(phpmailer/phpmailer) < 6
BuildRequires: php-composer(phpmailer/phpmailer) >= 5.2
-# 6.2.13 to ensure we have the classmap autoloader
+BuildRequires: php-composer(sabre/vobject) < 5
+BuildRequires: php-composer(sabre/vobject) >= 4.1
+BuildRequires: php-composer(simplepie/simplepie) < 2
+BuildRequires: php-composer(tecnickcom/tcpdf) < 7
BuildRequires: php-composer(tecnickcom/tcpdf) >= 6.2.13
-BuildRequires: php-mysqli
-BuildRequires: php-xmlrpc
-BuildRequires: php-composer(zetacomponents/graph)
+BuildRequires: php-composer(zendframework/zend-cache) < 3
+BuildRequires: php-composer(zendframework/zend-cache) >= 2.7
+BuildRequires: php-composer(zendframework/zend-i18n) < 3
+BuildRequires: php-composer(zendframework/zend-i18n) >= 2.7
+BuildRequires: php-composer(michelf/php-markdown) < 2
+BuildRequires: php-composer(michelf/php-markdown) >= 1.6
+BuildRequires: php-composer(true/punycode) < 3
+BuildRequires: php-composer(true/punycode) >= 2.1
+BuildRequires: php-composer(paragonie/random_compat) < 3
+BuildRequires: php-composer(paragonie/random_compat) >= 2.0
+# requires-dev
+BuildRequires: php-composer(guzzlehttp/guzzle) < 7
+BuildRequires: php-composer(guzzlehttp/guzzle) >= 6
+BuildRequires: php-composer(atoum/atoum) < 4
+BuildRequires: php-composer(atoum/atoum) >= 3.2
%endif
%if %{with_nginx}
@@ -107,13 +116,14 @@ Requires: php(httpd)
%else
Requires: httpd, mod_php
%endif
-# use 5.5+ to avoid dependency on ircmaxell/password-compat and ramsey/array_column
-Requires: php(language) >= 5.5
+Requires: php(language) >= 5.6
+Requires: php-reflection
+Requires: php-simplexml
Requires: php-ctype
Requires: php-curl
Requires: php-date
-Requires: php-exif
Requires: php-fileinfo
+Requires: php-filter
Requires: php-gd
Requires: php-imap
Requires: php-json
@@ -122,27 +132,49 @@ Requires: php-mbstring
Requires: php-mysqli
Requires: php-pcre
Requires: php-session
-Requires: php-simplexml
-Requires: php-wddx
+Requires: php-tokenizer
+Requires: php-xml
Requires: php-xmlrpc
Requires: php-zlib
Requires: php-htmLawed
-Requires: php-composer(zendframework/zend-cache) >= 2.4
-Requires: php-composer(zendframework/zend-i18n) >= 2.4
-Requires: php-composer(zendframework/zend-loader) >= 2.4
+Requires: php-composer(jasig/phpcas) < 2
Requires: php-composer(jasig/phpcas) >= 1.3
+Requires: php-composer(iamcal/lib_autolink) < 2
Requires: php-composer(iamcal/lib_autolink) >= 1.7
-Requires: php-composer(sabre/vobject) >= 3.4
-Requires: php-composer(michelf/php-markdown) >= 1.6
-# upstream ask 2.1, compatibility with 2.0 ensure by autoloader
-Requires: php-composer(true/punycode) >= 2.1
-Requires: php-composer(simplepie/simplepie) >= 1.5
+Requires: php-composer(phpmailer/phpmailer) < 6
Requires: php-composer(phpmailer/phpmailer) >= 5.2
+Requires: php-composer(sabre/vobject) < 5
+Requires: php-composer(sabre/vobject) >= 4.1
+Requires: php-composer(simplepie/simplepie) < 2
+Requires: php-composer(simplepie/simplepie) >= 1.5
# 6.2.13 to ensure we have the classmap autoloader
+Requires: php-composer(tecnickcom/tcpdf) < 7
Requires: php-composer(tecnickcom/tcpdf) >= 6.2.13
-
-Requires: php-composer(zetacomponents/graph)
+Requires: php-composer(zendframework/zend-cache) < 3
+Requires: php-composer(zendframework/zend-cache) >= 2.7
+Requires: php-composer(zendframework/zend-i18n) < 3
+Requires: php-composer(zendframework/zend-i18n) >= 2.7
+Requires: php-composer(zendframework/zend-loader)
+Requires: php-composer(michelf/php-markdown) < 2
+Requires: php-composer(michelf/php-markdown) >= 1.6
+Requires: php-composer(true/punycode) < 3
+Requires: php-composer(true/punycode) >= 2.1
+Requires: php-composer(paragonie/random_compat) < 3
+Requires: php-composer(paragonie/random_compat) >= 2.0
Requires: gnu-free-sans-fonts
+%if 0%{?fedora}
+Requires: fontawesome-fonts >= 4.7.0
+%else
+Provides: bundled(fontawesome-fonts) = 4.7.0
+%endif
+Provides: bundled(js-chartist-js) = 0.10.1
+Provides: bundled(js-chartist-plugin-legend) = 0.6.0
+Provides: bundled(js-chartist-plugin-tooltip) = 0.0.17
+Provides: bundled(js-fuzzy)
+Provides: bundled(js-jquery)
+Provides: bundled(prism)
+Provides: bundled(tiny_mce) = 4.3.13
+
Requires: %{_sysconfdir}/logrotate.d
Requires(postun): /sbin/service
Requires(post): /sbin/service
@@ -152,8 +184,9 @@ Requires(post): /usr/sbin/semanage
Requires(postun): /usr/sbin/semanage
%endif
Requires: crontabs
-%if 0%{?fedora} >= 22
+%if 0%{?fedora}
Recommends: php-pecl-apcu
+Recommends: php-opcache
%endif
@@ -178,8 +211,9 @@ techniciens grâce à une maintenance plus cohérente.
%prep
%setup -q -n %{name}-%{gh_commit}
+%patch1 -p1
-grep %{version} config/define.php
+grep %{upstream_version} inc/define.php
find . -name \*.orig -exec rm {} \; -print
@@ -187,7 +221,14 @@ find . -name \*.orig -exec rm {} \; -print
find lib -name \*.swf -exec rm {} \; -print
# Use system lib
-rm -rf lib/htmlawed
+rm -r lib/htmlawed
+rm lib/FreeSans.ttf
+%if 0%{?fedora}
+rm lib/font-awesome-4.7.0/fonts/FontAwesome.otf
+rm lib/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf
+ln -s /usr/share/fonts/fontawesome/FontAwesome.otf lib/font-awesome-4.7.0/fonts/FontAwesome.otf
+ln -s /usr/share/fonts/fontawesome/fontawesome-webfont.ttf lib/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf
+%endif
: bundled JS libraries
ls lib
@@ -197,7 +238,16 @@ mkdir vendor
sed -e "s,##DATADIR##,%{_datadir}," \
%{SOURCE5} > vendor/autoload.php
-mv lib/tiny_mce/license.txt LICENSE.tiny_mce
+mv lib/tiny_mce/license.txt LICENSE.tiny_mce
+mv lib/chartist-js-0.10.1/LICENSE-MIT LICENSE.chartist-js
+mv lib/chartist-plugin-legend-0.6.0/LICENSE LICENSE.chartist-plugin-legend
+mv lib/chartist-plugin-tooltip-0.0.17/LICENSE LICENSE.chartist-plugin-tooltip
+mv lib/jqueryplugins/select2/LICENSE LICENSE.jqueryplugins.select2
+mv lib/jqueryplugins/spectrum-colorpicker/LICENSE LICENSE.jqueryplugins.spectrum-colorpicker
+mv lib/jqueryplugins/fullcalendar/LICENSE.txt LICENSE.jqueryplugins.fullcalendar
+mv lib/jqueryplugins/jstree/LICENSE-MIT LICENSE.jqueryplugins.jstree
+mv lib/fuzzy/LICENSE-MIT LICENSE.fuzzy
+
rm scripts/glpi_cron_*.sh
sed -i -e 's/\r//' LICENSE.tiny_mce
@@ -212,15 +262,6 @@ cat >cron <<EOF
* * * * * apache %{_bindir}/php %{_datadir}/%{name}/front/cron.php
EOF
-# We only need 1 sql sdchema
-if [ "%{version}" != "%{schema}" -a -f install/mysql/glpi-%{version}-empty.sql ]; then
- echo -e "\n*** check schema version as glpi-%{version}-empty.sql exists***\n"
- exit 1;
-fi
-mv install/mysql/glpi-%{schema}-empty.sql .
-rm install/mysql/*.sql
-mv glpi-%{schema}-empty.sql install/mysql/
-
%build
# Regenerate the locales
@@ -233,7 +274,7 @@ done
%install
# ===== application =====
mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -a COPYING.txt *.php *.js apirest.md %{buildroot}/%{_datadir}/%{name}/
+cp -a COPYING.txt *.php apirest.md %{buildroot}/%{_datadir}/%{name}/
for i in ajax css front inc install lib locales pics plugins scripts vendor
do cp -ar $i %{buildroot}/%{_datadir}/%{name}/$i
@@ -298,23 +339,25 @@ done >%{name}.lang
RET=0
: Hack for vendor
sed -e '/Development dependencies/s:^://:' -i tests/bootstrap.php
-
-: Ignore bad date
-sed -e 's/testGetCopyrightMessage/skipGetCopyrightMessage/' -i tests/HtmlTest.php
+rm composer.lock
: Add developement dependecies
cat << 'EOF' | tee -a vendor/autoload.php
-// "guzzlehttp/guzzle": "~5"
-require_once $vendor . '/GuzzleHttp/autoload.php';
+// "guzzlehttp/guzzle": "~6"
+require_once $vendor . '/GuzzleHttp6/autoload.php';
EOF
-: Running a PHP server
-sed -e 's/localhost:8088/127.0.0.1:8089/' phpunit.xml.dist >phpunit.xml
+: No internet on the builder
+export GLPI_SKIP_ONLINE=1
+: Running a PHP server
+export GLPI_URI=http://127.0.0.1:8089
%{_bindir}/php -S 127.0.0.1:8089 tests/router.php &>/dev/null &
-
PHPPID=$!
+: Skip LDAP tests for now
+rm tests/units/AuthLdap*
+
: Running a MariaDB server
MYSQL_TEST_HOST=127.0.0.1
MYSQL_TEST_PORT=3308
@@ -323,9 +366,12 @@ MYSQL_PID_FILE=$PWD/mysql.pid
rm -rf data
mkdir data
+: Create the Database
%{_bindir}/mysql_install_db \
+ --log-error=$PWD/mysql.log \
--datadir=$PWD/data
+: Launch the Server
%{_libexecdir}/mysqld \
--socket=$MYSQL_TEST_SOCKET \
--log-error=$PWD/mysql.log \
@@ -349,13 +395,15 @@ cp %{SOURCE12} config/config_path.php
: Run upstream test suite
php tools/cliinstall.php --host=127.0.0.1:3308 --db=glpitest --user=root --tests --force --lang=en_GB || RET=1
-%{phpunit} --verbose || RET=1
+#atoum --debug --bootstrap-file tests/bootstrap.php --no-code-coverage --use-light-report --max-children-number 1 -d tests/database || RET=1
+atoum --debug --bootstrap-file tests/bootstrap.php --no-code-coverage --use-light-report --max-children-number 1 -d tests/units || RET=1
+atoum --debug --bootstrap-file tests/bootstrap.php --no-code-coverage --use-light-report --max-children-number 1 -d tests/api || RET=1
: Cleanup
if [ -s $MYSQL_PID_FILE ]; then
kill $(cat $MYSQL_PID_FILE)
fi
-kill $PHPPID
+kill $PHPPID || :
exit $RET
%else
@@ -404,7 +452,9 @@ fi
%files -f %{name}.lang
-%doc *.txt LICENSE.*
+%{!?_licensedir:%global license %%doc}
+%license LICENSE.*
+%doc *.txt *.md
%attr(2770,root,apache) %dir %{_sysconfdir}/%{name}
%ghost %config(noreplace,missingok) %{_sysconfdir}/%{name}/config_db.php
@@ -421,7 +471,6 @@ fi
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*.php
-%{_datadir}/%{name}/*.js
%{_datadir}/%{name}/apirest.md
# License file required by installation process
%{_datadir}/%{name}/COPYING.txt
@@ -441,6 +490,14 @@ fi
%changelog
+* Thu Sep 21 2017 Remi Collet <remi@remirepo.net> - 9.2~RC1-1
+- update to 9.2RC1
+- drop dependency on zetacomponents/graph
+- raise dependency on zend-cache, zend-i18n 2.7
+- raise dependency on sabre/vobject 4.1
+- add dependency on paragonie/random_compat
+- switch from phpunit to atoum for test suite
+
* Sat Jul 22 2017 Johan Cwiklinski <johan AT x-tnd DOT be> - 9.1.6-1
- update to 9.1.6