Commit | Line | Data |
---|---|---|
d9898ee8 | 1 | # |
b0322a85 | 2 | # Copyright 2005-2010 Double Precision, Inc. See COPYING for |
d9898ee8 | 3 | # distribution information. |
4 | ||
5 | Name: courier-authlib | |
6 | Version: @VERSION@ | |
7 | Release: 1 | |
8 | ||
b0322a85 | 9 | License: GPLv3 |
d9898ee8 | 10 | URL: http://www.courier-mta.org |
11 | ||
12 | ################################################################################ | |
13 | ||
14 | Source: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2 | |
15 | ||
16 | ################################################################################ | |
17 | ||
18 | BuildRequires: libtool | |
19 | BuildRequires: openldap-devel | |
b0322a85 | 20 | BuildRequires: mysql-devel zlib-devel sqlite-devel |
d9898ee8 | 21 | BuildRequires: postgresql-devel |
22 | BuildRequires: gdbm-devel | |
23 | BuildRequires: pam-devel | |
24 | BuildRequires: expect | |
25 | BuildRequires: gcc-c++ | |
26 | ||
27 | BuildRequires: /usr/include/ltdl.h | |
28 | ||
29 | ||
30 | %{?repository: Repository(pgpkeys.txt): http://download.lpmtool.com/@REPOSITORY@/courier-authlib} | |
31 | ||
32 | %package | |
33 | Summary: Courier authentication library | |
34 | Group: System Environment/Daemons | |
b0322a85 | 35 | Requires: /bin/systemctl |
d9898ee8 | 36 | |
37 | The Courier authentication library provides authentication services for | |
38 | other Courier applications. | |
39 | ||
40 | %package devel | |
41 | Summary: Development libraries for the Courier authentication library | |
42 | Group: Development/Libraries | |
43 | Requires: courier-authlib = %{__version}-%{__release} | |
44 | ||
45 | This package contains the development libraries and files needed to compile | |
46 | Courier packages that use this authentication library. Install this | |
47 | package in order to build the rest of the Courier packages. After they are | |
48 | built and installed this package can be removed. Files in this package | |
49 | are not needed at runtime. | |
50 | ||
51 | ################################################################################ | |
52 | %package userdb | |
53 | Summary: userdb support for the Courier authentication library | |
54 | Group: System Environment/Daemons | |
55 | Requires: courier-authlib = %{__version}-%{__release} | |
56 | ||
57 | This package installs the userdb support for the Courier authentication | |
58 | library. Userdb is a simple way to manage virtual mail accounts using | |
59 | a GDBM-based database file. | |
60 | <p> | |
61 | Install this package in order to be able to authenticate with userdb. | |
62 | ||
63 | ################################################################################ | |
64 | %package ldap | |
65 | Summary: LDAP support for the Courier authentication library | |
66 | Group: System Environment/Daemons | |
67 | Requires: courier-authlib = %{__version}-%{__release} | |
68 | ||
69 | This package installs LDAP support for the Courier authentication library. | |
70 | Install this package in order to be able to authenticate using LDAP. | |
71 | ||
72 | ################################################################################ | |
73 | %package mysql | |
74 | Summary: MySQL support for the Courier authentication library | |
75 | Group: System Environment/Daemons | |
76 | Requires: courier-authlib = %{__version}-%{__release} | |
77 | ||
78 | This package installs MySQL support for the Courier authentication library. | |
79 | Install this package in order to be able to authenticate using MySQL. | |
80 | ||
b0322a85 CE |
81 | %package sqlite |
82 | Summary: SQLite support for the Courier authentication library | |
83 | Group: System Environment/Daemons | |
84 | Requires: courier-authlib = %{__version}-%{__release} | |
85 | ||
86 | This package installs SQLite support for the Courier authentication library. | |
87 | Install this package in order to be able to authenticate using an SQLite-based | |
88 | database file. | |
89 | ||
d9898ee8 | 90 | ################################################################################ |
91 | %package pgsql | |
b0322a85 | 92 | Summary: PostgreSQL support for the Courier authentication library |
d9898ee8 | 93 | Group: System Environment/Daemons |
94 | Requires: courier-authlib = %{__version}-%{__release} | |
95 | ||
96 | This package installs PostgreSQL support for the Courier authentication | |
97 | library. | |
98 | Install this package in order to be able to authenticate using PostgreSQL. | |
99 | ||
100 | %begin | |
101 | %setup | |
8d138742 | 102 | %configure --with-redhat -C |
d9898ee8 | 103 | %begin build |
dd184caf | 104 | %{__make} -s %{_smp_mflags} |
d9898ee8 | 105 | |
106 | %begin install | |
107 | rm -rf $__installdir | |
108 | MAKEFLAGS= %{__make} -j 1 install DESTDIR=$__installdir | |
109 | %{__rm} -f $__installdir%{_libdir}/courier-authlib/*.a | |
110 | %{__install} -m 555 sysconftool $__installdir%{_libexecdir}/courier-authlib | |
d9898ee8 | 111 | |
112 | ./courierauthconfig --configfiles >configtmp | |
8d138742 | 113 | . ./configtmp |
d9898ee8 | 114 | |
8d138742 CE |
115 | d=`pwd` |
116 | cd $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon || exit 1 | |
117 | $d/authmksock ./socket || exit 1 | |
118 | cd $d || exit 1 | |
d9898ee8 | 119 | touch $__installdir%{_localstatedir}/spool/authdaemon/pid.lock || exit 1 |
120 | touch $__installdir%{_localstatedir}/spool/authdaemon/pid || exit 1 | |
121 | %{__chmod} 777 $__installdir%{_localstatedir}/spool/authdaemon/socket || exit 1 | |
122 | ||
123 | cat >configfiles.base <<EOF | |
124 | %defattr(-,$mailuser,$mailgroup,-) | |
125 | %{_sysconfdir}/authlib | |
126 | %{_libexecdir}/courier-authlib | |
127 | %dir %{_libdir}/courier-authlib | |
128 | %dir %attr(750,$mailuser,$mailgroup) %{_localstatedir}/spool/authdaemon | |
129 | EOF | |
130 | ||
131 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.mysql | |
b0322a85 | 132 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.sqlite |
d9898ee8 | 133 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.ldap |
134 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pgsql | |
135 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.userdb | |
136 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.devel | |
137 | ||
138 | for f in $__installdir%{_sbindir}/* | |
139 | do | |
140 | fn=`basename $f` | |
141 | case "$fn" in | |
142 | *userdb*) | |
143 | echo "%{_sbindir}/$fn" >>configfiles.userdb | |
144 | ;; | |
145 | *) | |
146 | echo "%{_sbindir}/$fn" >>configfiles.base | |
147 | ;; | |
148 | esac | |
149 | done | |
150 | ||
151 | for f in $__installdir%{_libdir}/courier-authlib/* | |
152 | do | |
153 | fn=`basename $f` | |
154 | case "$fn" in | |
155 | libauthldap*) | |
156 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap | |
157 | ;; | |
158 | libauthmysql*) | |
159 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.mysql | |
160 | ;; | |
b0322a85 CE |
161 | libauthsqlite*) |
162 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.sqlite | |
163 | ;; | |
d9898ee8 | 164 | libauthpgsql*) |
165 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pgsql | |
166 | ;; | |
167 | libauthldap*) | |
168 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap | |
169 | ;; | |
170 | libauthuserdb*) | |
171 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.userdb | |
172 | ;; | |
173 | *) | |
174 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.base | |
175 | ;; | |
176 | esac | |
177 | done | |
b0322a85 CE |
178 | %{__mkdir_p} $__installdir%{_datadir} |
179 | %{__install} -m 555 courier-authlib.sysvinit $__installdir%{_datadir} | |
180 | ||
181 | %{__mkdir_p} $__installdir/lib/systemd/system | |
182 | %{__install} -m 644 courier-authlib.service $__installdir/lib/systemd/system | |
d9898ee8 | 183 | |
184 | %post | |
d9898ee8 | 185 | %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null |
186 | ||
b0322a85 CE |
187 | if test -f /etc/rc.d/init.d/courier-authlib |
188 | then | |
189 | /sbin/chkconfig --del courier-authlib | |
190 | /bin/systemctl stop courier-authlib.service || : | |
191 | fi | |
192 | ||
193 | /bin/systemctl daemon-reload || : | |
194 | /bin/systemctl enable courier-authlib.service &> /dev/null || : | |
d9898ee8 | 195 | |
196 | %preun | |
197 | if test -x %{_sbindir}/authdaemond | |
198 | then | |
199 | %{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true | |
200 | fi | |
201 | ||
202 | if test "$1" = "0" | |
203 | then | |
b0322a85 CE |
204 | /bin/systemctl stop courier-authlib.service |
205 | /bin/systemctl disable courier-authlib.service | |
d9898ee8 | 206 | fi |
207 | ||
b0322a85 CE |
208 | %postun |
209 | /bin/systemctl daemon-reload || : | |
210 | ||
d9898ee8 | 211 | %files -f configfiles.base |
212 | %defattr(-,root,root,-) | |
213 | %doc README README*html README.authmysql.myownquery README.ldap | |
8d138742 | 214 | %doc NEWS COPYING* AUTHORS ChangeLog |
b0322a85 CE |
215 | /lib/systemd/system/* |
216 | %attr(755, bin, bin) %{_datadir}/courier-authlib.sysvinit | |
d9898ee8 | 217 | %ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock |
218 | %ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid | |
219 | %ghost %attr(-, root, root) %{_localstatedir}/spool/authdaemon/socket | |
220 | %{_mandir}/man1/* | |
221 | ||
222 | %files -f configfiles.userdb userdb | |
223 | %{_mandir}/man8/*userdb* | |
224 | ||
225 | %files -f configfiles.devel devel | |
226 | %defattr(-,root,root,-) | |
227 | %{_bindir}/courierauthconfig | |
228 | %{_includedir}/* | |
229 | %{_mandir}/man3/* | |
230 | %doc authlib.html auth_*.html | |
231 | ||
232 | %files -f configfiles.ldap ldap | |
233 | %defattr(-,root,root,-) | |
8d138742 | 234 | %doc authldap.schema authldap.ldif |
d9898ee8 | 235 | |
236 | %files -f configfiles.mysql mysql | |
237 | ||
b0322a85 CE |
238 | %files -f configfiles.sqlite sqlite |
239 | ||
d9898ee8 | 240 | %files -f configfiles.pgsql pgsql |
241 | ||
242 | %changelog | |
243 | * Thu Sep 7 2006 Chris Petersen <rpm@forevermore.net> 0.58-2 | |
244 | - Make the spec a little prettier | |
245 | - Replace BuildPreReq with BuildRequires | |
246 | - Remove period from summaries (rpmlint) | |
247 | - Fix release tag to use %{?dist} macro if it's present | |
248 | - Change distro-detection to use "rh" and "fc" for version detection, and add support for mandriva | |
249 | ||
250 | * Sun Oct 3 2004 Mr. Sam <sam@email-scan.com> 0.50-1 | |
251 | - Initial build. | |
252 |