File libvmime.spec of Package libvmime

# Since not all distros have a vmime package with a known SO number,
# we will (still) call ours libvmime_kopano to avoid potential file conflicts.

Name:           libvmime_kopano
%define lname	libvmime-kopano3
Summary:        Library for working with RFC 5322, MIME messages and IMAP/POP/SMTP
Version:        0.9.2k4
Release:        0
License:        GPL-3.0+
Group:          Development/Libraries/C and C++
Url:            http://vmime.org/

#Source:         https://github.com/kisli/vmime/archive/v%%version.tar.gz
Source:         vmime-%version.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cmake >= 3.1
BuildRequires:  kcdep-c++-compiler
BuildRequires:  gettext-tools
BuildRequires:  libselinux-devel
BuildRequires:  libtool
BuildRequires:  pkg-config

%description
VMime is a C++ class library for working with RFC5322 and
MIME-conforming messages (RFC2045–2049), as well as Internet
messaging services like IMAP, POP or SMTP.

VMime can parse, generate and modify messages, and also connect to
store and transport services to receive or send messages over the
Internet. The library offers features to build a mail client.

%package -n %lname
Summary:        Library for working with MIME messages and IMAP/POP/SMTP
Group:          System/Libraries

%description -n %lname
VMime is a C++ class library for working with RFC5322 and
MIME-conforming messages (RFC2045–2049), as well as Internet
messaging services like IMAP, POP or SMTP.

VMime can parse, generate and modify messages, and also connect to
store and transport services to receive or send messages over the
Internet. The library offers features to build a mail client.

%package -n libvmime-devel
Summary:        Development files for vmime, an e-mail message library
Group:          Development/Libraries/C and C++
Requires:       %lname = %version
Obsoletes:      libvmime_kopano0-devel

%description -n libvmime-devel
VMime is a C++ class library for working with RFC5322 and
MIME-conforming messages (RFC2045–2049), as well as Internet
messaging services like IMAP, POP or SMTP.

VMime can parse, generate and modify messages, and also connect to
store and transport services to receive or send messages over the
Internet. The library offers features to build a mail client.

%prep
%setup -qn vmime-%version

%build
export CC="%__cc"
export CXX="%__cxx"
cf="%optflags -DVMIME_ALWAYS_GENERATE_7BIT_PARAMETER=1"
# not sure every target has %%cmake yet, so opencode:

# kopano does not need sasl/tls
cmake . \
	-DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" \
	-DCMAKE_CXX_FLAGS:STRING=" " \
	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$cf" \
	-DCMAKE_C_FLAGS:STRING=" " \
	-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$cf" \
	-DCMAKE_INSTALL_LIBDIR:PATH="%_libdir" \
	-DCMAKE_INSTALL_PREFIX:PATH="%_prefix" \
	-DVMIME_BUILD_DOCUMENTATION:BOOL=OFF \
	-DVMIME_BUILD_SAMPLES:BOOL=OFF \
	-DVMIME_BUILD_STATIC_LIBRARY:BOOL=OFF \
	-DVMIME_HAVE_SASL_SUPPORT:BOOL=OFF \
	-DVMIME_HAVE_TLS_SUPPORT:BOOL=OFF \
	-DVMIME_SENDMAIL_PATH:STRING="%_sbindir/sendmail"
make %{?_smp_mflags} VERBOSE=1

%install
b="%buildroot"
%make_install CC=false CXX=false
find "$b"|sort
find "$b" -type f -name "*.la" -delete
rm -Rf "$b/usr/cmake"

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%_libdir/libvmime-kopano*.so.3*

%files -n libvmime-devel
%defattr(-,root,root)
%_includedir/*
%_libdir/libvmime*.so
%_libdir/pkgconfig/vmime.pc

%changelog
openSUSE Build Service is sponsored by