packages: pastebin/apache.conf (NEW), pastebin/config.patch (NEW), pastebin...
glen
glen at pld-linux.org
Sat Mar 10 13:09:01 CET 2012
Author: glen Date: Sat Mar 10 12:09:01 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- original pastebin, with some fixes
---- Files affected:
packages/pastebin:
apache.conf (NONE -> 1.1) (NEW), config.patch (NONE -> 1.1) (NEW), fixes.patch (NONE -> 1.1) (NEW), layout.patch (NONE -> 1.1) (NEW), lighttpd.conf (NONE -> 1.1) (NEW), pastebin.spec (NONE -> 1.1) (NEW), postdir.patch (NONE -> 1.1) (NEW), system-geshi.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/pastebin/apache.conf
diff -u /dev/null packages/pastebin/apache.conf:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/apache.conf Sat Mar 10 13:08:55 2012
@@ -0,0 +1,11 @@
+Alias /pastebin/ /usr/share/pastebin/public_html/
+<Directory /usr/share/pastebin/public_html>
+ php_value include_path .:/usr/share/php:/usr/share/pastebin/lib
+ DirectoryIndex pastebin.php
+
+# RewriteEngine on
+# RewriteRule /([a-z0-9]+) /pastebin.php?show=$1
+
+ AllowOverride None
+ Allow from all
+</Directory>
================================================================
Index: packages/pastebin/config.patch
diff -u /dev/null packages/pastebin/config.patch:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/config.patch Sat Mar 10 13:08:55 2012
@@ -0,0 +1,69 @@
+--- pastebin-0.60/lib/config/default.conf.php 2012-03-10 14:00:39.605878805 +0200
++++ pastebin/lib/config/default.conf.php 2012-03-10 14:06:33.734096378 +0200
+@@ -51,25 +51,25 @@
+ /**
+ * Email address feedback should be sent to
+ */
+-$CONF['feedback_to']='lordelph at gmail.com';
++$CONF['feedback_to']='nobody at example.org';
+
+ /**
+ * Apparent sender address for feedback email
+ */
+-$CONF['feedback_sender']='pastebin.com <no-reply at pastebin.com>';
++$CONF['feedback_sender']='pastebin <nobody at example.org>';
+
+ /**
+ * database type - can be file or mysql
+ */
+-$CONF['dbsystem']='mysql';
++$CONF['dbsystem']='file';
+
+ /**
+ * db credentials
+ */
+ $CONF['dbhost']='localhost';
+ $CONF['dbname']='pastebin';
+-$CONF['dbuser']='pastebin';
+-$CONF['dbpass']='banjo';
++$CONF['dbuser']='mysql';
++$CONF['dbpass']='';
+
+ /**
+ * format of urls to pastebin entries - %d is the placeholder for
+@@ -85,21 +85,20 @@
+ * 3. if not using mod_rewrite, you'll need something more like this:
+ * $CONF['url_format']="/pastebin.php?show=%s";
+ */
+-$CONF['url_format']='/%s';
+-
++$CONF['url_format']='/pastebin/?show=%s';
+
+
+ /**
+ * default expiry time d (day) m (month) or f (forever)
+ */
+-$CONF['default_expiry']='m';
++$CONF['default_expiry']='f';
+
+ /**
+ * this is the path to the script - you may want to
+ * to use / for even shorter urls if the main script
+ * is renamed to index.php
+ */
+-$CONF['this_script']='/pastebin.php';
++$CONF['this_script']='pastebin.php';
+
+ /**
+ * what's the maximum number of posts we want to keep?
+@@ -123,8 +122,9 @@
+
+ /**
+ * Google Adsense, clear this to remove ads.
++* $CONF['google_ad_client']='pub-3281640380846080';
+ */
+-$CONF['google_ad_client']='pub-3281640380846080';
++$CONF['google_ad_client']='';
+
+ /**
+ * maintainer mode enables some code used to aid translation - unless you
================================================================
Index: packages/pastebin/fixes.patch
diff -u /dev/null packages/pastebin/fixes.patch:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/fixes.patch Sat Mar 10 13:08:55 2012
@@ -0,0 +1,11 @@
+--- pastebin/public_html/pastebin.php~ 2012-03-10 14:00:39.000000000 +0200
++++ pastebin/public_html/pastebin.php 2012-03-10 14:01:24.527766825 +0200
+@@ -89,7 +89,7 @@
+
+ function t($str)
+ {
+- //global $CONF;
++ global $CONF;
+
+ //if in maintainance mode, record this string in the translation db
+ if ($CONF['maintainer_mode'])
================================================================
Index: packages/pastebin/layout.patch
diff -u /dev/null packages/pastebin/layout.patch:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/layout.patch Sat Mar 10 13:08:55 2012
@@ -0,0 +1,20 @@
+--- pastebin/public_html/layout.php~ 2007-07-10 18:22:37.000000000 +0300
++++ pastebin/public_html/layout.php 2012-03-10 13:57:42.208423209 +0200
+@@ -34,7 +34,7 @@
+ <head>
+ <title><?php echo $page['title'] ?></title>
+ <meta name="ROBOTS" content="NOARCHIVE"/>
+-<link rel="stylesheet" type="text/css" media="screen" href="/pastebin.css?ver=4" />
++<link rel="stylesheet" type="text/css" media="screen" href="pastebin.css?ver=4" />
+
+ <?php if (isset($page['post']['codecss']))
+ {
+@@ -43,7 +43,7 @@
+ echo '</style>';
+ }
+ ?>
+-<script type="text/javascript" src="/pastebin.js?ver=3"></script>
++<script type="text/javascript" src="pastebin.js?ver=3"></script>
+ </head>
+
+
================================================================
Index: packages/pastebin/lighttpd.conf
diff -u /dev/null packages/pastebin/lighttpd.conf:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/lighttpd.conf Sat Mar 10 13:08:55 2012
@@ -0,0 +1,3 @@
+alias.url += (
+ "/pastebin/" => "/usr/share/pastebin/public_html/",
+)
================================================================
Index: packages/pastebin/pastebin.spec
diff -u /dev/null packages/pastebin/pastebin.spec:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/pastebin.spec Sat Mar 10 13:08:55 2012
@@ -0,0 +1,128 @@
+# $Revision$, $Date$
+%define php_min_version 5.0.0
+%include /usr/lib/rpm/macros.php
+Summary: Package that uses webapps configuration
+Name: pastebin
+Version: 0.60
+Release: 0.8
+License: Affero GPL licence
+Group: Applications/WWW
+Source0: http://%{name}.dixo.net/pastebin.tar.gz
+# Source0-md5: c73c4b40e8eeddba9b515586f017a777
+Patch0: postdir.patch
+Patch1: system-geshi.patch
+Patch2: layout.patch
+Patch3: fixes.patch
+Patch4: config.patch
+Source1: apache.conf
+Source2: lighttpd.conf
+URL: http://blog.dixo.net/downloads/
+BuildRequires: rpmbuild(macros) >= 1.553
+Requires: php-common >= 4:%{php_min_version}
+Requires: php-date
+Requires: php-geshi >= 1.0.7
+Requires: php-pcre
+Requires: webapps
+Requires: webserver(access)
+Requires: webserver(alias)
+Suggests: php-mysql
+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}
+
+# bad depsolver
+%define _noautopear pear
+
+# exclude optional php dependencies
+%define _noautophp php-mysql
+
+# put it together for rpmbuild
+%define _noautoreq %{?_noautophp} %{?_noautopear}
+
+%description
+This tool was orignally designed to enable collaborative code review
+via the #php IRC channel. Inspired by www.parseerror.com/paste, but
+more streamlined and capable of allowing collabation via IRC by
+allowing easy modification of posted code. Another benefit is short
+urls - e.g. <http://pastebin.com/333>
+
+Since then it has found uses in many developer communities and has
+been constantly improved.
+
+%prep
+%setup -q
+%undos -f php
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+rm -rf lib/geshi
+
+# legacy
+rm public_html/legacy.php
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/lib/%{name}}
+
+cp -a lib public_html $RPM_BUILD_ROOT%{_appdir}
+
+# for file based posts storage
+install -d $RPM_BUILD_ROOT/var/lib/%{name}
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
+
+mv $RPM_BUILD_ROOT%{_appdir}/lib/config/* $RPM_BUILD_ROOT%{_sysconfdir}
+rmdir $RPM_BUILD_ROOT%{_appdir}/lib/config
+ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/lib/config
+
+%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}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES INSTALL LICENCE README UPGRADE
+%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
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
+%{_appdir}
+
+%dir %attr(770,root,http) /var/lib/%{name}
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2012/03/10 12:08:55 glen
+- original pastebin, with some fixes
+
================================================================
Index: packages/pastebin/postdir.patch
diff -u /dev/null packages/pastebin/postdir.patch:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/postdir.patch Sat Mar 10 13:08:55 2012
@@ -0,0 +1,11 @@
+--- pastebin/lib/pastebin/db.file.class.php~ 2012-03-10 13:51:05.000000000 +0200
++++ pastebin/lib/pastebin/db.file.class.php 2012-03-10 13:51:08.331870883 +0200
+@@ -59,7 +59,7 @@
+ function DB()
+ {
+
+- $this->postdir=$_SERVER['DOCUMENT_ROOT'].'/../posts/';
++ $this->postdir = '/var/lib/pastebin/';
+ if (!is_writable($this->postdir)) die("{$this->postdir} needs to be a writable dir to use file storage engine");
+
+
================================================================
Index: packages/pastebin/system-geshi.patch
diff -u /dev/null packages/pastebin/system-geshi.patch:1.1
--- /dev/null Sat Mar 10 13:09:01 2012
+++ packages/pastebin/system-geshi.patch Sat Mar 10 13:08:55 2012
@@ -0,0 +1,29 @@
+--- ./public_html/./pastebin.php~ 2007-07-10 17:57:12.000000000 +0300
++++ ./public_html/./pastebin.php 2012-03-10 13:58:09.986257287 +0200
+@@ -27,7 +27,7 @@
+ // includes
+ //
+ require_once('pastebin/config.inc.php');
+-require_once('geshi/geshi.php');
++require_once('geshi.php');
+ require_once('pastebin/diff.class.php');
+ require_once('pastebin/pastebin.class.php');
+
+--- ./public_html/./translate.php~ 2007-07-10 18:45:42.000000000 +0300
++++ ./public_html/./translate.php 2012-03-10 13:58:17.486572502 +0200
+@@ -27,7 +27,7 @@
+ // includes
+ //
+ require_once('pastebin/config.inc.php');
+-require_once('geshi/geshi.php');
++require_once('geshi.php');
+ require_once('pastebin/diff.class.php');
+ require_once('pastebin/pastebin.class.php');
+
+@@ -144,4 +144,4 @@
+
+
+
+-
+\ No newline at end of file
++
================================================================
More information about the pld-cvs-commit
mailing list