]> git.pld-linux.org Git - packages/php-pecl-jsonc.git/commitdiff
json ext using json-c, not Douglas Crockford code auto/th/php-pecl-jsonc-1.3.2-1
authorElan Ruusamäe <glen@delfi.ee>
Tue, 12 Nov 2013 20:07:54 +0000 (22:07 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 12 Nov 2013 20:07:54 +0000 (22:07 +0200)
http://www.reddit.com/r/PHP/comments/1ksnzw/php_json_removed_in_php_55/

php-pecl-jsonc.spec [new file with mode: 0644]

diff --git a/php-pecl-jsonc.spec b/php-pecl-jsonc.spec
new file mode 100644 (file)
index 0000000..367e8d2
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
+%define                php_name        php%{?php_suffix}
+%define                modname jsonc
+Summary:       PHP C extension for JSON serialization
+Summary(pl.UTF-8):     Rozszerzenie C PHP dla serializacji JSON
+Name:          %{php_name}-pecl-%{modname}
+Version:       1.3.2
+Release:       1
+License:       PHP 3.01
+Group:         Development/Languages/PHP
+Source0:       http://pecl.php.net/get/%{modname}-%{version}.tgz
+# Source0-md5: 8e1e30a996b1f3e5e370f6bb54eb40b7
+URL:           http://pecl.php.net/package/MODULE_NAME/
+%{?with_tests:BuildRequires:    %{php_name}-cli}
+BuildRequires: %{php_name}-devel
+BuildRequires: rpmbuild(macros) >= 1.666
+Provides:      php(json) = %{version}
+Obsoletes:     php-pecl-json < %{version}
+%{?requires_php_extension}
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Support for JSON (JavaScript Object Notation) serialization.
+
+%description -l pl.UTF-8
+php-json to bardzo szybkie rozszerzenie C PHP dla serializacji JSON
+(JavaScript Object Notation).
+
+%prep
+%setup -qc
+mv %{modname}-%{version}/* .
+
+%build
+phpize
+%configure
+%{__make}
+
+%if %{with tests}
+# simple module load test
+%{__php} -n -q \
+       -d extension_dir=modules \
+       -d extension=json.so \
+       -m > modules.log
+grep json modules.log
+
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+%{__make} test \
+       PHP_EXECUTABLE=%{__php}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+       EXTENSION_DIR=%{php_extensiondir} \
+       INSTALL_ROOT=$RPM_BUILD_ROOT
+
+# no -devel yet
+%{__rm} $RPM_BUILD_ROOT%{_includedir}/php/ext/json/php_json.h
+
+# to simplify the rest, use jsonc.so as ext filename
+mv $RPM_BUILD_ROOT%{php_extensiondir}/{json,%{modname}}.so
+
+install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
+; Enable %{modname} extension module
+extension=%{modname}.so
+EOF
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%php_webserver_restart
+
+%postun
+if [ "$1" = 0 ]; then
+       %php_webserver_restart
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc README.md CREDITS INSTALL
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 1.367484 seconds and 4 git commands to generate.