Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / courier-authlib.lpspec
1 # $Id: courier-authlib.lpspec.in,v 1.14 2009/12/18 04:24:20 mrsam Exp $
2 #
3 # Copyright 2005-2008 Double Precision, Inc. See COPYING for
4 # distribution information.
5
6 Name: courier-authlib
7 Version: 0.63.0
8 Release: 1
9
10 License: GPL
11 URL: http://www.courier-mta.org
12
13 ################################################################################
14
15 Source: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
16
17 ################################################################################
18
19 BuildRequires: libtool
20 BuildRequires: openldap-devel
21 BuildRequires: mysql-devel zlib-devel
22 BuildRequires: postgresql-devel
23 BuildRequires: gdbm-devel
24 BuildRequires: pam-devel
25 BuildRequires: expect
26 BuildRequires: gcc-c++
27
28 BuildRequires: /usr/include/ltdl.h
29
30
31 %{?repository: Repository(pgpkeys.txt): http://download.lpmtool.com//courier-authlib}
32
33 %package
34 Summary: Courier authentication library
35 Group: System Environment/Daemons
36 Requires: /sbin/chkconfig
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 ################################################################################
83 %package pgsql
84 Summary: MySQL support for the Courier authentication library
85 Group: System Environment/Daemons
86 Requires: courier-authlib = %{__version}-%{__release}
87
88 This package installs PostgreSQL support for the Courier authentication
89 library.
90 Install this package in order to be able to authenticate using PostgreSQL.
91
92 %begin
93 %setup
94 %configure --with-redhat -C
95 %begin build
96 %{__make} -s %{_smp_mflags}
97
98 %begin install
99 rm -rf $__installdir
100 MAKEFLAGS= %{__make} -j 1 install DESTDIR=$__installdir
101 %{__rm} -f $__installdir%{_libdir}/courier-authlib/*.a
102 %{__install} -m 555 sysconftool $__installdir%{_libexecdir}/courier-authlib
103
104 ./courierauthconfig --configfiles >configtmp
105 . ./configtmp
106
107 d=`pwd`
108 cd $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon || exit 1
109 $d/authmksock ./socket || exit 1
110 cd $d || exit 1
111 touch $__installdir%{_localstatedir}/spool/authdaemon/pid.lock || exit 1
112 touch $__installdir%{_localstatedir}/spool/authdaemon/pid || exit 1
113 %{__chmod} 777 $__installdir%{_localstatedir}/spool/authdaemon/socket || exit 1
114
115 cat >configfiles.base <<EOF
116 %defattr(-,$mailuser,$mailgroup,-)
117 %{_sysconfdir}/authlib
118 %{_libexecdir}/courier-authlib
119 %dir %{_libdir}/courier-authlib
120 %dir %attr(750,$mailuser,$mailgroup) %{_localstatedir}/spool/authdaemon
121 EOF
122
123 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.mysql
124 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.ldap
125 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pgsql
126 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.userdb
127 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.devel
128
129 for f in $__installdir%{_sbindir}/*
130 do
131 fn=`basename $f`
132 case "$fn" in
133 *userdb*)
134 echo "%{_sbindir}/$fn" >>configfiles.userdb
135 ;;
136 *)
137 echo "%{_sbindir}/$fn" >>configfiles.base
138 ;;
139 esac
140 done
141
142 for f in $__installdir%{_libdir}/courier-authlib/*
143 do
144 fn=`basename $f`
145 case "$fn" in
146 libauthldap*)
147 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
148 ;;
149 libauthmysql*)
150 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.mysql
151 ;;
152 libauthpgsql*)
153 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pgsql
154 ;;
155 libauthldap*)
156 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
157 ;;
158 libauthuserdb*)
159 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.userdb
160 ;;
161 *)
162 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.base
163 ;;
164 esac
165 done
166 %{__mkdir_p} $__installdir%{_sysconfdir}/rc.d/init.d
167 %{__install} -m 555 courier-authlib.sysvinit \
168 $__installdir%{_sysconfdir}/rc.d/init.d/courier-authlib
169
170 %post
171 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null
172
173 /sbin/chkconfig --del courier-authlib
174 /sbin/chkconfig --add courier-authlib
175
176 %preun
177 if test -x %{_sbindir}/authdaemond
178 then
179 %{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true
180 fi
181
182 if test "$1" = "0"
183 then
184 /sbin/chkconfig --del courier-authlib
185 fi
186
187 %files -f configfiles.base
188 %defattr(-,root,root,-)
189 %doc README README*html README.authmysql.myownquery README.ldap
190 %doc NEWS COPYING* AUTHORS ChangeLog
191 /etc/rc.d/init.d/*
192 %ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock
193 %ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid
194 %ghost %attr(-, root, root) %{_localstatedir}/spool/authdaemon/socket
195 %{_mandir}/man1/*
196
197 %files -f configfiles.userdb userdb
198 %{_mandir}/man8/*userdb*
199
200 %files -f configfiles.devel devel
201 %defattr(-,root,root,-)
202 %{_bindir}/courierauthconfig
203 %{_includedir}/*
204 %{_mandir}/man3/*
205 %doc authlib.html auth_*.html
206
207 %files -f configfiles.ldap ldap
208 %defattr(-,root,root,-)
209 %doc authldap.schema authldap.ldif
210
211 %files -f configfiles.mysql mysql
212
213 %files -f configfiles.pgsql pgsql
214
215 %changelog
216 * Thu Sep 7 2006 Chris Petersen <rpm@forevermore.net> 0.58-2
217 - Make the spec a little prettier
218 - Replace BuildPreReq with BuildRequires
219 - Remove period from summaries (rpmlint)
220 - Fix release tag to use %{?dist} macro if it's present
221 - Change distro-detection to use "rh" and "fc" for version detection, and add support for mandriva
222
223 * Sun Oct 3 2004 Mr. Sam <sam@email-scan.com> 0.50-1
224 - Initial build.
225