diff options
-rw-r--r-- | LICENSE | 68 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | apm-web.httpd | 22 | ||||
-rw-r--r-- | apm-web.nginx | 26 | ||||
-rw-r--r-- | apm-web.spec | 131 |
5 files changed, 251 insertions, 0 deletions
@@ -0,0 +1,68 @@ +-------------------------------------------------------------------- + The PHP License, version 3.01 +Copyright (c) 1999 - 2006 The PHP Group. All rights reserved. +-------------------------------------------------------------------- + +Redistribution and use in source and binary forms, with or without +modification, is permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The name "PHP" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact group@php.net. + + 4. Products derived from this software may not be called "PHP", nor + may "PHP" appear in their name, without prior written permission + from group@php.net. You may indicate that your software works in + conjunction with PHP by saying "Foo for PHP" instead of calling + it "PHP Foo" or "phpfoo" + + 5. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. + Once covered code has been published under a particular version + of the license, you may always continue to use it under the terms + of that version. You may also choose to use such covered code + under the terms of any subsequent version of the license + published by the PHP Group. No one other than the PHP Group has + the right to modify the terms applicable to covered code created + under this License. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes PHP software, freely available from + <http://www.php.net/software/>". + +THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND +ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP +DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- + +This software consists of voluntary contributions made by many +individuals on behalf of the PHP Group. + +The PHP Group can be contacted via Email at group@php.net. + +For more information on the PHP Group and the PHP project, +please see <http://www.php.net>. + +PHP includes the Zend Engine, freely available at +<http://www.zend.com>. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e65467 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../common/Makefile + diff --git a/apm-web.httpd b/apm-web.httpd new file mode 100644 index 0000000..6878614 --- /dev/null +++ b/apm-web.httpd @@ -0,0 +1,22 @@ +# APM (Alternative PHP Monitor) +# +# Allows only localhost by default +# + +Alias /@ALIAS@ @SHARE@/@ALIAS@ + +<Directory @SHARE@/@ALIAS@/> + AddDefaultCharset UTF-8 + + <IfModule mod_authz_core.c> + # Apache 2.4 + Require local + </IfModule> + <IfModule !mod_authz_core.c> + # Apache 2.2 + Order Deny,Allow + Deny from All + Allow from 127.0.0.1 + Allow from ::1 + </IfModule> +</Directory> diff --git a/apm-web.nginx b/apm-web.nginx new file mode 100644 index 0000000..fcde469 --- /dev/null +++ b/apm-web.nginx @@ -0,0 +1,26 @@ +# APM (Alternative PHP Monitor) +# +# Allows only localhost by default +# + +location = /@ALIAS@ { + alias @SHARE@/@ALIAS@/; +} + +location /@ALIAS@/ { + root @SHARE@; + index index.php index.html; + + location ~ ^/@ALIAS@/(.+\.php)$ + { + allow 127.0.0.1; + allow ::1; + deny all; + + try_files $uri =404; + fastcgi_intercept_errors on; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass php-fpm; + } +} diff --git a/apm-web.spec b/apm-web.spec new file mode 100644 index 0000000..3897484 --- /dev/null +++ b/apm-web.spec @@ -0,0 +1,131 @@ +# spec file for apm-web +# +# Copyright (c) 2015 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_owner patrickallaert +%global gh_name php-apm-web +%global gh_commit d7425e00f2f6b3004c21c46d1d6e097fbd78d033 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%if 0%{?fedora} >= 21 +# support for apache / nginx / php-fpm +%global with_phpfpm 1 +%else +%global with_phpfpm 0 +%endif + +Name: apm-web +Version: 2.0.0 +Release: 3%{?dist} +Summary: APM (Alternative PHP Monitor) web frontend + +Group: Applications/Internet +License: PHP +URL: https://github.com/%{gh_owner}/%{gh_name} +Source0: %{url}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz + +# Webserver configuration files +Source1: %{name}.httpd +Source2: %{name}.nginx + +# Temporary fix for https://github.com/patrickallaert/php-apm-web/issues/1 +Source3: https://raw.githubusercontent.com/patrickallaert/php-apm/master/LICENSE + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +%if %{with_phpfpm} +Requires: webserver +Requires: nginx-filesystem +Requires: httpd-filesystem +Requires: php(httpd) +%else +Requires: httpd +Requires: mod_php +%endif +# From phpcompatinfo analysis +Requires: php(language) > 5.3 +Requires: php-date +Requires: php-json +Requires: php-pcre +Requires: php-pdo + +# This is not a library, but a web-app, so doesn't really make sense +Provides: php-composer(patrickallaert/php-apm-web) = %{version} + + +%description +APM (Alternative PHP Monitor) is a monitoring extension enabling native +Application Performance Management (APM) for PHP. + +This is the web frontend that enables visualizing the data gathered by +that extension. + +The php-pecl-apm package provides the extension. + + +%prep +%setup -q -n %{gh_name}-%{gh_commit} + +: Fix configuration path +sed -e 's:"config/db.php":"%{_sysconfdir}/apm-web/db.php":' \ + -i model/repository.php + +: Create webserver configuration files +sed -e 's:@ALIAS@:%{name}:g' \ + -e 's:@SHARE@:%{_datadir}:g' \ + %{SOURCE1} > %{name}.httpd + +%if %{with_phpfpm} +sed -e 's:@ALIAS@:%{name}:g' \ + -e 's:@SHARE@:%{_datadir}:g' \ + %{SOURCE2} > %{name}.nginx +%endif + +cp %{SOURCE3} . + + +%build +# Nothing + + +%install +install -d %{buildroot}%{_datadir}/%{name} +cp -pr css img js model plugins views *php \ + %{buildroot}%{_datadir}/%{name} + +# Apache config +install -D -m 644 %{name}.httpd \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf + +%if %{with_phpfpm} +# Nginx config +install -Dpm 0644 %{name}.nginx \ + %{buildroot}/%{_sysconfdir}/nginx/default.d/%{name}.conf +%endif + +# Application config +install -D -m 644 -p config/db.php \ + %{buildroot}%{_sysconfdir}/%{name}/db.php + + +%files +%defattr(-,root,root,-) +%{!?_licensedir:%global license %%doc} +%license LICENSE +# Need to restrict access, as it contains a clear password +%attr(750,root,apache) %dir %{_sysconfdir}/%{name} +%attr(640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.php +%{_datadir}/%{name} +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%if %{with_phpfpm} +%config(noreplace) %{_sysconfdir}/nginx/default.d/%{name}.conf +%endif + + +%changelog +* Sat Feb 21 2015 Remi Collet <remi@fedoraproject.org> - 2.0.0-3 +- initial package, version 2.0.0 (split off php-pecl-apm)
\ No newline at end of file |