dovecot/dovecot.spec

Fri, 03 Aug 2012 15:16:43 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 03 Aug 2012 15:16:43 +0200
changeset 454
e99334bd789c
parent 239
d2e66a0e1aa8
child 608
09548e292fb1
permissions
-rw-r--r--

Resynchronize with upstream package maintainer version.

michael@148 1 ##
michael@148 2 ## dovecot.spec -- OpenPKG RPM Package Specification
michael@237 3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@148 4 ##
michael@148 5 ## Permission to use, copy, modify, and distribute this software for
michael@148 6 ## any purpose with or without fee is hereby granted, provided that
michael@148 7 ## the above copyright notice and this permission notice appear in all
michael@148 8 ## copies.
michael@148 9 ##
michael@148 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@148 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@148 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@148 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@148 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@148 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@148 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@148 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@148 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@148 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@148 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@148 21 ## SUCH DAMAGE.
michael@148 22 ##
michael@148 23
michael@243 24 # MSvB:
michael@243 25 # MSvB: Problem, dovecot is creating %{l_prefix}/var/lib
michael@243 26 # MSvB: ...and /opmi/var/dovecot/users/n ???
michael@243 27 # MSvB:
michael@243 28
michael@148 29 # package version
michael@237 30 %define V_major 1.2
michael@237 31 %define V_minor 6
michael@237 32 %define V_sieve_base 1.2
michael@237 33 %define V_sieve 0.1.13
michael@237 34 %define V_managesieve_base 1.2.6
michael@237 35 %define V_managesieve 0.11.9
michael@237 36 %define V_managesieved_base 1.2
michael@237 37 %define V_managesieved 0.11.9
michael@148 38
michael@148 39 # package information
michael@148 40 Name: dovecot
michael@148 41 Summary: IMAP4 & POP3 Server
michael@148 42 URL: http://www.dovecot.org/
michael@148 43 Vendor: Timo Sirainen et al.
michael@148 44 Packager: OpenPKG Foundation e.V.
michael@148 45 Distribution: OpenPKG Community
michael@148 46 Class: EVAL
michael@148 47 Group: Mail
michael@148 48 License: MIT+LGPL
michael@148 49 Version: %{V_major}.%{V_minor}
michael@239 50 Release: 20091104
michael@148 51
michael@148 52 # package options
michael@148 53 %option with_fsl yes
michael@148 54 %option with_pam yes
michael@237 55 %option with_sieve yes
michael@237 56 %option with_managesieve yes
michael@148 57 %option with_ldap no
michael@148 58 %option with_mysql no
michael@148 59 %option with_pgsql no
michael@148 60 %option with_sqlite no
michael@148 61
michael@148 62 # list of sources
michael@148 63 Source0: http://www.dovecot.org/releases/%{V_major}/dovecot-%{V_major}.%{V_minor}.tar.gz
michael@237 64 Source1: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_sieve_base}-sieve-%{V_sieve}.tar.gz
michael@237 65 Source2: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}.tar.gz
michael@204 66 Source3: fsl.dovecot
michael@204 67 Source4: rc.dovecot
michael@237 68 Source5: dovecot.conf
michael@148 69 Patch0: dovecot.patch
michael@237 70 Patch1: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_managesieve_base}-managesieve-%{V_managesieve}.diff.gz
michael@148 71
michael@148 72 # build information
michael@148 73 Prefix: %{l_prefix}
michael@148 74 BuildRoot: %{l_buildroot}
michael@148 75 BuildPreReq: OpenPKG, openpkg >= 20060823
michael@237 76 PreReq: OpenPKG, openpkg >= 20060823, MTA, x509
michael@148 77 BuildPreReq: libiconv, openssl
michael@148 78 PreReq: libiconv, openssl
michael@148 79 %if "%{with_fsl}" == "yes"
michael@148 80 BuildPreReq: fsl
michael@148 81 PreReq: fsl
michael@148 82 %endif
michael@148 83 %if "%{with_ldap}" == "yes"
michael@148 84 BuildPreReq: openldap
michael@148 85 PreReq: openldap
michael@148 86 %endif
michael@148 87 %if "%{with_managesieve}" == "yes"
michael@148 88 BuildPreReq: gettext
michael@148 89 PreReq: gettext
michael@148 90 %endif
michael@148 91 %if "%{with_pam}" == "yes"
michael@148 92 BuildPreReq: PAM
michael@148 93 PreReq: PAM
michael@148 94 %endif
michael@148 95 %if "%{with_mysql}" == "yes"
michael@148 96 BuildPreReq: mysql, zlib
michael@148 97 PreReq: mysql, zlib
michael@148 98 %endif
michael@148 99 %if "%{with_pgsql}" == "yes"
michael@148 100 BuildPreReq: postgresql
michael@148 101 PreReq: postgresql
michael@148 102 %endif
michael@148 103 %if "%{with_sqlite}" == "yes"
michael@148 104 BuildPreReq: sqlite
michael@148 105 PreReq: sqlite
michael@148 106 %endif
michael@148 107 AutoReq: no
michael@148 108 AutoReqProv: no
michael@148 109
michael@148 110 %description
michael@148 111 Dovecot is an Open Source IMAP and POP3 server, written with
michael@148 112 security primarily in mind. Dovecot is an excellent choice for both
michael@148 113 small and large installations. It's fast, simple to set up, requires
michael@148 114 no special administration and it uses very little memory.
michael@148 115
michael@148 116 %track
michael@148 117 prog dovecot = {
michael@148 118 version = %{V_major}.%{V_minor}
michael@148 119 url = http://www.dovecot.org/download.html
michael@237 120 regex = dovecot-(__VER__)\.tar\.gz
michael@148 121 }
michael@148 122 prog dovecot:sieve = {
michael@237 123 version = %{V_sieve}
michael@237 124 url = http://www.rename-it.nl/dovecot/%{V_major}/
michael@237 125 regex = dovecot-%{V_sieve_base}-sieve-(__VER__)\.tar\.gz
michael@237 126 }
michael@237 127 prog dovecot:managesieved = {
michael@237 128 version = %{V_managesieved}
michael@237 129 url = http://www.rename-it.nl/dovecot/%{V_major}/
michael@237 130 regex = dovecot-%{V_managesieved_base}-managesieve-(__VER__)\.tar\.gz
michael@148 131 }
michael@148 132 prog dovecot:managesieve = {
michael@148 133 version = %{V_managesieve}
michael@148 134 url = http://www.rename-it.nl/dovecot/%{V_major}/
michael@237 135 regex = dovecot-%{V_managesieve_base}-managesieve-(__VER__)\.diff\.gz
michael@148 136 }
michael@148 137
michael@148 138 %prep
michael@148 139 %setup -q
michael@148 140 %if "%{with_sieve}" == "yes"
michael@148 141 %setup -q -T -D -a 1
michael@148 142 %endif
michael@204 143 %if "%{with_managesieve}" == "yes"
michael@204 144 %setup -q -T -D -a 2
michael@204 145 %{l_gzip} -dc <%{PATCH1} | %{l_patch} -p1 -b
michael@204 146 %endif
michael@148 147 %{l_sed} <%{PATCH0} %{l_value -s -a} | %{l_patch} -p0 -b
michael@204 148
michael@204 149 %build
michael@148 150 cppflags="%{l_cppflags}"
michael@148 151 ldflags="%{l_ldflags} %{l_fsl_ldflags}"
michael@148 152 libs="%{l_fsl_libs}"
michael@148 153 sql_drivers=""
michael@148 154 %if "%{with_ldap}" == "yes"
michael@148 155 libs="$libs -llber -lssl -lcrypto"
michael@148 156 %endif
michael@148 157 %if "%{with_mysql}" == "yes"
michael@148 158 cppflags="$cppflags %{l_cppflags mysql}"
michael@148 159 ldflags="$ldflags %{l_ldflags mysql}"
michael@148 160 sql_drivers="$sql_drivers,mysql"
michael@148 161 %endif
michael@148 162 %if "%{with_pgsql}" == "yes"
michael@148 163 libs="$libs -lssl -lcrypto -lcrypt"
michael@148 164 sql_drivers="$sql_drivers,pgsql"
michael@148 165 %endif
michael@148 166 %if "%{with_sqlite}" == "yes"
michael@148 167 sql_drivers="$sql_drivers,sqlite"
michael@148 168 %endif
michael@148 169 sql_drivers=`echo "$sql_drivers" | sed 's;^,;;'`
michael@148 170
michael@148 171 CC="%{l_cc}" \
michael@148 172 CFLAGS="%{l_cflags -O}" \
michael@148 173 CPPFLAGS="$cppflags" \
michael@148 174 LDFLAGS="$ldflags" \
michael@148 175 LIBS="$libs" \
michael@148 176 ./configure \
michael@148 177 --prefix=%{l_prefix} \
michael@237 178 --mandir=%{l_prefix}/man \
michael@148 179 --sysconfdir=%{l_prefix}/etc/dovecot \
michael@148 180 --with-ssldir=%{l_prefix}/etc/dovecot/ssl \
michael@148 181 --datadir=%{l_prefix}/share/dovecot \
michael@148 182 --docdir=%{l_prefix}/share/dovecot/doc \
michael@148 183 --with-rundir=%{l_prefix}/var/dovecot/run \
michael@239 184 --with-statedir=%{l_prefix}/var/dovecot/dat \
michael@148 185 --with-libiconv-prefix=%{l_prefix} \
michael@148 186 --with-ssl=openssl \
michael@148 187 --with-docs \
michael@148 188 %if "%{with_ldap}" == "yes"
michael@148 189 --with-ldap \
michael@148 190 %else
michael@148 191 --without-ldap \
michael@148 192 %endif
michael@148 193 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes"
michael@148 194 --with-sql \
michael@148 195 --with-sql-drivers="$sql_drivers" \
michael@148 196 %if "%{with_mysql}" == "yes"
michael@148 197 --with-mysql \
michael@148 198 %else
michael@148 199 --without-mysql \
michael@148 200 %endif
michael@148 201 %if "%{with_pgsql}" == "yes"
michael@148 202 --with-pgsql \
michael@148 203 %else
michael@148 204 --without-pgsql \
michael@148 205 %endif
michael@148 206 %if "%{with_sqlite}" == "yes"
michael@148 207 --with-sqlite \
michael@148 208 %else
michael@148 209 --without-sqlite \
michael@148 210 %endif
michael@148 211 %else
michael@148 212 --without-sql \
michael@148 213 --without-sql-drivers \
michael@148 214 --without-mysql \
michael@148 215 --without-pgsql \
michael@148 216 --without-sqlite \
michael@148 217 %endif
michael@148 218 %if "%{with_pam}" == "yes"
michael@148 219 --with-pam \
michael@148 220 %else
michael@148 221 --without-pam \
michael@148 222 %endif
michael@148 223 --without-gc \
michael@148 224 --without-gssapi \
michael@148 225 --without-lucene \
michael@237 226 --without-vpopmail \
michael@237 227 --disable-static
michael@148 228 %{l_make} %{l_mflags -O}
michael@148 229
michael@148 230 %if "%{with_sieve}" == "yes"
michael@148 231 # build optional Dovecot LDA sieve plugin
michael@237 232 ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve}
michael@148 233 CC="%{l_cc}" \
michael@148 234 CFLAGS="%{l_cflags -O}" \
michael@148 235 CPPFLAGS="%{l_cppflags}" \
michael@148 236 LDFLAGS="%{l_ldflags}" \
michael@148 237 ./configure \
michael@148 238 --prefix=%{l_prefix} \
michael@237 239 --mandir=%{l_prefix}/man \
michael@237 240 --with-dovecot=`pwd`/..
michael@148 241 %{l_make} %{l_mflags -O}
michael@148 242 ) || exit $?
michael@148 243 %endif
michael@204 244 %if "%{with_managesieve}" == "yes"
michael@237 245 # build optional Dovecot LDA managesieve daemon
michael@237 246 ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}
michael@204 247 CC="%{l_cc}" \
michael@204 248 CFLAGS="%{l_cflags -O}" \
michael@204 249 CPPFLAGS="%{l_cppflags}" \
michael@204 250 LDFLAGS="%{l_ldflags}" \
michael@204 251 ./configure \
michael@204 252 --prefix=%{l_prefix} \
michael@237 253 --mandir=%{l_prefix}/man \
michael@237 254 --with-dovecot-sieve=`pwd`/../dovecot-%{V_sieve_base}-sieve-%{V_sieve} \
michael@237 255 --with-dovecot=`pwd`/..
michael@204 256 %{l_make} %{l_mflags -O}
michael@204 257 ) || exit $?
michael@204 258 %endif
michael@204 259
michael@148 260 %install
michael@148 261 rm -rf $RPM_BUILD_ROOT
michael@239 262 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@148 263
michael@148 264 %if "%{with_sieve}" == "yes"
michael@148 265 # install optional Dovecot LDA sieve plugin
michael@237 266 ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve}
michael@239 267 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@148 268 ) || exit $?
michael@148 269 %endif
michael@204 270 %if "%{with_managesieve}" == "yes"
michael@237 271 # install optional Dovecot LDA managesieve daemon
michael@237 272 ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}
michael@239 273 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@204 274 ) || exit $?
michael@204 275 %endif
michael@204 276
michael@148 277 # create additional dirctories
michael@148 278 %{l_shtool} mkdir -f -p -m 755 \
michael@148 279 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \
michael@239 280 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/dat \
michael@148 281 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \
michael@148 282 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login
michael@148 283
michael@239 284 # install runcommand script
michael@148 285 %{l_shtool} mkdir -f -p -m 755 \
michael@148 286 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@148 287 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@148 288 %{SOURCE rc.dovecot} \
michael@148 289 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@148 290
michael@148 291 # strip installation
michael@237 292 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/dovecot*example.conf
michael@148 293 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \
michael@148 294 >/dev/null 2>&1 || true
michael@239 295 rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/auth \
michael@239 296 $RPM_BUILD_ROOT%{l_prefix}/include/dovecot \
michael@239 297 $RPM_BUILD_ROOT%{l_prefix}/include \
michael@239 298 >/dev/null 2>&1 || true
michael@148 299 strip \
michael@148 300 $RPM_BUILD_ROOT%{l_prefix}/sbin/* \
michael@148 301 $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \
michael@148 302 >/dev/null 2>&1 || true
michael@148 303
michael@237 304 # install default server configuration
michael@237 305 %{l_shtool} mkdir -f -p -m 755 \
michael@237 306 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot
michael@239 307 %{l_shtool} install -c -m 640 %{l_value -s -a} \
michael@237 308 %{SOURCE dovecot.conf} \
michael@237 309 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/
michael@237 310
michael@237 311 # install OSSP fsl configuration
michael@237 312 %{l_shtool} mkdir -f -p -m 755 \
michael@237 313 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@237 314 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@237 315 %{SOURCE fsl.dovecot} \
michael@237 316 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@237 317
michael@148 318 # generate file list
michael@148 319 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
michael@148 320 '%not %dir %{l_prefix}/etc/fsl' \
michael@148 321 '%config %{l_prefix}/etc/fsl/fsl.dovecot' \
michael@148 322 '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \
michael@239 323 '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \
michael@148 324 '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \
michael@239 325 '%dir %attr(0755,%{l_musr},%{l_mgrp}) %{l_prefix}/var/dovecot' \
michael@239 326 '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/dat' \
michael@239 327 '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \
michael@239 328 '%dir %attr(0750,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/run' \
michael@239 329 '%dir %attr(0750,%{l_musr},%{l_ngrp}) %{l_prefix}/var/dovecot/run/login' \
michael@148 330 '%doc %{l_prefix}/share/dovecot/doc' \
michael@148 331 '%doc %{l_prefix}/share/dovecot/doc/wiki'
michael@148 332
michael@148 333 %files -f files
michael@148 334
michael@148 335 %clean
michael@148 336 rm -rf $RPM_BUILD_ROOT
michael@148 337
michael@148 338 %post
michael@148 339 # after upgrade, restart service
michael@148 340 [ $1 -eq 2 ] || exit 0
michael@148 341 eval `%{l_rc} dovecot status 2>/dev/null`
michael@148 342 [ ".$dovecot_active" = .yes ] && %{l_rc} dovecot restart
michael@148 343 exit 0
michael@148 344
michael@148 345 %preun
michael@148 346 # before erase, stop service and remove log files
michael@148 347 [ $1 -eq 0 ] || exit 0
michael@148 348 %{l_rc} dovecot stop 2>/dev/null
michael@148 349 rm -f $RPM_INSTALL_PREFIX/var/dovecot/* >/dev/null 2>&1 || true
michael@239 350 rm -f $RPM_INSTALL_PREFIX/var/dovecot/dat/* >/dev/null 2>&1 || true
michael@148 351 rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/* >/dev/null 2>&1 || true
michael@148 352 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/* >/dev/null 2>&1 || true
michael@148 353 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true
michael@148 354 exit 0
michael@148 355

mercurial