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