]> git.pld-linux.org Git - packages/cyrus-imapd.git/blob - cyrus-imapd.spec
- added PAM config files
[packages/cyrus-imapd.git] / cyrus-imapd.spec
1 Summary:        high-performance mail store with imap and pop3
2 Name:           cyrus-imapd
3 Version:        1.6.22
4 Release:        0.1
5 Copyright:      academic/research
6 Group:          Networking/Daemons
7 Source0:        ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/%{name}-%{version}.tar.gz
8 Source1:        cyrus-README
9 Source2:        cyrus-procmailrc
10 Source3:        cyrus-deliver-wrapper.c
11 Source4:        cyrus-user-procmailrc.template
12 Source5:        cyrus-imapd-procmail+cyrus.mc
13 Source6:        cyrus-imapd.logrotate
14 Source7:        cyrus-imapd.conf
15 Source8:        cyrus-imapd.cron
16 Source9:        cyrus-imapd.inetd
17 Source10:       cyrus-imapd-pop3.inetd
18 Source11:       cyrus-imapd.pamd
19 Source12:       cyrus-imapd-pop.pamd
20 URL:            http://andrew2.andrew.cmu.edu/cyrus/imapd/
21 #Icon:          cyrus.gif
22 BuildRequires:  cyrus-sasl-devel
23 BuildRequires:  tcl-devel >= 8.0
24 BuildRequires:  openssl-devel
25 Obsoletes:      imapd
26 Obsoletes:      pop3daemon
27 Obsoletes:      imapdaemon
28 Conflicts:      qpopper
29 Conflicts:      solid-pop3d
30 Conflicts:      qpopper6
31 Provides:       imapdaemon
32 Provides:       pop3daemon
33 Buildroot:      /tmp/%{name}-%{version}-root
34
35 %define         _libexecdir     %{_prefix}/lib/cyrus
36
37 %description
38 The Cyrus IMAP server is a scaleable enterprise mail system
39 designed for use from small to large enterprise environments using
40 standards-based technologies.
41
42 A full Cyrus IMAP implementation allows a seamless mail and bulletin
43 board environment to be set up across multiple servers. It differs from
44 other IMAP server implementations in that it is run on "sealed"
45 servers, where users are not normally permitted to log in. The mailbox
46 database is stored in parts of the filesystem that are private to the
47 Cyrus IMAP system. All user access to mail is through software using
48 the IMAP, POP3, or KPOP protocols.
49
50 Note that this package can be used by ISPs and other to provide mail
51 services, but it may not be distributed as part of a commercial product.
52
53 %define version %{PACKAGE_VERSION}
54
55 %prep
56 rm -rf $RPM_BUILD_ROOT
57
58 %setup -q 
59
60 %build
61
62 # prepare a makedepend
63 cd makedepend
64 autoconf
65 %configure 
66 make
67 export PATH=$PATH:`pwd`
68 cd ..
69 autoconf
70 %configure \
71         --with-auth=unix
72 make
73
74 gcc $RPM_OPT_FLAGS -DLIBEXECDIR=\"%{_libexecdir}\" -s -Wall -o deliver-wrapper %{SOURCE3}
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 #install -d $RPM_BUILD_ROOT/usr/cyrus/etc 
79 install -d \
80         $RPM_BUILD_ROOT{%{_sbindir},%{_libexecdir},%{_mandir}} \
81         $RPM_BUILD_ROOT/etc/{logrotate.d,cron.daily,sysconfig/rc-inetd} \
82         $RPM_BUILD_ROOT/var/spool/imap/stage. \
83         $RPM_BUILD_ROOT/var/state/imap/{user,quota,proc,log,msg,deliverdb,sieve} \
84         $RPM_BUILD_ROOT%{_libdir}/sendmail-cf/cf 
85 touch $RPM_BUILD_ROOT/var/state/imap/mailboxes
86
87
88 make install DESTDIR=$RPM_BUILD_ROOT CYRUS_USER="`id -u`" CYRUS_GROUP="`id -g`"
89
90 #mkdir -p $RPM_BUILD_ROOT/usr/cyrus/bin
91 #install -g mail -m 2755 -s deliver-wrapper $RPM_BUILD_ROOT/usr/cyrus/bin/deliver-wrapper
92 install deliver-wrapper $RPM_BUILD_ROOT/usr/cyrus/bin/deliver-wrapper
93
94 install %{SOURCE1} .
95 install %{SOURCE2} $RPM_BUILD_ROOT/etc/procmailrc.cyrus
96 #install %{SOURCE4} $RPM_BUILD_ROOT/usr/cyrus/etc/user-procmailrc.template
97 install %{SOURCE5} $RPM_BUILD_ROOT%{_libdir}/sendmail-cf/cf/procmail+cyrus.mc
98 install %{SOURCE6} $RPM_BUILD_ROOT/etc/logrotate.d/cyrus-imapd
99 install %{SOURCE7} $RPM_BUILD_ROOT/etc/imapd.conf
100 install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.daily/cyrus-imapd
101 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/imapd
102 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/pop3d
103 install %{SOURCE11} $RPM_BUILD_ROOT/etc/pam.d/imap
104 install %{SOURCE12} $RPM_BUILD_ROOT/etc/pam.d/pop
105
106 mv $RPM_BUILD_ROOT/usr/cyrus/bin/*      $RPM_BUILD_ROOT%{_libexecdir}
107 mv $RPM_BUILD_ROOT/usr/man/*            $RPM_BUILD_ROOT%{_mandir}
108
109 gzip -9fn $RPM_BUILD_ROOT%{_mandir}/man*/* \
110         cyrus-README
111
112 # make hashed dirs
113 cd $RPM_BUILD_ROOT/var
114 /usr/bin/perl <<EOF
115 foreach \$i ("a".."z") 
116 {
117   mkdir "state/imap/user/\$i", 0755;
118   mkdir "state/imap/quota/\$i", 0755;
119   mkdir "state/imap/sieve/\$i", 0755;
120   mkdir "spool/imap/\$i", 0755;
121 }
122 EOF
123
124 %pre
125 if [ -z "`id -u cyrus 2>/dev/null`" ]; then
126         /usr/sbin/useradd -u 76 -r -d /var/spool/imap -s /bin/false -c "Cyrus User" -g mail cyrus 1>&2
127         if [ -f /var/db/passwd.db ]; then
128                 /usr/bin/update-db 1>&2
129         fi
130 fi
131
132 %post
133 if [ -f /var/lock/subsys/rc-inetd ]; then
134         /etc/rc.d/init.d/rc-inetd reload 1>&2
135 else
136         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet sever" 1>&2
137 fi
138
139
140 # force synchronous updates
141 cd /var/state/imap
142 chattr +S . user quota 2>/dev/null
143 chattr +S /var/spool/imap 2>/dev/null
144
145 %postun
146 if [ -f /var/lock/subsys/rc-inetd ]; then
147         /etc/rc.d/init.d/rc-inetd reload 1>&2
148 fi
149 if [ "$1" = "0" ]; then
150         if [ -n "`id -u cyrus 2>/dev/null`" ]; then
151                 /usr/sbin/userdel cyrus 1>&2
152         fi
153 fi
154
155
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %files
161 %defattr(644,root,root,755)
162 #doc README README.RPM doc
163 %doc doc/html/*.html
164
165 %config /etc/imapd.conf
166 %config /etc/procmailrc.cyrus
167 %config(noreplace) %verify(not size md5 mtime) /etc/logrotate.d/cyrus-imapd
168 %attr( 640, root,root) %config(noreplace) %verify(not size md5 mtime) /etc/sysconfig/rc-inetd/*
169 %attr( 440, cyrus,root) %config(noreplace) %verify(not size md5 mtime) /etc/pam.d/*
170 %attr( 755, root,root) /etc/cron.daily/cyrus-imapd
171 %attr( 755, root,root) %{_bindir}/*
172 %attr(4750,cyrus,mail) %{_libexecdir}/deliver
173 %attr(2755,cyrus,mail) %{_libexecdir}/deliver-wrapper
174 %attr( 755, root,root) %{_libexecdir}/arbitron
175 %attr( 755, root,root) %{_libexecdir}/collectnews
176 %attr( 755, root,root) %{_libexecdir}/dump_deliverdb
177 %attr( 755, root,root) %{_libexecdir}/feedcyrus
178 %attr( 755, root,root) %{_libexecdir}/fud
179 %attr( 755, root,root) %{_libexecdir}/mbpath
180 %attr( 755, root,root) %{_libexecdir}/quota
181 %attr( 755, root,root) %{_libexecdir}/reconstruct
182 %attr( 755, root,root) %{_libexecdir}/syncnews
183 %attr( 755, root,root) %{_libexecdir}/timsieved
184 %attr( 755, root,root) %{_libexecdir}/pop3d
185 %attr( 755, root,root) %{_libexecdir}/imapd
186
187 #%attr(0755,root,root) %{_sbindir}/imapd
188 #%attr(0755,root,root) %{_sbindir}/ipop3d
189
190 %defattr(640,cyrus,mail,750)
191 /var/spool/imap
192 %dir /var/state/imap
193 /var/state/imap/deliverdb
194 /var/state/imap/quota
195 /var/state/imap/user
196 /var/state/imap/sieve
197 /var/state/imap/log
198 /var/state/imap/msg
199 /var/state/imap/proc
200 %config(noreplace) %verify(not size md5 mtime) /var/state/imap/mailboxes
201 %defattr(644,root,root,755)
202
203 %{_mandir}/man*/*
204
205 %{_includedir}/cyrus
206 %{_libdir}/lib*.a
This page took 0.30224 seconds and 3 git commands to generate.