davical/davical.spec

Sun, 02 Sep 2012 18:18:43 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 02 Sep 2012 18:18:43 +0200
changeset 659
79e32993cb4d
parent 396
610cba0674b9
child 703
6e3df34ead39
permissions
-rw-r--r--

Introduce new version of tcpdump, reorder taglib and cryptbreaker to
the end because they fail to build on Linux, and correct flawed URLs
probably copied from the doxygen build entry.

michael@290 1 ##
michael@290 2 ## davical.spec -- OpenPKG RPM Package Specification
michael@290 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@290 4 ##
michael@290 5 ## Permission to use, copy, modify, and distribute this software for
michael@290 6 ## any purpose with or without fee is hereby granted, provided that
michael@290 7 ## the above copyright notice and this permission notice appear in all
michael@290 8 ## copies.
michael@290 9 ##
michael@290 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@290 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@290 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@290 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@290 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@290 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@290 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@290 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@290 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@290 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@290 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@290 21 ## SUCH DAMAGE.
michael@290 22 ##
michael@290 23
michael@290 24 # package version
michael@585 25 %define V_opkg 1.1.1
michael@585 26 %define V_davical 1.1.1
michael@585 27 %define V_awl 0.53
michael@290 28
michael@290 29 # package information
michael@290 30 Name: davical
michael@290 31 Summary: CalDAV Server
michael@290 32 URL: http://rscds.sourceforge.net/
michael@290 33 Vendor: Andrew McMillan
michael@290 34 Packager: OpenPKG Foundation e.V.
michael@290 35 Distribution: OpenPKG Community
michael@290 36 Class: EVAL
michael@290 37 Group: Network
michael@290 38 License: GPL
michael@290 39 Version: %{V_opkg}
michael@585 40 Release: 20120800
michael@290 41
michael@290 42 # package options
michael@290 43 %define with_ssl no
michael@290 44
michael@290 45 # list of sources
michael@290 46 Source0: http://debian.mcmillan.net.nz/packages/davical/davical-%{V_davical}.tar.gz
michael@302 47 Source1: http://debian.mcmillan.net.nz/packages/awl/awl-%{V_awl}.tar.gz
michael@290 48 Source2: davical-config.php
michael@290 49 Source3: davical-apache.conf
michael@290 50 Source4: davical-setup.sh
michael@290 51 Source5: rc.davical
michael@290 52 Patch0: davical.patch
michael@290 53
michael@290 54 # build information
michael@585 55 BuildPreReq: OpenPKG, openpkg >= 20100101
michael@585 56 PreReq: OpenPKG, openpkg >= 20100101
michael@290 57 PreReq: pcre, pcre::with_utf8
michael@585 58 PreReq: apache, apg
michael@290 59 %if "%{with_ssl}" == "yes"
michael@290 60 PreReq: apache::with_mod_ssl = yes, x509
michael@290 61 %endif
michael@290 62 PreReq: apache-php
michael@290 63 PreReq: apache-php::with_pgsql = yes
michael@290 64 PreReq: apache-php::with_gettext = yes
michael@302 65 PreReq: apache-php::with_iconv = yes
michael@361 66 PreReq: yaml, yaml::with_perl = yes
michael@361 67 PreReq: perl-dbi
michael@585 68 PreReq: perl-dbi::with_pgsql = yes
michael@290 69 PreReq: postgresql
michael@290 70
michael@290 71 %description
michael@290 72 The DAViCal CalDAV Server is a repository for calendar, schedule,
michael@585 73 todo, and journal entries. Its design allows for trivial storage of
michael@585 74 CalDAV calendars from clients such as Evolution, Sunbird/Lightning,
michael@585 75 Mulberry, iCal, iPhone, or SOHO Organizer. Calendar data is stored
michael@585 76 in a central location providing shared calendars, free/busy
michael@585 77 publication and a basic administration interface.
michael@290 78
michael@290 79 %track
michael@290 80 prog davical:davical = {
michael@290 81 version = %{V_davical}
michael@290 82 url = http://debian.mcmillan.net.nz/packages/davical/
michael@290 83 regex = davical-(__VER__)\.tar\.gz
michael@290 84 }
michael@290 85 prog davical:awl = {
michael@290 86 version = %{V_awl}
michael@290 87 url = http://debian.mcmillan.net.nz/packages/awl/
michael@396 88 regex = awl-(__VER__)\.tar\.gz
michael@290 89 }
michael@290 90
michael@290 91 %prep
michael@290 92 %setup -q -c
michael@290 93 %setup -q -T -D -a 1
michael@290 94 %patch -p0
michael@361 95 %{l_shtool} subst \
michael@361 96 -e 's;../awl/VERSION;../awl-%{V_awl}/VERSION;' \
michael@361 97 davical-%{V_davical}/scripts/build-always.sh
michael@290 98
michael@290 99 %build
michael@396 100 ln -s awl-%{V_awl} awl
michael@396 101 ( cd davical-%{V_davical}
michael@585 102 %{l_shtool} subst %{l_value -s -a} \
michael@585 103 inc/always.php.in \
michael@585 104 htdocs/always.php
michael@396 105 %{l_make} %{l_mflags} htdocs/always.php
michael@396 106 ) || exit $?
michael@290 107
michael@290 108 %install
michael@290 109 # create installation hierarchy
michael@290 110 %{l_shtool} mkdir -f -p -m 755 \
michael@290 111 $RPM_BUILD_ROOT%{l_prefix}/sbin \
michael@290 112 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@290 113 $RPM_BUILD_ROOT%{l_prefix}/etc/davical \
michael@290 114 $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical \
michael@290 115 $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl \
michael@290 116 $RPM_BUILD_ROOT%{l_prefix}/var/davical/db \
michael@290 117 $RPM_BUILD_ROOT%{l_prefix}/var/davical/run \
michael@290 118 $RPM_BUILD_ROOT%{l_prefix}/var/davical/log
michael@290 119
michael@290 120 # install program components
michael@290 121 find . -name "*.orig" -print | xargs rm -f
michael@585 122 # MSvB: Needed?
michael@585 123 # %{l_shtool} subst %{l_value -s -a} \
michael@585 124 # davical-%{V_davical}/htdocs/always.php
michael@290 125 cp -r \
michael@290 126 awl-%{V_awl}/dba \
michael@290 127 awl-%{V_awl}/inc \
michael@290 128 $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl/
michael@290 129 cp -r \
michael@290 130 davical-%{V_davical}/dba \
michael@290 131 davical-%{V_davical}/inc \
michael@290 132 davical-%{V_davical}/htdocs \
michael@290 133 $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical/
michael@290 134
michael@290 135 # install DAViCal application configuration file
michael@290 136 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@290 137 %{SOURCE davical-config.php} \
michael@290 138 $RPM_BUILD_ROOT%{l_prefix}/etc/davical/
michael@290 139
michael@290 140 # install DAViCal Apache configuration file
michael@396 141 l_hostname=`%{l_shtool} echo -e %h`
michael@396 142 l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
michael@290 143 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@396 144 -e "s;@l_hostname@;$l_hostname;g" \
michael@396 145 -e "s;@l_domainname@;$l_domainname;g" \
michael@290 146 %{SOURCE davical-apache.conf} \
michael@290 147 $RPM_BUILD_ROOT%{l_prefix}/etc/davical/
michael@290 148
michael@585 149 # install runcommand script
michael@290 150 %if "%{with_ssl}" == "yes"
michael@290 151 with_ssl="-DSSL"
michael@290 152 %else
michael@290 153 with_ssl=""
michael@290 154 %endif
michael@290 155 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@290 156 -e "s;@with_ssl@;$with_ssl;" \
michael@290 157 %{SOURCE rc.davical} \
michael@290 158 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@290 159
michael@290 160 # install RDBMS setup script
michael@290 161 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@290 162 %{SOURCE davical-setup.sh} \
michael@290 163 $RPM_BUILD_ROOT%{l_prefix}/sbin/davical-setup
michael@290 164
michael@361 165 # remove intermediate headers and other unused files
michael@361 166 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl/inc/*.in
michael@361 167 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical/inc/*.in
michael@361 168
michael@290 169 # determine installation files
michael@290 170 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@290 171 %{l_files_std} \
michael@396 172 '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/davical/*' \
michael@396 173 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/davical/*' \
michael@396 174 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/davical/*/*' \
michael@396 175 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/davical/*/*/*' \
michael@396 176 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/davical/*/*/*/*' \
michael@396 177 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/davical/*/*/*/*/*' \
michael@290 178 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical' \
michael@290 179 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical/*'
michael@290 180
michael@290 181 %files -f files
michael@290 182
michael@290 183 %clean
michael@290 184
michael@290 185 %post
michael@290 186 if [ $1 -eq 1 ]; then
michael@290 187 # display final hints on initial installation
michael@292 188 ( echo "1. To complete this installation of DAViCal please start"
michael@292 189 echo " PostgreSQL and initialize the DAViCal database like this:"
michael@290 190 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc postgresql start"
michael@290 191 echo " \$ $RPM_INSTALL_PREFIX/sbin/davical-setup install"
michael@290 192 echo ""
michael@396 193 %if "%{with_ssl}" == "yes"
michael@290 194 echo "2. By default, DAViCal runs its own SSL/TLS based Apache server"
michael@290 195 echo " under 127.0.0.1, TCP port 8443. Please change this by editing"
michael@290 196 echo " the \"Listen 127.0.0.1:8443\" directive in:"
michael@396 197 %else
michael@396 198 echo "2. By default, DAViCal runs its own Apache server"
michael@396 199 echo " under 127.0.0.1, TCP port 8080. Please change this by editing"
michael@396 200 echo " the \"Listen 127.0.0.1:8080\" directive in:"
michael@396 201 %endif
michael@290 202 echo " $RPM_INSTALL_PREFIX/etc/davical/davical-apache.conf"
michael@290 203 echo ""
michael@290 204 echo "3. Now start DAViCal by running the command"
michael@290 205 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc davical start"
michael@290 206 echo " and connect with a browser to the URL"
michael@290 207 %if "%{with_ssl}" == "yes"
michael@290 208 echo " https://127.0.0.1:8443/"
michael@290 209 %else
michael@290 210 echo " https://127.0.0.1:8080/"
michael@290 211 %endif
michael@290 212 echo " and create user accounts."
michael@290 213 echo ""
michael@290 214 echo "4. Now you are able to subscribe to user \"example\"'s \"home\""
michael@290 215 echo " calendar with a CalDAV client through the URL"
michael@290 216 %if "%{with_ssl}" == "yes"
michael@290 217 echo " https://127.0.0.1:8443/caldav/example/home"
michael@290 218 %else
michael@290 219 echo " http://127.0.0.1:8080/caldav/example/home"
michael@290 220 %endif
michael@290 221 ) | %{l_rpmtool} msg -b -t notice
michael@290 222 fi
michael@290 223 if [ $1 -eq 2 ]; then
michael@290 224 # after upgrade, restart service
michael@290 225 eval `%{l_rc} davical status 2>/dev/null`
michael@290 226 [ ".$davical_active" = .yes ] && %{l_rc} davical restart
michael@290 227 fi
michael@290 228 exit 0
michael@290 229
michael@290 230 %preun
michael@290 231 if [ $1 -eq 0 ]; then
michael@290 232 # before erase, stop service and remove log files
michael@290 233 %{l_rc} davical stop 2>/dev/null
michael@290 234 $RPM_INSTALL_PREFIX/sbin/davical-setup uninstall >/dev/null 2>&1 || true
michael@290 235 rm -f $RPM_INSTALL_PREFIX/var/davical/log/* >/dev/null 2>&1 || true
michael@290 236 rm -f $RPM_INSTALL_PREFIX/var/davical/run/* >/dev/null 2>&1 || true
michael@290 237 rm -f $RPM_INSTALL_PREFIX/var/davical/db/* >/dev/null 2>&1 || true
michael@290 238 fi
michael@290 239 exit 0
michael@290 240

mercurial