rpms/pastebin/devel pastebin-README.fedora, NONE, 1.1 pastebin-config.inc.php.patch, NONE, 1.1 pastebin-default.conf.php.patch, NONE, 1.1 pastebin-layout.php.patch, NONE, 1.1 pastebin.conf, NONE, 1.1 pastebin.spec, NONE, 1.1 pastebin.sql, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Michael Stahnke (stahnma) fedora-extras-commits at redhat.com
Fri Jan 12 15:31:08 UTC 2007


Author: stahnma

Update of /cvs/extras/rpms/pastebin/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6844/devel

Modified Files:
	.cvsignore sources 
Added Files:
	pastebin-README.fedora pastebin-config.inc.php.patch 
	pastebin-default.conf.php.patch pastebin-layout.php.patch 
	pastebin.conf pastebin.spec pastebin.sql 
Log Message:
auto-import pastebin-0.50-3 on branch devel from pastebin-0.50-3.src.rpm


--- NEW FILE pastebin-README.fedora ---
Readme for pastebin on Fedora
------------------------------

I.   Database Setup
     Once you install pastebin, you need to setup the database connection.
     If you don't need any special modification, you should be able
     to simply run:
          mysql -u root -P < pastebin.sql
     You might need to change the user and host access in the SQL file.

II.  Web server Setup
     Apache is setup with a file /etc/httpd/conf.d/pastebin.conf which
     defaults to the URL being http://localhost/pastebin.  If this is not
     desirable, change it.

III. Edit /etc/pastebin/default.conf.php to include
     your email address, name, other settings and optionally Google
     ad-sense identifier.

IV.  Restart apache
          /sbin/service httpd restart

pastebin-config.inc.php.patch:

--- NEW FILE pastebin-config.inc.php.patch ---
--- config.inc.php	2006-04-28 04:36:48.000000000 -0500
+++ config.inc.php.good	2007-01-10 21:55:26.000000000 -0600
@@ -60,7 +60,24 @@
 //store the name of the subdomain (empty for "main" pastebin)
 $CONF['subdomain']=$subdomain;
 
+/**
+* how many elements in the base domain name? This is used to determine
+* what makes a "private" pastebin, i.e. for pastebin.com there are 2
+* elements 'pastebin' and 'com' - for pastebin.mysite.com there 3. Got it?
+* Good!
+*/
+
+/**
+* Compute base_domain_elements
+*/
+$_arr=count_chars($_SERVER['SERVER_NAME'], 1);
+$_num= $_arr['46']+1;
+$CONF['base_domain_elements']=$_num;
+unset($_arr);
+unset($_num);
+
+
 //pull in required database class
 require_once('pastebin/db.'.$CONF['dbsystem'].'.class.php');
 
-?>
\ No newline at end of file
+?>

pastebin-default.conf.php.patch:

--- NEW FILE pastebin-default.conf.php.patch ---
--- default.conf.php	2006-05-07 05:25:08.000000000 -0500
+++ default.conf.php.good	2007-01-10 22:00:27.000000000 -0600
@@ -52,7 +52,7 @@
 /**
 * Email address feedback should be sent to
 */
-$CONF['feedback_to']='lordelph at gmail.com';
+$CONF['feedback_to']='you at example.com';
 
 /**
 * Apparent sender address for feedback email
@@ -86,8 +86,7 @@
  * 3. if not using mod_rewrite, you'll need something more like this:
  *    $CONF['url_format']="/pastebin.php?show=%d";
  */
-$CONF['url_format']='/%d';
-
+$CONF['url_format']='/pastebin/%d';
 
 
 /**
@@ -100,7 +99,7 @@
 * to use / for even shorter urls if the main script
 * is renamed to index.php
 */
-$CONF['this_script']='/pastebin.php';
+$CONF['this_script']='/pastebin/pastebin.php';
 
 /**
 * what's the maximum number of posts we want to keep?
@@ -114,18 +113,11 @@
 $CONF['highlight_prefix']='@@';
 
 /**
-* how many elements in the base domain name? This is used to determine
-* what makes a "private" pastebin, i.e. for pastebin.com there are 2
-* elements 'pastebin' and 'com' - for pastebin.mysite.com there 3. Got it?
-* Good!
-*/
-$CONF['base_domain_elements']=2;
-
-
-/**
 * Google Adsense, clear this to remove ads. 
+* 
+* Disabled in Fedora Package
 */
-$CONF['google_ad_client']='pub-3281640380846080';
+// $CONF['google_ad_client']='pub-3281640380846080';
 
 
 /**
@@ -197,7 +189,7 @@
 * popular formats, listed first
 */
 $CONF['popular_syntax']=array(
-	'text','bash', 'c', 'cpp', 'html4strict',
+	'text','bash', 'c', 'cpp', 'diff', 'html4strict',
 	'java','javascript','php','perl', 'python', 'ruby', 'lua');
 
-?>
\ No newline at end of file
+?>

pastebin-layout.php.patch:

--- NEW FILE pastebin-layout.php.patch ---
--- layout.php	2006-05-07 05:30:24.000000000 -0500
+++ layout.php.good	2007-01-10 21:03:15.000000000 -0600
@@ -33,7 +33,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']))
 {
@@ -42,7 +42,7 @@
 	echo '</style>';
 }
 ?>
-<script type="text/javascript" src="/pastebin.js?ver=3"></script>
+<script type="text/javascript" src="pastebin.js?ver=3"></script>
 </head>
 
 
@@ -300,7 +300,7 @@
 		
 		echo "<span id=\"copytoclipboard\"></span>";
 		
-		echo "<a href=\"/\" title=\"make new post\">new post</a>";
+		echo "<a href=\"{$CONF['this_script']}\" title=\"make new post\">new post</a>";
 		
 		echo "</h1>";
 }


--- NEW FILE pastebin.conf ---
Alias /pastebin '/usr/share/pastebin/public_html'
<directory /usr/share/pastebin>
    php_value include_path .:/usr/share/pastebin/public_html:/usr/share/pastebin/lib
    php_value register_globals off
    DirectoryIndex pastebin.php
    RewriteEngine on
    RewriteBase /pastebin
    RewriteRule /([0-9]+) /pastebin/pastebin.php?show=$1
</directory>


--- NEW FILE pastebin.spec ---
Name:           pastebin 
Version:        0.50 
Release:        3%{?dist}
Summary:        A collaborative debugging tool 

Group:          Applications/Internet
License:        GPL 
URL:            http://pastebin.com/ 
Source0:        http://pastebin.com/pastebin.tar.gz 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source1:        pastebin-README.fedora
Source2:        pastebin.sql
Source3:        pastebin.conf
Patch0:         pastebin-default.conf.php.patch
Patch1:         pastebin-layout.php.patch
Patch2:         pastebin-config.inc.php.patch

Requires:       httpd, php-mysql
BuildArch:      noarch


%description
pastebin is here to help you collaborate on debugging code snippets. 
If you're not familiar with the idea, most people use it to submit a code
fragment to pastebin, getting a url like http://pastebin.com/1234 and then
link that URL in IRC or IM conversations.  This allows others to see your
code and optionally post changes. 

For information on setup see %{_docdir}/%{name}-%{version}/README.fedora

%prep
%setup -q
cp -p %{SOURCE1} README.fedora
cp -p %{SOURCE2} pastebin.sql
# Start patching
pushd lib/config
%patch0 -p0
popd
pushd public_html
%patch1 -p0
popd
pushd lib/pastebin
%patch2 -p0
popd

# Now fix DOS end of line
for file in `find . -type f`
do
   if (file $file | awk -F: '{print $2}' | grep -i text &> /dev/null) ; then
      sed -i 's/\r//g' $file
   fi
done


# Set permissions properly
find . -type f| xargs chmod 644 

%build
# Nothing to build

%install
rm -rf $RPM_BUILD_ROOT
# The httpd configuration file
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
install -p -m644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
# The actual PHP content
mkdir -p -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
mkdir -p -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/public_html
cp -pr lib $RPM_BUILD_ROOT%{_datadir}/%{name}/
cp -pr public_html $RPM_BUILD_ROOT%{_datadir}/%{name}/
# The configuration file in /etc
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/config/default.conf.php
install -p -m644 lib/config/default.conf.php \
        $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
ln -sf ../../../../..%{_sysconfdir}/%{name}/default.conf.php  \
        $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/config/default.conf.php 
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/geshi/geshi/css-gen.cfg
#Geshi Docs
ls $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/geshi/docs
cp -pr ./lib/geshi/docs geshi
cp -pr ./lib/geshi/contrib geshi/contrib
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/geshi/docs
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/geshi/contrib

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc CHANGES INSTALL LICENCE README UPGRADE README.fedora pastebin.sql 
%doc geshi/ 
%attr(755,root,root) %dir %{_sysconfdir}/%{name}
%attr (755,root,root) %dir /%{_datadir}/%{name}/
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/*
/%{_datadir}/%{name}/*


%changelog
* Thu Jan 12 2007 Michael Stahnke <mastahnke at gmail.com> - 0.50-3
- Fixed a few more issues suggested from review [Bug 222257]
- Preserve timestamps for upstream files
- Removed a few tabs that snuck in the spec file
- Moved all doc into %doc

* Thu Jan 12 2007 Michael Stahnke <mastahnke at gmail.com> - 0.50-2
- Fixed issues suggested from review [Bug 222257]

* Wed Jan 11 2007 Michael Stahnke <mastahnke at gmail.com> - 0.50-1
- Initial Packaging 


--- NEW FILE pastebin.sql ---
--Create databse in MySQL
CREATE database pastebin;


-- Create a user for Pastebin
grant all privileges on pastebin.* to 'pastebin'@'localhost' identified by 'banjo';
flush privileges;

-- Use pastebin database
use pastebin;

--Create table in MySQL
CREATE TABLE `pastebin` (
   `pid` int(11) NOT NULL auto_increment,
   `poster` varchar(16) default NULL,
   `posted` datetime default NULL,
   `code` text,
   `parent_pid` int(11) default '0',
   `format` varchar(16) default NULL,
   `codefmt` mediumtext,
   `codecss` text,
   `domain` varchar(255) default '',
   `expires` DATETIME,
   `expiry_flag` ENUM('d','m', 'f') NOT NULL DEFAULT 'm',
   PRIMARY KEY  (`pid`),
   KEY `domain` (`domain`)
   );


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/pastebin/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	12 Jan 2007 15:30:02 -0000	1.1
+++ .cvsignore	12 Jan 2007 15:30:38 -0000	1.2
@@ -0,0 +1 @@
+pastebin.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/pastebin/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	12 Jan 2007 15:30:02 -0000	1.1
+++ sources	12 Jan 2007 15:30:38 -0000	1.2
@@ -0,0 +1 @@
+d7b8993f4baed7753fb7c912b06725fb  pastebin.tar.gz




More information about the scm-commits mailing list