1 |
%define snap 20071129 |
2 |
|
3 |
%define realname Teng |
4 |
%define modname teng |
5 |
%define dirname %{modname} |
6 |
%define soname %{modname}.so |
7 |
%define inifile 22_%{modname}.ini |
8 |
|
9 |
Summary: General purpose templating engine for PHP |
10 |
Name: php-%{modname} |
11 |
Version: 2.0.0 |
12 |
Release: %mkrel 0.%{snap}.17 |
13 |
Group: Development/PHP |
14 |
License: LGPL |
15 |
URL: http://teng.sourceforge.net/ |
16 |
Source0: php4.tar.gz |
17 |
BuildRequires: php-devel >= 3:5.2.0 |
18 |
BuildRequires: libteng-devel |
19 |
|
20 |
%description |
21 |
Teng is a general purpose templating engine (whence Teng), this package |
22 |
add Teng support to PHP. |
23 |
|
24 |
%prep |
25 |
|
26 |
%setup -q -n php4 |
27 |
|
28 |
%build |
29 |
%serverbuild |
30 |
|
31 |
phpize |
32 |
%configure2_5x --with-libdir=%{_lib} \ |
33 |
--with-%{modname}=%{_prefix} |
34 |
|
35 |
%make |
36 |
mv modules/*.so . |
37 |
chrpath -d %{soname} |
38 |
|
39 |
%install |
40 |
rm -rf %{buildroot} |
41 |
|
42 |
install -d %{buildroot}%{_libdir}/php/extensions |
43 |
install -d %{buildroot}%{_sysconfdir}/php.d |
44 |
|
45 |
install -m755 %{soname} %{buildroot}%{_libdir}/php/extensions/ |
46 |
|
47 |
cat > README.%{modname} << EOF |
48 |
The %{name} package contains a dynamic shared object (DSO) for PHP. |
49 |
To activate it, make sure a file /etc/php.d/%{inifile} is present and |
50 |
contains the line 'extension = %{soname}'. |
51 |
EOF |
52 |
|
53 |
cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF |
54 |
extension = %{soname} |
55 |
EOF |
56 |
|
57 |
%post |
58 |
if [ -f /var/lock/subsys/httpd ]; then |
59 |
%{_initrddir}/httpd restart >/dev/null || : |
60 |
fi |
61 |
|
62 |
%postun |
63 |
if [ "$1" = "0" ]; then |
64 |
if [ -f /var/lock/subsys/httpd ]; then |
65 |
%{_initrddir}/httpd restart >/dev/null || : |
66 |
fi |
67 |
fi |
68 |
|
69 |
%clean |
70 |
rm -rf %{buildroot} |
71 |
|
72 |
%files |
73 |
%defattr(-,root,root) |
74 |
%doc CREDITS README.%{modname} |
75 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile} |
76 |
%attr(0755,root,root) %{_libdir}/php/extensions/%{soname} |
77 |
|
78 |
|