Summary:        A shared libraries for milters
Summary(ja):    milterのための共有ライブラリ
Name:           libmilter
Version:        8.16.1
Release:        1%{?_dist_release}
Group:          system
Vendor:         Project Vine
Distribution:   Vine Linux

License:        Sendmail
URL:            https://www.proofpoint.com/us/open-source-email-solution
Source0:        ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{version}.tar.gz
Patch0:         sendmail-8.14.3-sharedmilter.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

%global objdir  obj.Linux.%(uname -r).%(uname -m)

%description
The %{name} package provides a shared library for milters.

%description -l ja
%{name} パッケージは、milterに必要な共有ライブラリを提供します。


%package        devel
Summary:        headers and libraries to develop milters
Summary(ja):    milter開発に必要なヘッダ・ライブラリ
Group:          programming
Requires:       %{name} = %{version}-%{release}
Conflicts:      sendmail-devel

%description devel
This package contains headers and libraries to develop milters.

%description devel -l ja
このパッケージは、milter開発に必要なヘッダ・ライブラリを含んでいます。


%debug_package


%prep
%setup -q -n sendmail-%{version}

cp devtools/M4/UNIX/{,shared}library.m4
%patch0 -p1 -b .sharedmilter


%build
cd libmilter
./Build -c


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}/libmilter

install -m644 include/libmilter/mfapi.h %{buildroot}%{_includedir}/libmilter/
install -m644 include/libmilter/mfdef.h %{buildroot}%{_includedir}/libmilter/

install -m755 %{objdir}/libmilter/libmilter.so.* %{buildroot}%{_libdir}/

pushd %{buildroot}%{_libdir}
for f in libmilter.so.*; do
	ln -sf $f $(echo $f | sed -e 's/\.[0-9]*$//')
	ln -sf $f libmilter.so
done
popd

%clean
rm -rf %{buildroot}


%post
/sbin/ldconfig 

%postun
/sbin/ldconfig 


%files
%{_libdir}/libmilter.so.*


%files devel
%{_libdir}/libmilter.so
%{_includedir}/libmilter


%changelog
* Tue Sep 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 8.16.1-1
- new upstream release.

* Sat Oct 05 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 8.15.2-1
- initial build.
