summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--Makefile4
-rw-r--r--REFLECTION83
-rw-r--r--php-pecl-molten.spec297
4 files changed, 391 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ab5c4f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13af741
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../../common/Makefile
+
diff --git a/REFLECTION b/REFLECTION
new file mode 100644
index 0000000..d10c1f4
--- /dev/null
+++ b/REFLECTION
@@ -0,0 +1,83 @@
+Extension [ <persistent> extension #18 molten version 0.1.2beta ] {
+
+ - Dependencies {
+ Dependency [ json (Required) ]
+ Dependency [ standard (Required) ]
+ Dependency [ curl (Required) ]
+ Dependency [ memcached (Optional) ]
+ Dependency [ redis (Optional) ]
+ Dependency [ mongodb (Optional) ]
+ Dependency [ mysqli (Optional) ]
+ Dependency [ PDO (Optional) ]
+ }
+
+ - INI {
+ Entry [ molten.enable <SYSTEM> ]
+ Current = '1'
+ }
+ Entry [ molten.sink_log_path <SYSTEM> ]
+ Current = '/tmp/tracing'
+ }
+ Entry [ molten.service_name <SYSTEM> ]
+ Current = 'default'
+ }
+ Entry [ molten.tracing_cli <SYSTEM> ]
+ Current = '0'
+ }
+ Entry [ molten.sampling_type <SYSTEM> ]
+ Current = '1'
+ }
+ Entry [ molten.sampling_request <SYSTEM> ]
+ Current = '1000'
+ }
+ Entry [ molten.sampling_rate <SYSTEM> ]
+ Current = '64'
+ }
+ Entry [ molten.span_format <SYSTEM> ]
+ Current = 'zipkin'
+ }
+ Entry [ molten.report_interval <SYSTEM> ]
+ Current = '60'
+ }
+ Entry [ molten.notify_uri <SYSTEM> ]
+ Current = ''
+ }
+ Entry [ molten.report_limit <SYSTEM> ]
+ Current = '100'
+ }
+ Entry [ molten.sink_type <SYSTEM> ]
+ Current = '1'
+ }
+ Entry [ molten.output_type <SYSTEM> ]
+ Current = '1'
+ }
+ Entry [ molten.sink_http_uri <SYSTEM> ]
+ Current = ''
+ }
+ Entry [ molten.sink_syslog_unix_socket <SYSTEM> ]
+ Current = ''
+ }
+ Entry [ molten.sink_kafka_brokers <SYSTEM> ]
+ Current = ''
+ }
+ Entry [ molten.sink_kafka_topic <SYSTEM> ]
+ Current = ''
+ }
+ }
+
+ - Functions {
+ Function [ <internal:molten> function molten_set_service_name ] {
+ }
+ Function [ <internal:molten> function molten_curl_setopt ] {
+ }
+ Function [ <internal:molten> function molten_curl_setopt_array ] {
+ }
+ Function [ <internal:molten> function molten_curl_exec ] {
+ }
+ Function [ <internal:molten> function molten_curl_reset ] {
+ }
+ Function [ <internal:molten> function molten_span_format ] {
+ }
+ }
+}
+
diff --git a/php-pecl-molten.spec b/php-pecl-molten.spec
new file mode 100644
index 0000000..181e0c4
--- /dev/null
+++ b/php-pecl-molten.spec
@@ -0,0 +1,297 @@
+# remirepo spec file for php-pecl-molten
+#
+# Copyright (c) 2017 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+%if 0%{?scl:1}
+%global sub_prefix %{scl_prefix}
+%scl_package php-pecl-molten
+%endif
+
+%global proj_name Molten
+%global pecl_name molten
+%global with_zts 0
+%if "%{php_version}" < "5.6"
+%global ini_name z-%{pecl_name}.ini
+%else
+%global ini_name 60-%{pecl_name}.ini
+%endif
+# Not ready
+%global with_tests 0
+
+%global upstream_version 0.1.2
+%global upstream_prever beta
+
+Summary: Extension for application tracing
+Name: %{?sub_prefix}php-pecl-%{pecl_name}
+Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: MIT
+Group: Development/Languages
+URL: http://pecl.php.net/package/%{pecl_name}
+Source0: http://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upstream_prever}.tgz
+
+BuildRequires: %{?scl_prefix}php-devel >= 5.4
+BuildRequires: %{?scl_prefix}php-pear
+BuildRequires: %{?scl_prefix}php-json
+BuildRequires: %{?scl_prefix}php-curl
+BuildRequires: %{?scl_prefix}php-pecl-memcached
+BuildRequires: %{?scl_prefix}php-pecl-redis
+BuildRequires: %{?scl_prefix}php-pecl-mongodb
+BuildRequires: %{?scl_prefix}php-mysqlnd
+BuildRequires: %{?scl_prefix}php-pdo
+BuildRequires: curl-devel
+BuildRequires: librdkafka-devel
+
+Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
+Requires: %{?scl_prefix}php(api) = %{php_core_api}
+Requires: %{?scl_prefix}php-json%{?_isa}
+Requires: %{?scl_prefix}php-curl%{?_isa}
+Requires: %{?scl_prefix}php-pecl-memcached%{?_isa}
+Requires: %{?scl_prefix}php-pecl-redis%{?_isa}
+Requires: %{?scl_prefix}php-pecl-mongodb%{?_isa}
+Requires: %{?scl_prefix}php-mysqlnd%{?_isa}
+Requires: %{?scl_prefix}php-pdo%{?_isa}
+%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
+
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
+%if "%{?scl_prefix}" != "%{?sub_prefix}"
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
+
+%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+# Other third party repo stuff
+Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
+%if "%{php_version}" > "7.0"
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
+%endif
+%endif
+
+%if 0%{?fedora} < 20 && 0%{?rhel} < 7
+# Filter shared private
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
+%{?filter_setup}
+%endif
+
+
+%description
+Molten is transparency tool for application tracing it self module call.
+
+It trace php app core call and output zipkin/opentracing format trace log.
+
+Provides features about muliti trace sapi, multi sampling type,
+upload tracing status, module control and muliti sink type.
+
+It very easy to build a distributed systems tracing infrastructure base
+on php, already run on thousand instance on production env.
+
+Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
+
+
+%prep
+%setup -q -c
+mv %{proj_name}-%{upstream_version}%{?upstream_prever} NTS
+
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
+
+cd NTS
+# TODO: use some other directory
+sed -e '/DEFAULT_LOG_DIR/s:"/var/wd/log/tracing/php/":"/tmp/":' -i molten_log.h
+
+# Fix version
+sed -e '/MOLTEN_EXT_VERSION/s/1.0.0/%{upstream_version}%{?upstream_prever}/' -i molten_util.h
+
+# Sanity check, really often broken
+extver=$(sed -n '/MOLTEN_EXT_VERSION/{s/.* "//;s/".*$//;p}' molten_util.h)
+if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{upstream_version}%{?upstream_prever}.
+ exit 1
+fi
+cd ..
+
+%if %{with_zts}
+# Duplicate source tree for NTS / ZTS build
+cp -pr NTS ZTS
+%endif
+
+# Create configuration file
+cat << 'EOF' | tee %{ini_name}
+; Enable "%{pecl_name}" extension module
+extension=%{pecl_name}.so
+
+; Configuration
+;molten.enable = 1
+;molten.sink_log_path = '/tmp/tracing'
+;molten.service_name = 'default'
+;molten.tracing_cli = 0
+;molten.sampling_type = 1
+;molten.sampling_request = 1000
+;molten.sampling_rate = 64
+;molten.span_format = 'zipkin'
+;molten.report_interval = 60
+;molten.notify_uri = ''
+;molten.report_limit = 100
+;molten.sink_type = 1
+;molten.output_type = 1
+;molten.sink_http_uri = ''
+;molten.sink_syslog_unix_socket = ''
+;molten.sink_kafka_brokers= ''
+;molten.sink_kafka_topic = ''
+EOF
+
+
+%build
+%{?dtsenable}
+
+cd NTS
+%{_bindir}/phpize
+%configure \
+ --enable-molten \
+ --with-libdir=%{_lib} \
+ --with-php-config=%{_bindir}/php-config
+
+make %{?_smp_mflags}
+
+%if %{with_zts}
+cd ../ZTS
+%{_bindir}/zts-phpize
+%configure \
+ --enable-molten \
+ --with-libdir=%{_lib} \
+ --with-php-config=%{_bindir}/zts-php-config
+
+make %{?_smp_mflags}
+%endif
+
+
+%install
+%{?dtsenable}
+
+make -C NTS install INSTALL_ROOT=%{buildroot}
+
+# install config file
+install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
+
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+
+%if %{with_zts}
+make -C ZTS install INSTALL_ROOT=%{buildroot}
+
+install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
+%endif
+
+# Documentation
+for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{proj_name}/$i
+done
+
+
+%if 0%{?fedora} < 24
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+
+%postun
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
+ %{pecl_uninstall} %{proj_name} >/dev/null || :
+fi
+%endif
+
+
+%check
+: Minimal load test for NTS extension
+MODREQ=
+for mod in curl json pdo; do
+ if [ -f %{php_extdir}/${mod}.so ]; then
+ MODREQ="$MODREQ -d extension=${mod}.so"
+ fi
+done
+
+MODOPT=
+for mod in igbinary msgpack memcached mongodb redis mysqlnd mysqli; do
+ if [ -f %{php_extdir}/${mod}.so ]; then
+ MODOPT="$MODOPT -d extension=${mod}.so"
+ fi
+done
+
+cd NTS
+%{__php} --no-php-ini $MODREQ \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+
+%if %{with_tests}
+# Upstream test suite
+TEST_PHP_EXECUTABLE=%{__php} \
+TEST_PHP_ARGS="-n $MODREQ $MODOPT -d extension=$PWD/modules/%{pecl_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__php} -n run-tests.php --show-diff
+%endif
+
+%if %{with_zts}
+: Minimal load test for ZTS extension
+cd ../ZTS
+%{__ztsphp} --no-php-ini $MODREQ \
+ $modules \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+%if %{with_tests}
+# Upstream test suite
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+TEST_PHP_ARGS="-n $MODREQ $MODOPT -d extension=$PWD/modules/%{pecl_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__ztsphp} -n run-tests.php --show-diff
+%endif
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+%license NTS/LICENSE
+%doc %{pecl_docdir}/%{proj_name}
+%{pecl_xmldir}/%{name}.xml
+
+%config(noreplace) %{php_inidir}/%{ini_name}
+%{php_extdir}/%{pecl_name}.so
+
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{ini_name}
+%{php_ztsextdir}/%{pecl_name}.so
+%endif
+
+
+%changelog
+* Thu Aug 17 2017 Remi Collet <remi@remirepo.net> - 0.1.2~beta-1
+- initial package