d2536a0
# remirepo/fedora spec file for php-horde-Horde-Service-Weather
1454a65
#
3103a5f
# Copyright (c) 2012-2020 Remi Collet
1454a65
# License: CC-BY-SA
22f7ee1
# http://creativecommons.org/licenses/by-sa/4.0/
1454a65
#
1454a65
# Please, preserve the changelog entries
1454a65
#
f7f3a56
%{!?__pear:       %global __pear       %{_bindir}/pear}
1454a65
%global pear_name    Horde_Service_Weather
1454a65
%global pear_channel pear.horde.org
1454a65
1454a65
Name:           php-horde-Horde-Service-Weather
3103a5f
Version:        2.5.5
1454a65
Release:        1%{?dist}
1454a65
Summary:        Horde Weather Provider
1454a65
1454a65
Group:          Development/Libraries
1454a65
License:        BSD
1454a65
URL:            http://%{pear_channel}
1454a65
Source0:        http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
1454a65
1454a65
BuildArch:      noarch
1454a65
BuildRequires:  gettext
1454a65
BuildRequires:  php(language) >= 5.3.0
4235166
BuildRequires:  php-pear(PEAR)
1454a65
BuildRequires:  php-channel(%{pear_channel})
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Role) >= 1.0.0
1454a65
# To run unit tests
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Date) >= 2.0.0
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Http) >= 2.0.0
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Serialize) >= 2.0.0
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Test) >= 2.1.0
1454a65
BuildRequires:  php-pear(%{pear_channel}/Horde_Url) >= 2.0.0
1454a65
1454a65
Requires(post): %{__pear}
1454a65
Requires(postun): %{__pear}
1454a65
Requires:       php(language) >= 5.3.0
0e48cd0
Requires:       php-cli
1454a65
Requires:       php-date
1454a65
Requires:       php-gettext
1454a65
Requires:       php-spl
1454a65
Requires:       php-pear(PEAR) >= 1.7.0
1454a65
Requires:       php-channel(%{pear_channel})
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Role) >= 1.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Date) >= 2.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Date) <  3.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Exception) <  3.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Http) >= 2.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Http) <  3.0.0
22f7ee1
Requires:       php-pear(%{pear_channel}/Horde_Translation) >= 2.2.0
22f7ee1
Requires:       php-pear(%{pear_channel}/Horde_Translation) <  3.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Url) >= 2.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Url) <  3.0.0
1454a65
# Not documented, detected by phpci
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Serialize) >= 2.0.0
1454a65
Requires:       php-pear(%{pear_channel}/Horde_Serialize) <  3.0.0
1454a65
1454a65
Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
22f7ee1
Provides:       php-composer(horde/horde-service-weather) = %{version}
1454a65
1454a65
1454a65
%description
1454a65
Set of classes that provide an abstraction to various online weather
1454a65
service providers. Includes drivers for WeatherUnderground,
1454a65
WorldWeatherOnline, and Google Weather.
1454a65
1454a65
1454a65
%prep
1454a65
%setup -q -c
1454a65
1454a65
cd %{pear_name}-%{version}
1454a65
1454a65
# Don't install .po and .pot files
1454a65
# Remove checksum for .mo, as we regenerate them
1454a65
sed -e '/%{pear_name}.po/d' \
1454a65
    -e '/Horde_Other.po/d' \
d2536a0
    -e '/%{pear_name}.mo/s/md5sum="[^"]*"//' \
1454a65
    ../package.xml >%{name}.xml
4235166
touch -r ../package.xml %{name}.xml
1454a65
1454a65
1454a65
%build
1454a65
cd %{pear_name}-%{version}
1454a65
1454a65
# Regenerate the locales
1454a65
for po in $(find locale -name \*.po)
1454a65
do
1454a65
   msgfmt $po -o $(dirname $po)/$(basename $po .po).mo
1454a65
done
1454a65
1454a65
1454a65
%install
1454a65
cd %{pear_name}-%{version}
1454a65
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
1454a65
1454a65
# Clean up unnecessary files
1454a65
rm -rf %{buildroot}%{pear_metadir}/.??*
1454a65
1454a65
# Install XML package description
1454a65
mkdir -p %{buildroot}%{pear_xmldir}
1454a65
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
1454a65
1454a65
# Locales
1454a65
for loc in locale/{??,??_??}
1454a65
do
1454a65
    lang=$(basename $loc)
1454a65
    test -d %{buildroot}%{pear_datadir}/%{pear_name}/$loc \
1454a65
         && echo "%%lang(${lang%_*}) %{pear_datadir}/%{pear_name}/$loc"
1454a65
done | tee ../%{pear_name}.lang
1454a65
1454a65
1454a65
%check
1454a65
cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
1454a65
3103a5f
ret=0
3103a5f
for cmd in php php72 php73 php74; do
3103a5f
  if which $cmd; then
3103a5f
    $cmd %{_bindir}/phpunit --bootstrap bootstrap.php --verbose . || ret=1
3103a5f
  fi
3103a5f
done
3103a5f
exit $ret
e8b2ca1
1454a65
1454a65
%post
1454a65
%{__pear} install --nodeps --soft --force --register-only \
1454a65
    %{pear_xmldir}/%{name}.xml >/dev/null || :
1454a65
1454a65
%postun
1454a65
if [ $1 -eq 0 ] ; then
1454a65
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
1454a65
        %{pear_channel}/%{pear_name} >/dev/null || :
1454a65
fi
1454a65
1454a65
1454a65
%files -f %{pear_name}.lang
1454a65
%doc %{pear_docdir}/%{pear_name}
1454a65
%{pear_xmldir}/%{name}.xml
1454a65
%dir %{pear_phpdir}/Horde/Service
1454a65
%{pear_phpdir}/Horde/Service/Weather
1454a65
%{pear_phpdir}/Horde/Service/Weather.php
1454a65
%dir %{pear_datadir}/%{pear_name}
1454a65
%dir %{pear_datadir}/%{pear_name}/locale
c5be9e2
     %{pear_datadir}/%{pear_name}/migration
3103a5f
%doc %{pear_testdir}/%{pear_name}
1454a65
%{pear_hordedir}/themes
0e48cd0
%{_bindir}/horde-service-weather-metar-database
1454a65
22f7ee1
1454a65
%changelog
3103a5f
* Wed Dec  2 2020 Remi Collet <remi@remirepo.net> - 2.5.5-1
3103a5f
- update to 2.5.5
3103a5f
68312f6
* Mon Feb 27 2017 Remi Collet <remi@fedoraproject.org> - 2.5.4-1
68312f6
- Update to 2.5.4
68312f6
0e48cd0
* Sun Dec 11 2016 Remi Collet <remi@fedoraproject.org> - 2.5.3-1
0e48cd0
- Update to 2.5.3
0e48cd0
- add horde-service-weather-metar-database command
0e48cd0
d76909f
* Thu Nov 10 2016 Remi Collet <remi@fedoraproject.org> - 2.5.2-1
d76909f
- Update to 2.5.2
d76909f
39dd4ef
* Thu Nov 10 2016 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
39dd4ef
- Update to 2.5.1
39dd4ef
c3efdb3
* Sun Nov 06 2016 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
c3efdb3
- Update to 2.5.0
c3efdb3
980ed7b
* Thu Nov 03 2016 Remi Collet <remi@fedoraproject.org> - 2.4.1-1
980ed7b
- Update to 2.4.1
980ed7b
c5be9e2
* Fri Sep 02 2016 Remi Collet <remi@fedoraproject.org> - 2.4.0-1
c5be9e2
- Update to 2.4.0
c5be9e2
709d247
* Sat Jul 02 2016 Remi Collet <remi@fedoraproject.org> - 2.3.4-1
709d247
- Update to 2.3.4
709d247
e8b2ca1
* Wed Mar 16 2016 Remi Collet <remi@fedoraproject.org> - 2.3.3-1
e8b2ca1
- Update to 2.3.3
e8b2ca1
Remi Collet 88b7c1d
* Mon Feb  8 2016 Remi Collet <remi@fedoraproject.org> - 2.3.2-1
Remi Collet 88b7c1d
- Update to 2.3.2
Remi Collet 88b7c1d
- PHP 7 compatible version
Remi Collet 88b7c1d
24a635e
* Fri Dec 04 2015 Remi Collet <remi@fedoraproject.org> - 2.3.1-1
24a635e
- Update to 2.3.1
24a635e
9be2285
* Wed Oct 21 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
9be2285
- Update to 2.3.0
9be2285
d2536a0
* Sun Aug 30 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
d2536a0
- Update to 2.2.0
d2536a0
22f7ee1
* Wed Mar 04 2015 Remi Collet <remi@fedoraproject.org> - 2.1.6-1
22f7ee1
- Update to 2.1.6
22f7ee1
- add dependency on Horde_Translation 2.2.0
22f7ee1
- add provides php-composer(horde/horde-service-weather)
22f7ee1
dac555a
* Sun Oct 12 2014 Remi Collet <remi@fedoraproject.org> - 2.1.4-1
dac555a
- Update to 2.1.4
dac555a
4235166
* Mon Jul 07 2014 Remi Collet <remi@fedoraproject.org> - 2.1.3-1
4235166
- Update to 2.1.3
4235166
220ac9a
* Thu May 22 2014 Remi Collet <remi@fedoraproject.org> - 2.1.1-1
220ac9a
- Update to 2.1.1
220ac9a
9bed560
* Mon May 19 2014 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
f7f3a56
- Update to 2.1.0
f7f3a56
1454a65
* Mon May 27 2013 Remi Collet <remi@fedoraproject.org> - 2.0.5-1
1454a65
- Update to 2.0.5
1454a65
- switch from Conflicts >= max to Requires < max
1454a65
1454a65
* Sat Apr  6 2013 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
1454a65
- initial package