rpms/phpTodo/devel phpTodo-0.8.1beta.patch, NONE, 1.1 phpTodo.httpd.conf, NONE, 1.1 phpTodo.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Marc Bradshaw (deebs) fedora-extras-commits at redhat.com
Mon Sep 24 22:49:37 UTC 2007


Author: deebs

Update of /cvs/pkgs/rpms/phpTodo/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv770/devel

Modified Files:
	.cvsignore sources 
Added Files:
	phpTodo-0.8.1beta.patch phpTodo.httpd.conf phpTodo.spec 
Log Message:
new package


phpTodo-0.8.1beta.patch:

--- NEW FILE phpTodo-0.8.1beta.patch ---
diff -urN phpTodo-0.8.1beta.orig/doc/sql/todo.sql phpTodo-0.8.1beta/doc/sql/todo.sql
--- phpTodo-0.8.1beta.orig/doc/sql/todo.sql	2007-03-07 04:58:04.000000000 +1100
+++ phpTodo-0.8.1beta/doc/sql/todo.sql	2007-09-22 20:00:22.000000000 +1000
@@ -26,7 +26,7 @@
                           password        CHAR(40)                NOT NULL,
                           admin           TINYINT     UNSIGNED    NOT NULL DEFAULT 0,
                           full_name       CHAR(40),
-                          email           CHAR(320)               NOT NULL,
+                          email           CHAR(255)               NOT NULL,
                           PRIMARY KEY     (id),
                           UNIQUE          (username),
                           INDEX           (password));
@@ -150,4 +150,4 @@
 INSERT INTO user_prefs VALUES (NULL, 1, 0, 0, 0, 0, 0, 0, 'none', 'asc');
 
 # Change the following line to reflect the correct user, host, database name, and password
-GRANT insert, update, delete, select ON phpTodo.* TO phpTodo at localhost IDENTIFIED BY 'password';
+# GRANT insert, update, delete, select ON phpTodo.* TO phpTodo at localhost IDENTIFIED BY 'password';
diff -urN phpTodo-0.8.1beta.orig/feed.php phpTodo-0.8.1beta/feed.php
--- phpTodo-0.8.1beta.orig/feed.php	2007-04-07 03:54:16.000000000 +1000
+++ phpTodo-0.8.1beta/feed.php	2007-09-20 19:07:45.000000000 +1000
@@ -52,8 +52,19 @@
    if (! $feed_param = feed_authenticate($user_id, $feed_id, $secret)) {
       // Set up the channel with info indicating an invalid feed
       $feed->title = 'Invalid RSS Feed';
-      $feed->link = 'http://' . $_SERVER['SERVER_NAME'] .
-                        $phpTodo_serverpath . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'];
+
+      // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+      $location = 'http';
+      if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+      $location .= '://'.$_SERVER['SERVER_NAME'];
+      if ( isset($_SERVER['HTTPS'])) {
+         if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+      } else {
+         if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+      }
+      $location .= $phpTodo_serverpath . $_SERVER['REQUEST_URI'];
+      $feed->link = $location;
+
       $feed->description = 'phpTodo Version ' . $phpTodo_version . "\n" .
                         'Auto-generated RSS feed' . "\n" . $phpTodo_homepage;
 
@@ -73,8 +84,19 @@
 
    // Set up the channel
    $feed->title = $feed_param->name . ' - phpTodo RSS Feed';
-   $feed->link = 'http://' . $_SERVER['SERVER_NAME'] .
-                     $_SERVER['REQUEST_URI'];
+
+   // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+   $location = 'http';
+   if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+   $location .= '://'.$_SERVER['SERVER_NAME'];
+   if ( isset($_SERVER['HTTPS'])) {
+      if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   } else {
+      if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   }
+   $location .= $_SERVER['REQUEST_URI'];
+   $feed->link = $location;
+
    $feed->description = 'phpTodo Version ' . $phpTodo_version . "\n" .
                      'Auto-generated RSS feed' . "\n" . $phpTodo_homepage;
 
@@ -161,8 +183,19 @@
       # Take the data and put it into the rss object
       $item = new FeedItem();
       $item->title = "$feedSubject ($priority)";
-      $item->link = 'http://' . $_SERVER['SERVER_NAME'] . $phpTodo_serverpath .
-                    "taskmodify.php?edit=Edit&task_id=$id";
+
+      // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+      $location = 'http';
+      if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+      $location .= '://'.$_SERVER['SERVER_NAME'];
+      if ( isset($_SERVER['HTTPS'])) {
+         if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+      } else {
+         if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+      }
+      $location .= $phpTodo_serverpath ."taskmodify.php?edit=Edit&task_id=$id";
+      $item->link = $location;
+
       $item->description = nl2br("$feedDesc");
       $item->date = "$create_date $itemTZOffset";
       $item->source = '';
diff -urN phpTodo-0.8.1beta.orig/index.php phpTodo-0.8.1beta/index.php
--- phpTodo-0.8.1beta.orig/index.php	2007-04-07 03:54:16.000000000 +1000
+++ phpTodo-0.8.1beta/index.php	2007-09-20 19:07:45.000000000 +1000
@@ -58,8 +58,19 @@
       if (isset($_SESSION['redirect'])) {
          header('Location: ' . $_SESSION['redirect']);
       } else {
-         header('Location: http://' . $_SERVER['HTTP_HOST'] .
-                dirname($_SERVER['PHP_SELF']) . '/todolist.php');
+
+         // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+         $location = 'http';
+         if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+         $location .= '://'.$_SERVER['HTTP_HOST'];
+         if ( isset($_SERVER['HTTPS'])) {
+            if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+         } else {
+            if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+         }
+         $location .= dirname($_SERVER['PHP_SELF']) . '/todolist.php';
+         header('Location: ' . $location);
+
       }
       unset($_SESSION['redirect']);
 
diff -urN phpTodo-0.8.1beta.orig/libs/sec_check.php phpTodo-0.8.1beta/libs/sec_check.php
--- phpTodo-0.8.1beta.orig/libs/sec_check.php	2007-03-07 04:58:04.000000000 +1100
+++ phpTodo-0.8.1beta/libs/sec_check.php	2007-09-20 19:07:45.000000000 +1000
@@ -164,15 +164,35 @@
       }
    }
 
-   $_SESSION['redirect'] = 'http://' . $_SERVER['HTTP_HOST'] .
-                           dirname($_SERVER['PHP_SELF']) . '/';
+
+   // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+   $location = 'http';
+   if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+   $location .= '://'.$_SERVER['HTTP_HOST'];
+   if ( isset($_SERVER['HTTPS'])) {
+      if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   } else {
+      if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   }
+   $location .= dirname($_SERVER['PHP_SELF']) . '/';
+   $_SESSION['redirect'] = $location;
 
    if (isset($redirect)) {
        $_SESSION['redirect'] .= $redirect;
    }
 
-   header('Location: http://' . $_SERVER['HTTP_HOST'] .
-          dirname($_SERVER['PHP_SELF']) . '/index.php');
+   // bugfix for https and/or non standard ports - Marc Bradshaw <marc at marcbradshaw.co.uk>
+   $location = 'http';
+   if ( isset($_SERVER['HTTPS'])) { $location .= 's'; }
+   $location .= '://'.$_SERVER['HTTP_HOST'];
+   if ( isset($_SERVER['HTTPS'])) {
+      if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   } else {
+      if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } 
+   }
+   $location .= dirname($_SERVER['PHP_SELF']) . '/index.php';
+   header('Location: ' . $location);
+
 }
 
 ?>
diff -urN phpTodo-0.8.1beta.orig/sample_config.php phpTodo-0.8.1beta/sample_config.php
--- phpTodo-0.8.1beta.orig/sample_config.php	2007-04-07 04:17:12.000000000 +1000
+++ phpTodo-0.8.1beta/sample_config.php	2007-09-20 20:48:51.000000000 +1000
@@ -21,20 +21,35 @@
 // The work directory contains all of the private
 // smarty data.  This directory should be below the
 // httpd root
-$phpTodo_work_dir = '/path/to/private/phptodo';
+$phpTodo_work_dir = '/var/cache/phpTodo';
 
 // The http directory is the first level directory
 // where the phpTodo distribution was uncompressed
-$phpTodo_http_dir = '/path/to/public/phptodo';
+$phpTodo_http_dir = '/usr/share/phpTodo';
 
 // The smarty directory is the location of the Smarty.class.php file
-$phpTodo_smarty_dir = 'smarty/';
+// F7 Smarty builds are in /usr/share/php/Smarty/
+// FC6 and earlier Smarty builds are in /usr/share/Smarty/ instead.
+// We will default to F7 but check for a class file in the FC6 location
+// You may edit this to a single line pointing to the locaton of your Smarty
+// install to save a couple of cycles if you wish.
+$phpTodo_smarty_dir = '/usr/share/php/Smarty/';
+if (file_exists("/usr/share/Smarty/Smarty.class.php"))
+{
+	$phpTodo_smarty_dir = "/usr/share/Smarty/";
+}
 
 // This is the default stylesheet used by phpTodo
 // The location of the stylesheet is relative to
 // the http directory
 $phpTodo_stylesheet = 'css/default.css';
 
+
+// The following line **MUST** be removed from the config file
+// once the database has been setup and configured.
+header("Content-type: text/plain");die("Welcome to phpTodo - Web based todo lists\n\nPlease setup and configure the database and edit the\n/etc/phpTodo/config.php configuration file.\n\nInstructions for setting up the database can be found\nin the ##DOCLOCATION##/INSTALL file.\n\nThe SQL required for setting up the database can be found\nin the ##DOCLOCATION##/sql/ directory.");
+
+
 // This is the name of the phpTodo database
 $phpTodo_dbName = 'phpTodo';
 
@@ -47,6 +62,7 @@
 // This is the password for the database
 $phpTodo_dbPass = 'password';
 
+
 // Default session time (in seconds)
 $phpTodo_sessTime = 600;
 


--- NEW FILE phpTodo.httpd.conf ---
#
# phpTodo is a to do list manager written in PHP.
#

Alias /phpTodo /usr/share/phpTodo


--- NEW FILE phpTodo.spec ---
Summary: PHP todo list manager
Name: phpTodo
Version: 0.8.1
Release: 0.8.beta%{?dist}
License: GPLv2+
URL: http://phptodo.godshell.com/
Group: Applications/Internet
Source0: http://downloads.sourceforge.net/phptodo/%{name}-%{version}beta.tar.gz
Source1: phpTodo.httpd.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: phpTodo-0.8.1beta.patch
BuildArch: noarch
BuildRequires: gettext
Requires: httpd
Requires: php-Smarty
Requires: php-mysql
Requires(post): policycoreutils
Requires(postun): policycoreutils
# to make sure the "apache" group is created before phpTodo is installed

%description
The general idea behind this program is to keep all of your todo lists in
one central location.  I've grown very tired of having lists all over the
place and being unable to reconcile them...

%prep
%setup -qn %{name}-%{version}beta
%patch1 -p1
sed -i -r "s|##DOCLOCATION##|%{_datadir}/doc/%{name}-%{version}|g" sample_config.php
# Rearrange the documentation
cp sample_config.php doc/
chmod 755 doc/selenium
chmod 755 doc/sql
chmod 755 libs
chmod 755 templates
chmod 755 css
chmod 755 images


%install
rm -rf %{buildroot}
mkdir -p -m0755 %{buildroot}%{_sysconfdir}/phpTodo
mkdir -p -m0755 %{buildroot}%{_localstatedir}/cache/phpTodo
mkdir -p -m0755 %{buildroot}%{_localstatedir}/cache/phpTodo/templates_c
mkdir -p -m0755 %{buildroot}%{_localstatedir}/cache/phpTodo/cache
mkdir -p -m0755 %{buildroot}%{_localstatedir}/cache/phpTodo/config
mkdir -p -m0755 %{buildroot}%{_datadir}/phpTodo
mv sample_config.php config.php
install -m 0644 config.php %{buildroot}%{_sysconfdir}/phpTodo/
ln -s ../../../..%{_sysconfdir}/phpTodo/config.php \
    %{buildroot}%{_datadir}/phpTodo/config.php
install -m 0644 index.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 about.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 datetimepicker.js %{buildroot}%{_datadir}/phpTodo/
install -m 0644 feed.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 logout.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 prefs.js %{buildroot}%{_datadir}/phpTodo/
install -m 0644 prefs.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 taskedit.js %{buildroot}%{_datadir}/phpTodo/
install -m 0644 taskmodify.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 todolist.js %{buildroot}%{_datadir}/phpTodo/
install -m 0644 todolist.php %{buildroot}%{_datadir}/phpTodo/
install -m 0644 users.js %{buildroot}%{_datadir}/phpTodo/
install -m 0644 users.php %{buildroot}%{_datadir}/phpTodo/
for d in css images libs templates; do
    cp -rp $d %{buildroot}%{_datadir}/phpTodo/
done

mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/phpTodo.conf


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root)
%doc doc/*
%config %dir %{_sysconfdir}/phpTodo
%attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/phpTodo/*.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/phpTodo.conf
%attr(0700, apache, apache) %dir %{_localstatedir}/cache/phpTodo
%attr(0700, apache, apache) %dir %{_localstatedir}/cache/phpTodo/templates_c
%attr(0700, apache, apache) %dir %{_localstatedir}/cache/phpTodo/cache
%attr(0700, apache, apache) %dir %{_localstatedir}/cache/phpTodo/config
%{_datadir}/phpTodo


%post
# SELinux probably needs work.
# Set SELinux file context in the policy
semanage fcontext -a -t httpd_sys_content_t '%{_datadir}/phpTodo(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_content_t '%{_sysconfdir}/phpTodo(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_content_t '%{_localstatedir}/cache/phpTodo(/.*)?' 2>/dev/null || :
# Actually change the context
restorecon -R %{_datadir}/phpTodo/ || :
restorecon -R %{_sysconfdir}/phpTodo/ || :
restorecon -R %{_localstatedir}/cache/phpTodo/ || :


%postun
# SELinux support
if [ $1 -eq 0 ]; then  # final removal
  semanage fcontext -d -t httpd_sys_content_t '%{_datadir}/phpTodo(/.*)?' 2>/dev/null || :
  semanage fcontext -d -t httpd_sys_content_t '%{_sysconfdir}/phpTodo(/.*)?' 2>/dev/null || :
  semanage fcontext -d -t httpd_sys_content_t '%{_localstatedir}/cache/phpTodo(/.*)?' 2>/dev/null || :
fi


%changelog
* Sat Sep 22 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.8.beta%{?dist}
- SELinux changes
- Improved initial mysql schema

* Thu Sep 20 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.7.beta%{?dist}
- Updated location of Smarty for F7 rpm
- Added more useful message to be displayed when user has not configured
- or setup database before using phpTodo.

* Mon Aug 13 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.6.beta%{?dist}
- Updated license field re new guidelines

* Sun Jun 17 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.5.beta
- sourceforge mirror changed to downloads.sourceforge.net

* Tue Jun 05 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.4.beta
- SELinux post section added

* Tue May 29 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.3.beta
- Cleanup of SPEC file

* Sat Apr 28 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.2.beta
- Cleanup of SPEC file

* Thu Apr 10 2007 Marc Bradshaw <fedora at marcbradshaw.co.uk> 0.8.1-0.1.beta
- Initial release


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/phpTodo/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	24 Sep 2007 16:14:45 -0000	1.1
+++ .cvsignore	24 Sep 2007 22:49:02 -0000	1.2
@@ -0,0 +1 @@
+phpTodo-0.8.1beta.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/phpTodo/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	24 Sep 2007 16:14:45 -0000	1.1
+++ sources	24 Sep 2007 22:49:02 -0000	1.2
@@ -0,0 +1 @@
+81293fbc69d691fb897fc007f8502efe  phpTodo-0.8.1beta.tar.gz




More information about the fedora-extras-commits mailing list