Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > 7d0d48e7990cef72b180bd549a3aa9dc > files > 18

WebCalendar-1.2.1-1.fc13.src.rpm

%define		basepath	%{_datadir}/%{name}
%define		manualVersion	0.9.43

#	The main tarball in this package is a downgraded version of the
#		upstream tarball, because of menu icon license issues.
#	To rebuild it from upstream tarball, submit the following commands:
#
# wget									\
#  "http://downloads.sourceforge.net/webcalendar/WebCalendar-%{version}.tar.gz"
# tar xzf WebCalendar-%{version}.tar.gz 
# rm -rf WebCalendar-%{version}/includes/menu/icons
# tar czf WebCalendar-%{version}-clean.tar.gz WebCalendar-%{version}/
#
#	Upstream tarball MD5 sum:
#		f349ad32a09a76db0526fb27016842fe  WebCalendar-1.2.1.tar.gz
#
#	Source tarball WebCalendar-1.2.0-newmenuicons.tar.gz is Fedora-
#		specific and thus, has no "upstream".

Name:		WebCalendar
Summary:	Single/multi-user web-based calendar application
Version:	1.2.1
Release:	1%{?dist}
License:	GPLv2
Group:		Applications/Internet
Source0:	WebCalendar-%{version}-clean.tar.gz
Source1:	WebCalendar-1.2.0-newmenuicons.tar.gz
Source2:	http://downloads.sourceforge.net/webcalendar/WebCalendarUserManual-%{manualVersion}.tar.gz
Source3:	WebCalendar-http.conf
Source4:	WebCalendar-taglang.php
Patch1:		WebCalendar-1.2.0-newmenuicons.patch
Patch2:		WebCalendar-1.2.0-extmenu.patch
Patch3:		WebCalendar-1.2.0-extcaptcha.patch
Patch4:		WebCalendar-1.2.0-deftimezone.patch
Patch5:		WebCalendar-1.2.0-reset_reminder.patch
Patch6:		WebCalendar-1.2.0-offsetdays.patch
Patch7:		WebCalendar-1.2.0-approve.patch
Patch8:		WebCalendar-1.2.0-httpauthpub.patch
Patch9:		WebCalendar-1.2.0-eventstatus.patch
Patch10:	WebCalendar-1.2.0-php53.patch
Patch11:	WebCalendar-1.2.0-daylightbug.patch
Patch12:	WebCalendar-1.2.0-viewothers.patch
Patch13:	WebCalendar-1.2.1-usercase.patch
URL:		http://www.k5n.us/webcalendar.php
Requires:	webserver
Requires:	php >= 4.1.0
Requires:	php-gd php_database
Requires:	php-hkit php-PHPMailer php-captchaphp
Requires:	JSCookMenu
BuildRequires:	php-cli
Buildarch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

%description
  WebCalendar is a PHP-based calendar application that can be configured as a
single-user calendar, a multi-user calendar for groups of users, or as an
event calendar viewable by visitors. MySQL, PostgreSQL, Oracle, DB2,
Interbase, MS SQL Server, or ODBC is required.
  WebCalendar can be setup in a variety of ways, such as...
	* A schedule management system for a single person
	* A schedule management system for a group of people, allowing one or
	  more assistants to manage the calendar of another user
	* An events schedule that anyone can view, allowing visitors to submit
	  new events
	* A calendar server that can be viewed with iCal-compliant calendar
	  applications like Mozilla Sunbird, Apple iCal or GNOME Evolution or
	  RSS-enabled applications like Firefox, Thunderbird, RSSOwl, or
	  FeedDemon, or BlogExpress.


#-------------------------------------------------------------------------------
%prep
#-------------------------------------------------------------------------------

%setup -q

#	Install the new menu icons.  WARNING: do not dissociate "newmenuicons"
#		patch and tarball.

%setup -q -D -T -a 1
%patch1 -p 1

#	Install the manual.

%setup -q -D -T -a 2
mv WebCalendar*/docs/* docs/

#	Unbundle JSCookMenu.

%patch2 -p 1
rm -rf includes/menu/JSCookMenu.js

#	Unbundle Captcha PHP.

%patch3 -p 1
rm -rf includes/classes/captcha

#	Apply other fixes.

%patch4 -p 1
%patch5 -p 1
%patch6 -p 1
%patch7 -p 1
%patch8 -p 1
%patch9 -p 1
%patch10 -p 1
%patch11 -p 1
%patch12 -p 1
%patch13 -p 1


#-------------------------------------------------------------------------------
%build
#-------------------------------------------------------------------------------

#	There are some scripts with shebang referencing /usr/local/bin.
#	In a normal installation, processors are in %{_bindir}.

set +e
find . -type f | while read file
do	line=`head -n 1 "${file}" | grep '^#![	 ]*/usr/local/bin/'`
	if [ "${line}" ]
	then sed -i -e "1s#/usr/local/bin#%{_bindir}#" "${file}"
	fi
done


#-------------------------------------------------------------------------------
%install
#-------------------------------------------------------------------------------

rm -rf "${RPM_BUILD_ROOT}"

#	install directories.

install -d -m 755 "${RPM_BUILD_ROOT}/%{basepath}"

for DIR in docs icons images includes install themes tools translations ws
do	cp -a "${DIR}" "${RPM_BUILD_ROOT}/%{basepath}/${DIR}"
done

#	Install files.

install -p -m 644 *.php "${RPM_BUILD_ROOT}/%{basepath}/"
install -p -m 644 UPGRADING.html "${RPM_BUILD_ROOT}/%{basepath}/"
install -p -m 644 AUTHORS "${RPM_BUILD_ROOT}/%{basepath}/"

#	Replace bundled libraries by external ones.

(
	cd "${RPM_BUILD_ROOT}/%{basepath}/includes/classes/hKit"
	rm -rf hkit.class.php
	ln -s "%{_datadir}/php/hkit/hkit.class.php" .
)

(
	cd "${RPM_BUILD_ROOT}/%{basepath}/includes/classes/phpmailer"
	rm -rf class.phpmailer.php
	ln -s "%{_datadir}/php/PHPMailer/class.phpmailer.php" .
	rm -rf class.smtp.php
	ln -s "%{_datadir}/php/PHPMailer/class.smtp.php" .
)


#	Remove *.orig file created by patches.

find "${RPM_BUILD_ROOT}/%{basepath}" -name '*.orig' -print0 | xargs -0 -r rm -f

#	Fix permissions.

find "${RPM_BUILD_ROOT}%{basepath}" -type f -print0 | xargs -0 -r chmod ugo-x
find "${RPM_BUILD_ROOT}%{basepath}/tools" -type f -name '*.php' -print0	|
	xargs -0 -r chmod ugo+x
find "${RPM_BUILD_ROOT}%{basepath}/tools" -type f -name '*.pl' -print0	|
	xargs -0 -r chmod ugo+x

#	Process the configuration files.

install -p -m 644 includes/settings.php.orig				\
	"${RPM_BUILD_ROOT}/%{basepath}/includes/"
install -d -m 755 "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
cp -a "${RPM_BUILD_ROOT}/%{basepath}/includes/settings.php.orig"	\
	"${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/settings.php"
ln -s "%{_sysconfdir}/%{name}/settings.php"				\
	"${RPM_BUILD_ROOT}%{basepath}/includes/settings.php"
mv "${RPM_BUILD_ROOT}/%{basepath}/includes/site_extras.php"		\
	"${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/"
ln -s "%{_sysconfdir}/%{name}/site_extras.php"				\
	"${RPM_BUILD_ROOT}%{basepath}/includes/site_extras.php"

#	Install Apache configuration file.

install -d "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d"
sed 's#@BASEPATH@#%{basepath}#g' < "%{SOURCE3}"				\
	> "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/%{name}.conf"

#	Install cron file for reminders.

install -d "${RPM_BUILD_ROOT}%{_sysconfdir}/cron.d"
cat > "${RPM_BUILD_ROOT}%{_sysconfdir}/cron.d/%{name}" <<'EOF'

#	Send WebCalendar reminders.
#
#	Uncomment the next line to enable it (every minute).

# * * * * * apache cd %{basepath}/tools; sleep 30; %{_bindir}/php -d magic_quotes_gpc=0 send_reminders.php
EOF


#	Generate base path file list, tagging translation files.

(
	cd "${RPM_BUILD_ROOT}%{basepath}"
	find . -type d | sed -e "s#^\.#%dir %{basepath}#"
	find . -type f | sed -e "s#^\.#%{basepath}#" | php "%{SOURCE4}"
	find . ! \( -type d -o -type f \) | sed -e "s#^\.#%{basepath}#"
) > basepath.filelist


#-------------------------------------------------------------------------------
%clean
#-------------------------------------------------------------------------------

rm -rf "${RPM_BUILD_ROOT}"


#-------------------------------------------------------------------------------
%files -f basepath.filelist
#-------------------------------------------------------------------------------

%defattr(-, root, root, -)
%doc AUTHORS NEWS
%doc GPL.html README.html
%attr(775, root, apache) %dir %{_sysconfdir}/%{name}
%attr(660, root, apache) %config(noreplace) %ghost %{_sysconfdir}/%{name}/settings.php
%config(noreplace) %{_sysconfdir}/%{name}/site_extras.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*
%config(noreplace) %{_sysconfdir}/cron.d/%{name}


#-------------------------------------------------------------------------------
%changelog
#-------------------------------------------------------------------------------

* Wed Jul  7 2010 Patrick Monnerat <pm@datasphere.ch> 1.2.1-1
- New upstream version.
- Patch "php53" to get rid of PHP 5.3 deprecated features.
  https://sourceforge.net/tracker/?func=detail&aid=2873491&group_id=3870&atid=303870
- Patch "daylightbug" to fix day offset by one when crossing daylight saving
  active/inactive date.
  https://sourceforge.net/tracker/?func=detail&aid=2877076&group_id=3870&atid=303870
- Patch "viewothers" to allow viewing other users calendar when access control
  is off.
  https://sourceforge.net/tracker/?func=detail&aid=2880387&group_id=3870&atid=303870
- Include AUTHORS in product directory too: needed by the "about" box.

* Fri Aug 14 2009 Patrick Monnerat <pm@datasphere.ch> 1.2.0-8
- Use a custom source tarball to get rid of upstream icons with license issue.

* Fri Aug 14 2009 Patrick Monnerat <pm@datasphere.ch> 1.2.0-7
- Patch and tarball "newmenuicons" to replace menu icons that have an unclear
  license.
- Upstream patch references added.

* Tue Jun 23 2009 Patrick Monnerat <pm@datasphere.ch> 1.2.0-6
- Patch "eventstatus" to allow rejecting an accepted event.
  https://sourceforge.net/tracker/?func=detail&aid=2809120&group_id=3870&atid=303870
- Replace "ed" by "sed -i" in build script to get rid of ed requirement.
- Tag translation files.
- Relocate external classes to the proper subdirectories.

* Fri Jun  5 2009 Patrick Monnerat <pm@datasphere.ch> 1.2.0-5
- Patch "approve" to fix event invitation approval.
  https://sourceforge.net/tracker/?func=detail&aid=2801019&group_id=3870&atid=303870
- Use the hKit class from an external package.
- Use the PHPMailer class from an external package.
- Path "httpauthpub" to accept unconfigured http authenticated user for
  public access. https://sourceforge.net/tracker/?func=detail&aid=2802940&group_id=3870&atid=303870
- Patch "extcaptcha" to use a new version of class captchaphp from an
  external package.
- Patch "extmenu" to use a new version of JSCookMenu from an external package.

* Mon Jan 26 2009 Patrick Monnerat <pm@datasphere.ch> 1.2.0-4
- Path "offsetdays" to ignore offset days in daily repetitions.
  https://sourceforge.net/tracker/?func=detail&aid=2537718&group_id=3870&atid=103870

* Fri Dec  5 2008 Patrick Monnerat <pm@datasphere.ch> 1.2.0-3
- Patch "reset_reminder" to reset reminder upon entry change.
  https://sourceforge.net/tracker/?func=detail&aid=2393257&group_id=3870&atid=303870

* Wed Nov 12 2008 Patrick Monnerat <pm@datasphere.ch> 1.2.0-2
- Patch "nolangwarn" to suppress mb_language() warning.
  https://sourceforge.net/forum/forum.php?thread_id=2692495&forum_id=11588
- Patch "weektimebar" to properly display week timebar view.
  https://sourceforge.net/tracker/?func=detail&aid=2261841&group_id=3870&atid=303870
- Patch "deftimezone" to enable configuration of default client timezone.
  https://sourceforge.net/tracker/?func=detail&aid=2269623&group_id=3870&atid=303870

* Fri Nov  7 2008 Patrick Monnerat <pm@datasphere.ch> 1.2.0-1
- Initial packaging.
- Patch "usercase" to add username case-insensitive flag in configuration.
  https://sourceforge.net/tracker/?func=detail&aid=1425442&group_id=3870&atid=303870
- Patch "shebang" to add a missing shebang in a PHP script.
  https://sourceforge.net/tracker/?func=detail&aid=2261885&group_id=3870&atid=303870