Logoj0ke.net Open Build Service > Projects > internetx:php5:EL5 > php-sqlite2 > php-sqlite2.spec
Sign Up | Log In

File php-sqlite2.spec of Package php-sqlite2 (Revision 38)

Currently displaying revision 38, show latest

 
1
%define     pkgname SQLite
2
%define     pkgversion 1.0.3
3
%define     phpversion %(php-config --version 2>/dev/null || echo 0)
4
%define     __pecl %{_bindir}/pecl
5
6
Name:       php-sqlite2
7
Version:    %{phpversion}
8
Release:    10
9
License:    GPL
10
Url:        http://pecl.php.net
11
Summary:    PHP SQLite2 extension
12
Source0:    http://pecl.php.net/get/SQLite-1.0.3.tgz
13
Patch0:     SQLite-arg3.patch
14
Patch1:     SQLite-utf8.patch
15
Group:      Development/Languages
16
BuildRoot:  %{_tmppath}/%{name}-%{version}-root
17
Provides:   php-pecl-%{pkgname} = %{version}
18
Provides:   any-php-sqlite2
19
Requires(post): %{__pecl}
20
Requires(postun): %{__pecl}
21
BuildRequires:  php-devel >= 5.2.0 php-pear,which
22
23
%description
24
PHP SQLite2 extension module.
25
26
%prep
27
%setup -n %{pkgname}-%{pkgversion}
28
%patch1
29
30
%build
31
%if %(rpm -q --queryformat %{version} php-devel) < 5.3
32
%patch0
33
%endif
34
35
%{_bindir}/phpize
36
%configure --with-sqlite --with-sqlite-utf8 --with-php-config=%{_bindir}/php-config
37
%{__make} %{?_smp_mflags}
38
39
40
%install
41
%__make INSTALL_ROOT=%{buildroot} install
42
43
%{__mkdir_p} %{buildroot}%{pecl_xmldir}
44
%{__install} -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
45
46
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
47
%{__cat} > %{buildroot}%{_sysconfdir}/php.d/sqlite2.ini << 'EOF'
48
; Enable sqlite2 extension module
49
extension = sqlite2.so
50
EOF
51
52
53
%if 0%{?pecl_install:1}
54
%post
55
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : 
56
%endif
57
58
%if 0%{?pecl_uninstall:1}
59
%postun
60
if [ $1 -eq 0 ] ; then
61
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
62
fi
63
%endif
64
65
%clean
66
rm -rf %{buildroot}
67
68
%files
69
%defattr(-,root,root)
70
%doc CREDITS README TODO
71
%config(noreplace) %{_sysconfdir}/php.d/sqlite2.ini
72
%{pecl_xmldir}/%{name}.xml
73
%{php_extdir}/sqlite.so
74
75
%changelog
76