1 |
%define modname timezonedb |
2 |
%define dirname %{modname} |
3 |
%define soname %{modname}.so |
4 |
%define inifile A60_%{modname}.ini |
5 |
|
6 |
# (tpg) define release here |
7 |
%define release %mkrel 1 |
8 |
|
9 |
Summary: Timezone Database to be used with PHP's date and time functions |
10 |
Name: php-%{modname} |
11 |
Version: 2014.9 |
12 |
Release: %{release} |
13 |
Group: Development/PHP |
14 |
License: PHP License |
15 |
URL: http://pecl.php.net/package/timezonedb/ |
16 |
Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz |
17 |
BuildRequires: php-devel >= 3:5.4.3 |
18 |
BuildRequires: file |
19 |
Epoch: 3 |
20 |
|
21 |
|
22 |
%description |
23 |
This extension is a drop-in replacement for the builtin timezone database that |
24 |
comes with PHP. You should only install this extension in case you need to get |
25 |
a later version of the timezone database than the one that ships with PHP. |
26 |
|
27 |
The data that this extension uses comes from the "Olson" database, which is |
28 |
located at ftp://elsie.nci.nih.gov/pub/. |
29 |
|
30 |
%prep |
31 |
|
32 |
%setup -q -n %{modname}-%{version} |
33 |
[ "../package*.xml" != "/" ] && mv ../package*.xml . |
34 |
|
35 |
# fix permissions |
36 |
find . -type f | xargs chmod 644 |
37 |
|
38 |
# strip away annoying ^M |
39 |
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//' |
40 |
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//' |
41 |
|
42 |
%build |
43 |
%serverbuild |
44 |
|
45 |
phpize |
46 |
%configure2_5x --with-libdir=%{_lib} \ |
47 |
--with-%{modname}=shared,%{_prefix} |
48 |
%make |
49 |
|
50 |
mv modules/*.so . |
51 |
|
52 |
%install |
53 |
rm -rf %{buildroot} |
54 |
|
55 |
install -d %{buildroot}%{_libdir}/php/extensions |
56 |
install -d %{buildroot}%{_sysconfdir}/php.d |
57 |
|
58 |
install -m0755 %{soname} %{buildroot}%{_libdir}/php/extensions/ |
59 |
|
60 |
cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF |
61 |
extension = %{soname} |
62 |
EOF |
63 |
|
64 |
%clean |
65 |
rm -rf %{buildroot} |
66 |
|
67 |
%files |
68 |
%defattr(-,root,root) |
69 |
%doc CREDITS package*.xml |
70 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile} |
71 |
%attr(0755,root,root) %{_libdir}/php/extensions/%{soname} |
72 |
|
73 |
|