1 %define php_min_version 5.0.0
2 %include /usr/lib/rpm/macros.php
3 Summary: A collaborative debugging tool
7 License: Affero GPL licence
8 Group: Applications/WWW
9 Source0: http://%{name}.dixo.net/pastebin.tar.gz
10 # Source0-md5: c73c4b40e8eeddba9b515586f017a777
12 Patch1: system-geshi.patch
17 Source2: lighttpd.conf
18 URL: http://blog.dixo.net/downloads/
19 BuildRequires: rpmbuild(macros) >= 1.553
20 Requires: php(core) >= %{php_min_version}
23 Requires: php-geshi >= 1.0.7
25 Requires: webserver(access)
26 Requires: webserver(alias)
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _webapps /etc/webapps
32 %define _webapp %{name}
33 %define _sysconfdir %{_webapps}/%{_webapp}
34 %define _appdir %{_datadir}/%{_webapp}
37 %define _noautopear pear
39 # exclude optional php dependencies
40 %define _noautophp php-mysql
42 # put it together for rpmbuild
43 %define _noautoreq %{?_noautophp} %{?_noautopear}
46 This tool was orignally designed to enable collaborative code review
47 via the #php IRC channel. Inspired by www.parseerror.com/paste, but
48 more streamlined and capable of allowing collabation via IRC by
49 allowing easy modification of posted code. Another benefit is short
50 urls - e.g. <http://pastebin.com/333>
52 Since then it has found uses in many developer communities and has
53 been constantly improved.
67 rm public_html/legacy.php
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/lib/%{name}}
73 cp -a lib public_html $RPM_BUILD_ROOT%{_appdir}
75 # for file based posts storage
76 install -d $RPM_BUILD_ROOT/var/lib/%{name}
78 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
79 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
80 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
82 mv $RPM_BUILD_ROOT%{_appdir}/lib/config/* $RPM_BUILD_ROOT%{_sysconfdir}
83 rmdir $RPM_BUILD_ROOT%{_appdir}/lib/config
84 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/lib/config
86 %triggerin -- apache1 < 1.3.37-3, apache1-base
87 %webapp_register apache %{_webapp}
89 %triggerun -- apache1 < 1.3.37-3, apache1-base
90 %webapp_unregister apache %{_webapp}
92 %triggerin -- apache < 2.2.0, apache-base
93 %webapp_register httpd %{_webapp}
95 %triggerun -- apache < 2.2.0, apache-base
96 %webapp_unregister httpd %{_webapp}
98 %triggerin -- lighttpd
99 %webapp_register lighttpd %{_webapp}
101 %triggerun -- lighttpd
102 %webapp_unregister lighttpd %{_webapp}
105 rm -rf $RPM_BUILD_ROOT
108 %defattr(644,root,root,755)
109 %doc CHANGES INSTALL LICENCE README UPGRADE
110 %dir %attr(750,root,http) %{_sysconfdir}
111 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
112 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
113 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
114 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
117 %dir %attr(770,root,http) /var/lib/%{name}