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