%define courier_user courier %define courier_group courier %define courier_home %{_localstatedir}/spool/authdaemon Name: courier-authlib Version: 0.63.0 Release: 1%{?dist} Summary: Courier authentication library Group: System Environment/Daemons License: GPLv3+ URL: http://www.courier-mta.org/authlib/ Source0: http://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2 Source1: %{name}.init BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openldap-devel BuildRequires: mysql-devel BuildRequires: postgresql-devel BuildRequires: gdbm-devel BuildRequires: pam-devel BuildRequires: libtool-ltdl-devel BuildRequires: expect #Requires: #Initscripts Requires(post): chkconfig Requires(preun): chkconfig initscripts # Users and groups Requires(pre): shadow-utils %description The Courier authentication library provides authentication services for other Courier applications. %package devel Summary: Development libraries for the Courier authentication library Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains the development libraries and files needed to compile Courier packages that use this authentication library. Install this package in order to build the rest of the Courier packages. After they are built and installed this package can be removed. Files in this package are not needed at runtime. %package userdb Summary: Userdb support for the Courier authentication library Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description userdb This package installs the userdb support for the Courier authentication library. Userdb is a simple way to manage virtual mail accounts using a GDBM-based database file. Install this package in order to be able to authenticate with userdb. %package ldap Summary: LDAP support for the Courier authentication library Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description ldap This package installs LDAP support for the Courier authentication library. Install this package in order to be able to authenticate using LDAP. %package mysql Summary: MySQL support for the Courier authentication library Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description mysql This package installs MySQL support for the Courier authentication library. Install this package in order to be able to authenticate using MySQL. %package pgsql Summary: MySQL support for the Courier authentication library Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description pgsql This package installs PostgreSQL support for the Courier authentication library. Install this package in order to be able to authenticate using PostgreSQL. %package pipe Summary: External authentication module that communicates via pipes Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description pipe This package installs the authpipe module, which is a generic plugin that enables authentication requests to be serviced by an external program, then communicates through messages on stdin and stdout. %prep %setup -q %build %configure -C --with-redhat --disable-static %{__make} %{?_smp_mflags} %install %{__rm} -rf $RPM_BUILD_ROOT %{__make} install DESTDIR=$RPM_BUILD_ROOT %{__make} install-configure DESTDIR=$RPM_BUILD_ROOT # clean-up .la archives find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' # install sysvinit %{__install} -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name} # dynamic linker file [ ! -d $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d ] && mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d echo %{_libdir}/%{name} > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/%{name}.conf # create /var/spool/authdaemon %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon %clean %{__rm} -rf $RPM_BUILD_ROOT %pre getent group %{courier_group} >/dev/null || groupadd -r %{courier_group} getent passwd %{courier_user} >/dev/null || \ useradd -r -g %{courier_group} -d %{courier_home} -s /bin/bash \ -c "Courier User" %{courier_user} exit 0 %post /sbin/ldconfig /sbin/chkconfig --add %{name} %postun -p /sbin/ldconfig %preun if [ $1 = 0 ] ; then /sbin/service %{name} stop >/dev/null 2>&1 /sbin/chkconfig --del %{name} fi %post userdb -p /sbin/ldconfig %postun userdb -p /sbin/ldconfig %post ldap -p /sbin/ldconfig %postun ldap -p /sbin/ldconfig %post mysql -p /sbin/ldconfig %postun mysql -p /sbin/ldconfig %post pgsql -p /sbin/ldconfig %postun pgsql -p /sbin/ldconfig %post pipe -p /sbin/ldconfig %postun pipe -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING COPYING.GPL NEWS README %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/authlib/authdaemonrc %attr(0644, root, root) %config %{_sysconfdir}/authlib/authdaemonrc.dist %attr(0644, root, root) %{_sysconfdir}/ld.so.conf.d/%{name}.conf %{_initrddir}/%{name} %{_libdir}/%{name}/libauthcustom* %{_libdir}/%{name}/libauthpam* %{_libdir}/%{name}/libcourierauth* %{_libexecdir}/%{name}/* %{_sbindir}/* %{_mandir}/man1/* %{_mandir}/man8/* %attr(0755, %{courier_user}, %{courier_group}) %{_localstatedir}/spool/authdaemon %files devel %defattr(-,root,root,-) %doc authlib.html auth_*.html %{_includedir}/*.h %{_bindir}/courierauthconfig %{_mandir}/man3/* %files userdb %defattr(-,root,root,-) %{_libdir}/%{name}/libauthuserdb* %files ldap %defattr(-,root,root,-) %doc README.ldap authldap.schema %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/authlib/authldaprc %attr(0644, root, root) %config %{_sysconfdir}/authlib/authldaprc.dist %{_libdir}/%{name}/libauthldap* %files mysql %defattr(-,root,root,-) %doc README.authmysql* %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/authlib/authmysqlrc %attr(0644, root, root) %config %{_sysconfdir}/authlib/authmysqlrc.dist %{_libdir}/%{name}/libauthmysql* %files pgsql %defattr(-,root,root,-) %doc README.authpostgres.html %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/authlib/authpgsqlrc %attr(0644, root, root) %config %{_sysconfdir}/authlib/authpgsqlrc.dist %{_libdir}/%{name}/libauthpgsql* %files pipe %defattr(-,root,root,-) %{_libdir}/%{name}/libauthpipe* %changelog * Tue Apr 20 2010 Aldrey Galindo 0.63.0-1 - Update courier-authlib to 0.63.0 - Fix script run to root (problems with user courier) * Tue Jul 28 2009 Aldrey Galindo 0.62.4-3 - Create file dynamic linker * Tue Jul 28 2009 Hugo Cisneiros 0.62.4-2 - New upstream release - Included COPYING.GPL - Fixed sysinit script * Fri Feb 6 2009 Allisson Azevedo 0.62.2-1 - Initial RPM release