Fri, 24 Apr 2009 15:32:30 +0200
Import package vendor original specs for necessary manipulations.
1 ##
2 ## imap.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package version
25 %define V_here 2007e
26 %define V_real 2007e
27 %define V_subdir 2007e
29 # package information
30 Name: imap
31 Summary: The IMAP Library
32 URL: http://www.washington.edu/imap/
33 Vendor: University of Washington
34 Packager: OpenPKG Foundation e.V.
35 Distribution: OpenPKG Community
36 Class: BASE
37 Group: Mail
38 License: University of Washington's Free-Fork License
39 Version: %{V_here}
40 Release: 20081218
42 # package options
43 %option with_ssl yes
44 %option with_pam no
45 %option with_daemons no
46 %option with_mbxdef no
47 %option with_annotate no
49 # list of sources
50 # (ping p@rdus.de if the Kolab patches are unavailable for the latest IMAP version)
51 Source0: ftp://ftp.cac.washington.edu/imap/imap-%{V_real}.tar.Z
52 Patch0: imap.patch
53 Patch1: http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/imap/KOLAB_imap-c-client_2006j2_Annotations.patch
55 # build information
56 Prefix: %{l_prefix}
57 BuildRoot: %{l_buildroot}
58 BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
59 PreReq: OpenPKG, openpkg >= 20040130
60 %if "%{with_pam}" == "yes"
61 BuildPreReq: PAM
62 PreReq: PAM
63 %endif
64 %if "%{with_ssl}" == "yes"
65 BuildPreReq: openssl
66 PreReq: openssl
67 %endif
68 AutoReq: no
69 AutoReqProv: no
70 %if "%{with_daemons}" == "yes"
71 Conflicts: imaputils
72 %endif
74 %description
75 The IMAP library provides a C API for IMAP client access.
76 It optionally contains the UW IMAP/POP3 daemons, too.
78 %track
79 prog imap = {
80 version = %{V_real}
81 url = ftp://ftp.cac.washington.edu/imap/
82 regex = imap-(\d+[a-z]?\d?)\.tar\.Z
83 }
85 %prep
86 %setup -q -n imap-%{V_subdir}
87 %patch -p0
88 %if "%{with_annotate}" == "yes"
89 %patch -p1 -P 1
90 %endif
92 %build
93 mflags="%{l_mflags}"
94 cflags="%{l_cflags}"
95 ldflags="%{l_ldflags}"
96 %if "%{with_pam}" == "yes"
97 case "%{l_platform -t}" in
98 *-sunos* ) pamtype=pmb ;;
99 * ) pamtype=pam ;;
100 esac
101 mflags="$mflags PASSWDTYPE=$pamtype"
102 cflags="$cflags -I`%{l_rc} --query pam_incdir`"
103 ldflags="$ldflags -L`%{l_rc} --query pam_libdir`"
104 %endif
105 %if "%{with_mbxdef}" == "yes"
106 mflags="$mflags CREATEPROTO=mbxproto"
107 %endif
108 %if "%{with_ssl}" == "yes"
109 cflags="%{l_cppflags openssl .} $cflags"
110 mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
111 %else
112 mflags="$mflags SSLTYPE=none"
113 %endif
114 case "%{l_platform -t}" in
115 *-freebsd* ) os=bsf ;;
116 *-linux* ) os=slx ;;
117 *-sunos* ) os=gso ;;
118 *-netbsd* ) os=neb ;;
119 *-irix* ) os=gsg ;;
120 *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
121 esac
122 mflags="$mflags $os"
123 %{l_make} $mflags \
124 EXTRACFLAGS="$cflags" \
125 EXTRALDFLAGS="$ldflags"
127 %install
128 rm -rf $RPM_BUILD_ROOT
129 %{l_shtool} mkdir -f -p -m 755 \
130 $RPM_BUILD_ROOT%{l_prefix}/include/imap \
131 $RPM_BUILD_ROOT%{l_prefix}/lib
132 %{l_shtool} install -c -m 644 \
133 c-client/*.h \
134 c-client/linkage.c \
135 $RPM_BUILD_ROOT%{l_prefix}/include/imap/
136 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
137 %{l_shtool} install -c -m 644 c-client/c-client.a \
138 $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
139 %if "%{with_daemons}" == "yes"
140 %{l_shtool} mkdir -f -p -m 755 \
141 $RPM_BUILD_ROOT%{l_prefix}/bin \
142 $RPM_BUILD_ROOT%{l_prefix}/sbin \
143 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
144 $RPM_BUILD_ROOT%{l_prefix}/man/man8
145 %{l_shtool} install -c -m 755 \
146 tmail/tmail dmail/dmail mailutil/mailutil \
147 $RPM_BUILD_ROOT%{l_prefix}/bin/
148 %{l_shtool} install -c -m 755 \
149 imapd/imapd ipopd/ipop3d \
150 $RPM_BUILD_ROOT%{l_prefix}/sbin/
151 %{l_shtool} install -c -m 644 \
152 src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
153 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
154 %{l_shtool} install -c -m 644 \
155 src/imapd/imapd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
156 %{l_shtool} install -c -m 644 \
157 src/ipopd/ipopd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
158 %endif
160 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
162 %files -f files
164 %clean
165 rm -rf $RPM_BUILD_ROOT