]> git.pld-linux.org Git - packages/php-pecl-sqlite.git/blob - php-pecl-sqlite.spec
new, version 2.0-dev extracted from pecl svn
[packages/php-pecl-sqlite.git] / php-pecl-sqlite.spec
1 # TODO
2 # - rm -rf libsqlite and build with system sqlite
3 # http://www.mail-archive.com/internals@lists.php.net/msg47463.html
4 #
5 # Conditional build:
6 %bcond_without  tests           # build without tests
7
8 %if 0
9 # To create tarball:
10 svn co http://svn.php.net/repository/pecl/sqlite/trunk sqlite
11 tar --exclude-vcs -cjf sqlite-r$(cd sqlite && svnversion).tar.bz2 sqlite
12 %endif
13
14 %define         rel             0.1
15 %define         svnrev  r333433
16 %define         php_name        php%{?php_suffix}
17 %define         modname sqlite
18 Summary:        SQLite extension module for PHP
19 Summary(pl.UTF-8):      Moduł SQLite dla PHP
20 Name:           %{php_name}-pecl-%{modname}
21 Version:        2.0
22 Release:        0.%{svnrev}.%{rel}
23 License:        PHP 3.01
24 Group:          Development/Languages/PHP
25 Source0:        %{modname}-%{svnrev}.tar.bz2
26 # Source0-md5:  5f5e08b404f5ba2e0b87d473c3c94eb7
27 #Source0:       http://pecl.php.net/get/%{modname}-%{version}.tgz
28 URL:            http://www.php.net/manual/en/book.sqlite.php
29 BuildRequires:  %{php_name}-devel
30 BuildRequires:  rpmbuild(macros) >= 1.666
31 BuildRequires:  sqlite-devel
32 %if %{with tests}
33 BuildRequires:  %{php_name}-cli
34 BuildRequires:  %{php_name}-pdo
35 BuildRequires:  %{php_name}-spl
36 %endif
37 %{?requires_php_extension}
38 Provides:       php(sqlite) = %{version}
39 Obsoletes:      php-sqlite < 4:5.4.0
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         sqlitever       %{version}-dev
43
44 %description
45 SQLite is a C library that implements an embeddable SQL database
46 engine. Programs that link with the SQLite library can have SQL
47 database access without running a separate RDBMS process.
48
49 SQLite is not a client library used to connect to a big database
50 server. SQLite is the server. The SQLite library reads and writes
51 directly to and from the database files on disk.
52
53 %description -l pl.UTF-8
54 SQLite jest napisaną w C biblioteką implementującą osadzalny silnik
55 bazodanowy SQL. Program linkujący się z biblioteką SQLite może mieć
56 dostęp do bazy SQL bez potrzeby uruchamiania dodatkowego procesu
57 RDBMS.
58
59 SQLite to nie klient baz danych - biblioteka nie łączy się z serwerami
60 baz danych. SQLite sam jest serwerem. Biblioteka SQLite czyta i
61 zapisuje dane bezpośrednio z/do plików baz danych znajdujących się na
62 dysku.
63
64 %prep
65 %setup -qc
66 mv sqlite/* .
67
68 %build
69 ver=$(awk '/#define PHP_SQLITE_MODULE_VERSION/ {print $3}' sqlite.c | xargs)
70 if test "$ver" != "%{sqlitever}"; then
71         : Error: Upstream Sqlite version is now ${ver}, expecting %{sqlitever}.
72         : Update the sqlitever macro and rebuild.
73         exit 1
74 fi
75
76 phpize
77 %configure \
78         --with-sqlite=shared,/usr \
79         --enable-sqlite-utf8
80 %{__make}
81
82 %if %{with tests}
83 # simple module load test
84 %{__php} -n -q \
85         -d extension_dir=modules \
86         -d extension=%{php_extensiondir}/spl.so \
87         -d extension=%{php_extensiondir}/pdo.so \
88         -d extension=%{modname}.so \
89         -m > modules.log
90 grep -i %{modname} modules.log
91
92 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
93 %{__make} test \
94         PHP_EXECUTABLE=%{__php}
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 %{__make} install \
100         EXTENSION_DIR=%{php_extensiondir} \
101         INSTALL_ROOT=$RPM_BUILD_ROOT
102
103 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
104 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
105 ; Enable %{modname} extension module
106 extension=%{modname}.so
107 EOF
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %post
113 %php_webserver_restart
114
115 %postun
116 if [ "$1" = 0 ]; then
117         %php_webserver_restart
118 fi
119
120 %files
121 %defattr(644,root,root,755)
122 %doc README TODO CREDITS
123 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
124 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.038323 seconds and 3 git commands to generate.