Summary: Courier authentication library.
Summary(ja): Courier 認証ライブラリ
Name: courier-authlib
Version: 0.63.0
Release: 2%{?_dist_release}
License: GPL
Group: System Environment/Daemons
URL: http://www.courier-mta.org
Source0: %{name}-%{version}.tar.bz2
Patch: %{name}-apop.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libtool
BuildRequires: openldap-devel
BuildRequires: MySQL-devel zlib-devel
BuildRequires: postgresql-devel
BuildRequires: gdbm-devel
BuildRequires: pam-devel
BuildRequires: expect

Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig

Vendor: Project Vine
Distribution: Vine Linux
Packager: tomop

%description
The Courier authentication library provides authentication services for
other Courier applications.

%description -l ja
Courier 認証ライブラリは他の Courier アプリケーションへ認証サービスを
提供します。


%package devel
Summary: Development libraries for the Courier authentication library.
Summary(ja): Courier 認証ライブラリの開発ライブラリ
Group: Development/Libraries
Requires: courier-authlib = %{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.

%description -l ja devel
認証ライブラリを必要とする Courier パッケージのコンパイルに必要な開発
ライブラリです。他の Courier パッケージを作成するならインストールして
ください。作成したパッケージのインストール後は不要ですので削除しても構
いません。このパッケージに含まれるファイルは実行時には必要ありません。


%package ldap
Summary: LDAP support for the Courier authentication library.
Summary(ja): Courier 認証ライブラリの LDAP サポート
Group: System Environment/Daemons
Requires: courier-authlib = %{version}-%{release}
Requires: openldap

%description ldap
This package installs LDAP support for the Courier authentication library.
Install this package in order to be able to authenticate using LDAP.

%description -l ja ldap
Courier 認証ライブラリの LDAP サポートパッケージです。LDAP を使った認証を
行なう場合にインストールしてください。


%package pgsql
Summary: PostgreSQL support for the Courier authentication library.
Summary(ja): Courier 認証ライブラリの PostgreSQL サポート
Group: System Environment/Daemons
Requires: courier-authlib = %{version}-%{release}
Requires: postgresql-libs, postgresql

%description pgsql
This package installs PostgreSQL support for the Courier authentication
library.
Install this package in order to be able to authenticate using PostgreSQL.

%description -l ja pgsql
Courier 認証ライブラリの PostgreSQL サポートパッケージです。PostgreSQL を
使った認証を行なう場合にインストールしてください。


%package mysql
Summary: MySQL support for the Courier authentication library.
Summary(ja): Courier 認証ライブラリの MySQL サポート
Group: System Environment/Daemons
Requires: courier-authlib = %{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.

%description -l ja mysql
Courier 認証ライブラリの MySQL サポートパッケージです。MySQL を使った認証を
行なう場合にインストールしてください。

%prep
%setup -q
%patch -p1 -b .orig

%build
#%configure --without-authldap --without-authpgsql
%configure 
make

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
rm -f %{buildroot}/%{_libdir}/%{name}/*.a
install -m 555 sysconftool %{buildroot}/%{_libexecdir}/%{name}
install -m 555 authmigrate %{buildroot}/%{_libexecdir}/%{name}

#./courierauthconfig --configfiles >configtmp
#. configtmp

./authmksock %{buildroot}/%{_localstatedir}/spool/authdaemon/socket || exit 1
touch %{buildroot}/%{_localstatedir}/spool/authdaemon/pid.lock || exit 1
touch %{buildroot}/%{_localstatedir}/spool/authdaemon/pid || exit 1
chmod 777 %{buildroot}/%{_localstatedir}/spool/authdaemon/socket || exit 1

mkdir -p %{buildroot}/%{_initdir}
install -m 555 courier-authlib.sysvinit %{buildroot}/%{_initdir}/courier-authlib

%post
%{_libexecdir}/%{name}/authmigrate >/dev/null
%{_libexecdir}/%{name}/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null

/sbin/chkconfig --del courier-authlib
/sbin/chkconfig --add courier-authlib

%preun
if test -x %{_sbindir}/authdaemond
then
	%{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true
fi

if test "$1" = "0"
then
	/sbin/chkconfig --del courier-authlib
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README README*html README.authmysql.myownquery README.ldap
%doc NEWS COPYING* AUTHORS ChangeLog authldap.schema
%doc README.apop
/etc/rc.d/init.d/*
%ghost %attr(600,root,root) %{_localstatedir}/spool/authdaemon/pid.lock
%ghost %attr(644,root,root) %{_localstatedir}/spool/authdaemon/pid
%ghost %attr(-,root,root) %{_localstatedir}/spool/authdaemon/socket
%{_mandir}/man1/*
%{_mandir}/man8/*
%defattr(-,daemon,daemon)
%dir %{_sysconfdir}/authlib
%{_sysconfdir}/authlib/authdaemonrc.dist
%{_libexecdir}/%{name}
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libauthcustom*
%{_libdir}/%{name}/libauthpam*
%{_libdir}/%{name}/libauthpipe*
%{_libdir}/%{name}/libauthuser*
%{_libdir}/%{name}/libcourierauth*
%dir %attr(750,daemon,daemon) %{_localstatedir}/spool/authdaemon
%{_sbindir}/*

%files devel
%defattr(-,root,root)
%{_bindir}/courierauthconfig
%{_includedir}/*
%{_mandir}/man3/*
%doc authlib.html auth_*.html

%files ldap
%defattr(-,root,root)
%{_sysconfdir}/authlib/authldaprc.dist
%{_libdir}/%{name}/libauthldap*

%files pgsql
%defattr(-,root,root)
%{_sysconfdir}/authlib/authpgsqlrc.dist
%{_libdir}/%{name}/libauthpgsql*

%files mysql
%defattr(-,root,root)
%{_sysconfdir}/authlib/authmysqlrc.dist
%{_libdir}/%{name}/libauthmysql*


%changelog
* Sun Apr 03 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.63.0-2
- Rebuilt with new toolchain.

* Sun Feb 07 2010 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.63.0-1
- new upstream release.
- replaced "BuildPreReq:" with "BuilldRequires:".

* Sun Nov 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.62.4-1
- new upstream release.
- removed "Requires: MySQL-shared".
- updated APOP patch.

* Thu May 21 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.59.3-2
- rebuilt with MySQL-shared-5.1.34.

* Sat Jul 05 2008 Shu KONNO <owa@bg.wakwak.com> 0.59.3-1vl5
- applied new versioning policy, and spec in utf-8
- rebuilt with postgresql-8.3.3

* Sun Jan 27 2008 Shu KONNO <owa@bg.wakwak.com> 0.59.3-0vl3
- rebuilt

* Tue Jan 08 2008 Shu KONNO <owa@bg.wakwak.com> 0.59.3-0vl2
- rebuilt with postgresql-8.2.6

* Thu Sep 20 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.59.3-0vl1
- new upstream release
- rebuilt with postgresql 8.2.5

* Sat Nov 11 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.56-0vl4
- rebuilt with MySQL 5.0.27
- included /usr/lib/courier-authlib/libauthpipe.*

* Sun Aug 27 2006 NAKAMURA Kenta <kenta@vinelinux.org> 0.56-0vl3
- rebuilt with openldap-2.3.27-0vl1

* Sun May 22 2005 UECHI Yasumasa <uechi@potaway.net> 0.56-0vl2
- new upstream release

* Mon Mar 28 2005 UECHI Yasumasa <uechi@potaway.net> 0.55-0vl4
- add ldap, postgresql, mysql packages

* Thu Mar 17 2005 UECHI Yasumasa <uechi@potaway.net> 0.55-0vl1
- new upstream release

* Thu Feb 17 2005 UECHI Yasumasa <uechi@potaway.net> 0.54-0vl1
- new upstream release

* Wed Jan 12 2005 UECHI Yasumasa <uechi@potaway.net> 0.53-0vl1
- new upstream release

* Wed Jan 12 2005 UECHI Yasumasa <uechi@potaway.net> 0.52-0vl1
- simplify a spec for Vine
- add apop patch

* Sun Oct  3 2004 Mr. Sam <sam@email-scan.com> - 0.50-1
- Initial build.
