File evolution-etesync.spec of Package evolution-etesync

%define debug_package %{nil}
%define repo gitlab.gnome.org/GNOME/evolution-etesync
%global dpkg_arch %(%{__dpkg_architecture} -qDEB_HOST_MULTIARCH)

%if %{_target_cpu} == "x86_64"
%global cc_target_env "-m64"
%else
%global cc_target_env ""
%endif


Name:          evolution-etesync
Version:       1.0.0
Release:       0
Summary:       EteSync (end-to-end encrypted sync) plugin for Evolution

License:       LGPL
URL:           https://%{repo}
Source0:       https://%{repo}/-/archive/1.0.0/evolution-etesync-%{version}.tar.gz

Requires: libgee-0.8-2, libjson-glib-1.0-0, evolution-data-server, libetebase0
BuildRequires: cmake libical3-dev, libebook1.2-dev, libecal2.0-dev, libedata-cal2.0-dev, libedata-book1.2-dev, evolution-data-server-dev, evolution-dev, intltool, libetebase0, libetebase-dev
BuildRoot:      %{_tmppath}/%{name}-build
Prefix:        /usr

AutoReq:       no 
AutoReqProv:   no

%if %{_vendor} == "debbuild"
Packager:        fawz
%endif

%description
EteSync 2.0 (end-to-end encrypted sync) plugin for Evolution

%package langpacks
Summary: Translations for %{name}
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%if %{_vendor} == "debbuild"
Packager:        fawz
%endif

%description langpacks
This package contains translations for %{name}.

%prep
%{echo: buildarch %{buildarch}}
%setup -q -n evolution-etesync-%{version}

%build
# %cmake
find . -name CMakeLists.txt \
        -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\)/{s/^/#IGNORE /}' {} +
mkdir -p build
cd build
/usr/bin/cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=%{_libdir} \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
        -DCMAKE_INSTALL_LIBDIR:PATH=%{dpkg_arch} \
        -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_C_FLAGS="${CFLAGS:--O2 -g %{cc_target_env} -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_CXX_FLAGS="${CXXFLAGS:--O2 -g %{cc_target_env} -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_Fortran_FLAGS="${FFLAGS:--O2 -g %{cc_target_env} -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_EXE_LINKER_FLAGS=" -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
        -DCMAKE_MODULE_LINKER_FLAGS=" -Wl,--as-needed" \
        -DCMAKE_SHARED_LINKER_FLAGS=" -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
%if 1550 <= 1500
        -DCMAKE_SKIP_INSTALL_RPATHS:BOOL=ON \
%endif
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DBUILD_SHARED_LIBS:BOOL=ON \
        -DBUILD_STATIC_LIBS:BOOL=OFF \
        -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \
        -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
        -DCMAKE_MODULES_INSTALL_DIR=/usr/%{dpkg_arch}/cmake/%{name}



%install
# %cmake_install
DESTDIR=%{buildroot} /usr/bin/make install -C build

%find_lang %{name}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%{_libdir}/evolution-etesync/libevolution-etesync.so
/usr/lib/evolution-data-server/addressbook-backends/libebookbackendetesync.so
/usr/lib/evolution-data-server/calendar-backends/libecalbackendetesync.so
/usr/lib/evolution-data-server/credential-modules/module-etesync-credentials.so
/usr/lib/evolution-data-server/registry-modules/module-etesync-backend.so
/usr/lib/evolution/modules/module-etesync-configuration.so
%{_datadir}/metainfo/org.gnome.Evolution-etesync.metainfo.xml

%files langpacks -f %{name}.lang

%changelog
* Wed Nov 26 2020 Tom Hacohen <tom@etesync.com> 0.99.1-1
- Update to the now merged master branch
* Tue Nov 10 2020 Tom Hacohen <tom@etesync.com> 0.99-2
- Fix building on 32bit distros
* Fri Nov 06 2020 Tom Hacohen <tom@etesync.com> 0.99-1
- Update to EteSync 2.0
* Thu Aug 20 2020 Pierre-Alain TORET <pierre-alain.toret@protonmail.com> 0.1-1
- First release
openSUSE Build Service is sponsored by