Sun, 29 May 2011 16:29:06 +0200
Update, correct, improve build configuration and packaging logic.
Update to new version of vendor software, bump copyright date, remove implicit
gcc dependency, add comments for Trolltech bug tracking, correct enforced
dynamic library linkage, and install mysterious process stub binary.
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: 20091030
42 # package options
43 %option with_ssl yes
44 %option with_pam no
45 %option with_daemons no
46 %option with_mbxdef no
48 # list of sources
49 Source0: ftp://ftp.cac.washington.edu/imap/imap-%{V_real}.tar.Z
50 Patch0: imap.patch
52 # build information
53 Prefix: %{l_prefix}
54 BuildRoot: %{l_buildroot}
55 BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
56 PreReq: OpenPKG, openpkg >= 20040130
57 %if "%{with_pam}" == "yes"
58 BuildPreReq: PAM
59 PreReq: PAM
60 %endif
61 %if "%{with_ssl}" == "yes"
62 BuildPreReq: openssl
63 PreReq: openssl
64 %endif
65 AutoReq: no
66 AutoReqProv: no
67 %if "%{with_daemons}" == "yes"
68 Conflicts: imaputils
69 %endif
71 %description
72 The IMAP library provides a C API for IMAP client access.
73 It optionally contains the UW IMAP/POP3 daemons, too.
75 %track
76 prog imap = {
77 version = %{V_real}
78 url = ftp://ftp.cac.washington.edu/imap/
79 regex = imap-(\d+[a-z]?\d?)\.tar\.Z
80 }
82 %prep
83 %setup -q -n imap-%{V_subdir}
84 %patch -p0
86 %build
87 mflags="%{l_mflags}"
88 cflags="%{l_cflags}"
89 ldflags="%{l_ldflags}"
90 %if "%{with_pam}" == "yes"
91 case "%{l_platform -t}" in
92 *-sunos* ) pamtype=pmb ;;
93 * ) pamtype=pam ;;
94 esac
95 mflags="$mflags PASSWDTYPE=$pamtype"
96 cflags="$cflags -I`%{l_rc} --query pam_incdir`"
97 ldflags="$ldflags -L`%{l_rc} --query pam_libdir`"
98 %endif
99 %if "%{with_mbxdef}" == "yes"
100 mflags="$mflags CREATEPROTO=mbxproto"
101 %endif
102 %if "%{with_ssl}" == "yes"
103 cflags="%{l_cppflags openssl .} $cflags"
104 mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
105 mflags="$mflags SSLCERTS=%{l_prefix}/etc/openssl/certs"
106 mflags="$mflags SSLKEYS=%{l_prefix}/etc/openssl/private"
107 mflags="$mflags SSLINCLUDE=%{l_prefix}/include"
108 mflags="$mflags SSLLIB=%{l_prefix}/lib"
109 %else
110 mflags="$mflags SSLTYPE=none"
111 %endif
112 case "%{l_platform -t}" in
113 *-freebsd* ) os=bsf ;;
114 *-linux* ) os=slx ;;
115 *-sunos* ) os=gso ;;
116 *-netbsd* ) os=neb ;;
117 *-irix* ) os=gsg ;;
118 *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
119 esac
120 mflags="$mflags $os"
121 %{l_make} $mflags \
122 EXTRACFLAGS="$cflags" \
123 EXTRALDFLAGS="$ldflags"
125 %install
126 rm -rf $RPM_BUILD_ROOT
127 %{l_shtool} mkdir -f -p -m 755 \
128 $RPM_BUILD_ROOT%{l_prefix}/include/imap \
129 $RPM_BUILD_ROOT%{l_prefix}/lib
130 %{l_shtool} install -c -m 644 \
131 c-client/*.h \
132 c-client/linkage.c \
133 $RPM_BUILD_ROOT%{l_prefix}/include/imap/
134 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
135 %{l_shtool} install -c -m 644 c-client/c-client.a \
136 $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
137 %if "%{with_daemons}" == "yes"
138 %{l_shtool} mkdir -f -p -m 755 \
139 $RPM_BUILD_ROOT%{l_prefix}/bin \
140 $RPM_BUILD_ROOT%{l_prefix}/sbin \
141 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
142 $RPM_BUILD_ROOT%{l_prefix}/man/man8
143 %{l_shtool} install -c -m 755 \
144 tmail/tmail dmail/dmail mailutil/mailutil \
145 $RPM_BUILD_ROOT%{l_prefix}/bin/
146 %{l_shtool} install -c -m 755 \
147 imapd/imapd ipopd/ipop3d \
148 $RPM_BUILD_ROOT%{l_prefix}/sbin/
149 %{l_shtool} install -c -m 644 \
150 src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
151 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
152 %{l_shtool} install -c -m 644 \
153 src/imapd/imapd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
154 %{l_shtool} install -c -m 644 \
155 src/ipopd/ipopd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
156 %endif
158 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
160 %files -f files
162 %clean
163 rm -rf $RPM_BUILD_ROOT