# .so library version %global abiver 3 # Upstream suggests to pick bugfixes directly from master # as they're not planning to tag any more releases %global date 20200708 %global commit 6952fb50a6a04c1b3682c56e1f1e26578f3bec1e %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global gitrel %{?date:.%{date}git%{shortcommit}} %global gitver %{?date:-%{date}git%{shortcommit}} Name: date Version: 3.0.0 Release: 1%{?gitrel}%{?dist} Summary: Date and time library based on the C++11/14/17 header License: MIT URL: https://github.com/HowardHinnant/date Source0: %{url}/archive/%{commit}/%{name}-%{version}%{?gitver}.tar.gz # add pkg-config support to make the package compatible with meson # https://github.com/HowardHinnant/date/pull/538 Patch0: output-date-pc-for-pkg-config.patch BuildRequires: cmake >= 3.7 BuildRequires: gcc-c++ BuildRequires: make # required for test suite BuildRequires: tzdata %global _description %{expand: This is actually several separate C++11/C++14/C++17 libraries: - "date.h" is a header-only library which builds upon . It adds some new duration types, and new time_point types. It also adds "field" types such as year_month_day which is a struct {year, month, day}. And it provides convenient means to convert between the "field" types and the time_point types. - "tz.h" / "tz.cpp" are a timezone library built on top of the "date.h" library. This timezone library is a complete parser of the IANA timezone database. It provides for an easy way to access all of the data in this database, using the types from "date.h" and . The IANA database also includes data on leap seconds, and this library provides utilities to compute with that information as well. Slightly modified versions of "date.h" and "tz.h" were voted into the C++20 working draft.} %description %{_description} # only timezone libary has binary part %package -n libdate-tz Summary: Timezone library built on top of the date library Requires: tzdata Obsoletes: libtz = 2.4.1 %description -n libdate-tz Timezone library built on top of the date library. This timezone library is a complete parser of the IANA timezone database. It provides for an easy way to access all of the data in this database, using the types from "date.h" and . The IANA database also includes data on leap seconds, and this library provides utilities to compute with that information as well. %package devel Summary: Date and time library based on the C++11/14/17 header Requires: libdate-tz%{?_isa} = %{version}-%{release} # virtual Provide for header-only parts of the library Provides: %{name}-static = %{version}-%{release} %description devel %{_description} %prep %autosetup -p1 -n %{name}-%{commit} # remove broken tests # fails due to gcc std::locale bugs (gcc#86976, HowardHinnant/date#388) rm -f test/date_test/parse.pass.cpp # fails in fedora-rawhide-i386 due to missing timezone configuration rm -f test/tz_test/zoned_time_deduction.pass.cpp %build %cmake \ -DBUILD_TZ_LIB=ON \ -DUSE_SYSTEM_TZ_DB=ON \ -DENABLE_DATE_TESTING=ON %cmake_build %install %cmake_install %check %cmake_build -t testit %files -n libdate-tz %license LICENSE.txt %{_libdir}/libdate-tz.so.%{abiver}* %files devel %license LICENSE.txt %doc README.md %{_includedir}/%{name}/ %{_libdir}/libdate-tz.so %{_libdir}/cmake/%{name}/ %{_libdir}/pkgconfig/%{name}.pc %changelog * Wed Jul 08 2020 Aleksei Bavshin - 3.0.0-1 - Upstream release 3.0.0 (+4 commits from git master) - Rename libtz subpackage to libdate-tz according to upstream change - Use new cmake_build macros with out-of-tree build * Fri Feb 07 2020 Aleksei Bavshin - 2.4.1-1.20200207git9a0ee254 - Initial import (#1801013)