]> git.pld-linux.org Git - packages/php-pecl-jsonc.git/blob - php-pecl-jsonc.spec
31615cf80f26bf5d3b988777ec8c038190b9a485
[packages/php-pecl-jsonc.git] / php-pecl-jsonc.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname jsonc
7 Summary:        PHP C extension for JSON serialization
8 Summary(pl.UTF-8):      Rozszerzenie C PHP dla serializacji JSON
9 Name:           %{php_name}-pecl-%{modname}
10 Version:        1.3.5
11 Release:        1
12 License:        PHP 3.01
13 Group:          Development/Languages/PHP
14 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
15 # Source0-md5:  85564b6f5c2e03063f39be54d881e89a
16 URL:            https://github.com/remicollet/pecl-json-c
17 %{?with_tests:BuildRequires:    %{php_name}-cli}
18 BuildRequires:  %{php_name}-devel
19 BuildRequires:  rpmbuild(macros) >= 1.666
20 Provides:       php(json) = %{version}
21 Obsoletes:      php-pecl-json < %{version}
22 %{?requires_php_extension}
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
26 Support for JSON (JavaScript Object Notation) serialization.
27
28 %description -l pl.UTF-8
29 php-json to bardzo szybkie rozszerzenie C PHP dla serializacji JSON
30 (JavaScript Object Notation).
31
32 %prep
33 %setup -qc
34 mv %{modname}-%{version}/* .
35
36 %build
37 phpize
38 %configure
39 %{__make}
40
41 %if %{with tests}
42 # simple module load test
43 %{__php} -n -q \
44         -d extension_dir=modules \
45         -d extension=json.so \
46         -m > modules.log
47 grep json modules.log
48
49 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
50 %{__make} test \
51         PHP_EXECUTABLE=%{__php}
52 %endif
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 %{__make} install \
57         EXTENSION_DIR=%{php_extensiondir} \
58         INSTALL_ROOT=$RPM_BUILD_ROOT
59
60 # no -devel yet
61 %{__rm} $RPM_BUILD_ROOT%{_includedir}/php/ext/json/php_json.h
62
63 # to simplify the rest, use jsonc.so as ext filename
64 mv $RPM_BUILD_ROOT%{php_extensiondir}/{json,%{modname}}.so
65
66 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
67 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
68 ; Enable %{modname} extension module
69 extension=%{modname}.so
70 EOF
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %post
76 %php_webserver_restart
77
78 %postun
79 if [ "$1" = 0 ]; then
80         %php_webserver_restart
81 fi
82
83 %files
84 %defattr(644,root,root,755)
85 %doc README.md CREDITS INSTALL
86 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
87 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.053659 seconds and 2 git commands to generate.