[packages/phabricator] initial packaging
glen
glen at pld-linux.org
Mon Oct 7 15:28:17 CEST 2013
commit 00f180229da74fecc44225b7ac4e5eb732c7b05a
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Oct 7 16:27:53 2013 +0300
initial packaging
apache.conf | 27 ++++++++++++++++
lighttpd.conf | 10 ++++++
phabricator.spec | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 134 insertions(+)
---
diff --git a/phabricator.spec b/phabricator.spec
new file mode 100644
index 0000000..a251ae7
--- /dev/null
+++ b/phabricator.spec
@@ -0,0 +1,97 @@
+Summary: Phabricator, an open software engineering platform
+Name: phabricator
+Version: 0.1
+Release: 0.1
+License: Apache v2.0
+Group: Applications/WWW
+Source0: https://github.com/facebook/%{name}/archive/master/phabricator.tar.gz
+# Source0-md5: 9a886bfc5a077e152d9e9b59fcbd19fe
+Source1: https://github.com/facebook/libphutil/archive/master/libphutil.tar.gz
+# Source1-md5: 276ec0faafabc48ca08ecab54e504b19
+Source2: https://github.com/facebook/arcanist/archive/master/arcanist.tar.gz
+# Source2-md5: 22f65983592de3d919e3d356904577a9
+Source3: apache.conf
+Source4: lighttpd.conf
+URL: http://www.phabricator.org/
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: sed >= 4.0
+Requires: php(curl)
+Requires: php(iconv)
+Requires: php(mbstring)
+Requires: php(mysqli)
+Requires: php(pcntl)
+Requires: webapps
+Requires: webserver
+Requires: webserver(access)
+Requires: webserver(alias)
+Requires: webserver(indexfile)
+Requires: webserver(php)
+Requires: webserver(rewrite)
+Suggests: git-core
+Suggests: php(apc)
+Suggests: php(gd)
+Suggests: php(xhprof)
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _webapps /etc/webapps
+%define _webapp %{name}
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _appdir %{_datadir}/%{_webapp}
+
+%description
+Phabricator is a collection of open source web applications that help
+software companies build better software.
+
+%prep
+%setup -qc -a1 -a2
+mv arcanist{-*,}
+mv libphutil{-*,}
+mv phabricator-*/{.??*,*} .
+rmdir phabricator-*
+
+grep -rlE '/usr/local/bin|bin/env' . | xargs sed -i -e ' 1 {
+ s,/usr/local/bin/php,/usr/bin/php,
+ s,/usr/bin/env /usr/bin/php,/usr/bin/php,
+}'
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
+
+cp -a . $RPM_BUILD_ROOT%{_appdir}
+
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerin -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerin -- lighttpd
+%webapp_register lighttpd %{_webapp}
+
+%triggerun -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
+%files
+%defattr(644,root,root,755)
+%doc README NOTICE
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%{_appdir}
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 0000000..37677a7
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,27 @@
+<Directory /usr/share/phabricator/webroot>
+ # Apache 2.x
+ <IfModule !mod_authz_core.c>
+ Order allow,deny
+ Allow from all
+ </IfModule>
+ # Apache 2.4
+ <IfModule mod_authz_core.c>
+ Require all granted
+ </IfModule>
+</Directory>
+
+<VirtualHost *>
+ # Change this to the domain which points to your host.
+ ServerName phabricator.example.com
+
+ # Change this to the path where you put 'phabricator' when you checked it
+ # out from GitHub when following the Installation Guide.
+ #
+ # Make sure you include "/webroot" at the end!
+ DocumentRoot /usr/share/phabricator/webroot
+
+ RewriteEngine on
+ RewriteRule ^/rsrc/(.*) - [L,QSA]
+ RewriteRule ^/favicon.ico - [L,QSA]
+ RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
+</VirtualHost>
diff --git a/lighttpd.conf b/lighttpd.conf
new file mode 100644
index 0000000..43bbef5
--- /dev/null
+++ b/lighttpd.conf
@@ -0,0 +1,10 @@
+$HTTP["host"] =~ "phabricator(\.example\.com)?" {
+ server.document-root = "/usr/share/phabricator/webroot"
+ url.rewrite-once = (
+ "^(/rsrc/.*)$" => "$1",
+ "^(/favicon.ico)$" => "$1",
+ # This simulates QSA ("query string append") mode in apache
+ "^(/[^?]*)\?(.*)" => "/index.php?__path__=$1&$2",
+ "^(/.*)$" => "/index.php?__path__=$1",
+ )
+}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/phabricator.git/commitdiff/00f180229da74fecc44225b7ac4e5eb732c7b05a
More information about the pld-cvs-commit
mailing list