diff -r 1ff6f25dc4d9 -r 731574048d85 davical/davical.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/davical/davical.spec Mon Nov 22 12:39:58 2010 +0100 @@ -0,0 +1,204 @@ +## +## davical.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2010 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package version +%define V_opkg 0.9.9.3 +%define V_davical 0.9.9.3 +%define V_awl 0.37 + +# package information +Name: davical +Summary: CalDAV Server +URL: http://rscds.sourceforge.net/ +Vendor: Andrew McMillan +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Network +License: GPL +Version: %{V_opkg} +Release: 20100926 + +# package options +%define with_ssl no + +# list of sources +Source0: http://debian.mcmillan.net.nz/packages/davical/davical-%{V_davical}.tar.gz +Source1: http://debian.mcmillan.net.nz/packages/awl/awl_%{V_awl}.tar.gz +Source2: davical-config.php +Source3: davical-apache.conf +Source4: davical-setup.sh +Source5: rc.davical +Patch0: davical.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101 +PreReq: OpenPKG, openpkg >= 20100101 +PreReq: pcre, pcre::with_utf8 +PreReq: apache +%if "%{with_ssl}" == "yes" +PreReq: apache::with_mod_ssl = yes, x509 +%endif +PreReq: apache-php +PreReq: apache-php::with_pgsql = yes +PreReq: apache-php::with_gettext = yes +PreReq: postgresql + +%description + The DAViCal CalDAV Server is a repository for calendar, schedule, + todo and journal entries which may be accessed with CalDAV capable + client software. + +%track + prog davical:davical = { + version = %{V_davical} + url = http://debian.mcmillan.net.nz/packages/davical/ + regex = davical-(__VER__)\.tar\.gz + } + prog davical:awl = { + version = %{V_awl} + url = http://debian.mcmillan.net.nz/packages/awl/ + regex = awl_(__VER__)\.tar\.gz + } + +%prep + %setup -q -c + %setup -q -T -D -a 1 + %patch -p0 + +%build + +%install + # create installation hierarchy + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/sbin \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/etc/davical \ + $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical \ + $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl \ + $RPM_BUILD_ROOT%{l_prefix}/var/davical/db \ + $RPM_BUILD_ROOT%{l_prefix}/var/davical/run \ + $RPM_BUILD_ROOT%{l_prefix}/var/davical/log + + # install program components + find . -name "*.orig" -print | xargs rm -f + cp -r \ + awl-%{V_awl}/dba \ + awl-%{V_awl}/inc \ + $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl/ + rm -f davical-%{V_davical}/inc/always.php.in + %{l_shtool} subst %{l_value -s -a} \ + davical-%{V_davical}/inc/always.php + cp -r \ + davical-%{V_davical}/dba \ + davical-%{V_davical}/inc \ + davical-%{V_davical}/htdocs \ + $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical/ + + # install DAViCal application configuration file + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE davical-config.php} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/davical/ + + # install DAViCal Apache configuration file + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE davical-apache.conf} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/davical/ + + # install run-command script +%if "%{with_ssl}" == "yes" + with_ssl="-DSSL" +%else + with_ssl="" +%endif + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + -e "s;@with_ssl@;$with_ssl;" \ + %{SOURCE rc.davical} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install RDBMS setup script + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE davical-setup.sh} \ + $RPM_BUILD_ROOT%{l_prefix}/sbin/davical-setup + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %{l_prefix}/etc/davical/*' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical/*' + +%files -f files + +%clean + +%post + if [ $1 -eq 1 ]; then + # display final hints on initial installation + ( echo "1. To complete this installation of Drupal please start PostgreSQL" + echo " and initialize the DAViCal database like this:" + echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc postgresql start" + echo " \$ $RPM_INSTALL_PREFIX/sbin/davical-setup install" + echo "" + echo "2. By default, DAViCal runs its own SSL/TLS based Apache server" + echo " under 127.0.0.1, TCP port 8443. Please change this by editing" + echo " the \"Listen 127.0.0.1:8443\" directive in:" + echo " $RPM_INSTALL_PREFIX/etc/davical/davical-apache.conf" + echo "" + echo "3. Now start DAViCal by running the command" + echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc davical start" + echo " and connect with a browser to the URL" +%if "%{with_ssl}" == "yes" + echo " https://127.0.0.1:8443/" +%else + echo " https://127.0.0.1:8080/" +%endif + echo " and create user accounts." + echo "" + echo "4. Now you are able to subscribe to user \"example\"'s \"home\"" + echo " calendar with a CalDAV client through the URL" +%if "%{with_ssl}" == "yes" + echo " https://127.0.0.1:8443/caldav/example/home" +%else + echo " http://127.0.0.1:8080/caldav/example/home" +%endif + ) | %{l_rpmtool} msg -b -t notice + fi + if [ $1 -eq 2 ]; then + # after upgrade, restart service + eval `%{l_rc} davical status 2>/dev/null` + [ ".$davical_active" = .yes ] && %{l_rc} davical restart + fi + exit 0 + +%preun + if [ $1 -eq 0 ]; then + # before erase, stop service and remove log files + %{l_rc} davical stop 2>/dev/null + $RPM_INSTALL_PREFIX/sbin/davical-setup uninstall >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/davical/log/* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/davical/run/* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/davical/db/* >/dev/null 2>&1 || true + fi + exit 0 +