[packages/php-pecl-jsonc] json ext using json-c, not Douglas Crockford code
glen
glen at pld-linux.org
Tue Nov 12 21:08:48 CET 2013
commit 8fb6c733d14967e893cf80861210a4f5e14e6582
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Nov 12 22:07:54 2013 +0200
json ext using json-c, not Douglas Crockford code
http://www.reddit.com/r/PHP/comments/1ksnzw/php_json_removed_in_php_55/
php-pecl-jsonc.spec | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
---
diff --git a/php-pecl-jsonc.spec b/php-pecl-jsonc.spec
new file mode 100644
index 0000000..367e8d2
--- /dev/null
+++ b/php-pecl-jsonc.spec
@@ -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
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-jsonc.git/commitdiff/8fb6c733d14967e893cf80861210a4f5e14e6582
More information about the pld-cvs-commit
mailing list