# # spec file for package date # # Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %global somajor 3 %global libname %mklibname date %{somajor} %define develname %mklibname date -d # Howard Hinnant recommends using it "live at head", i.e. the latest git master. #define opensuse_release 3.9 #define snap 20241002 Name: date Version: 3.0.3 # Format: %%{opensuse_release}+git%%{snap}.%%{release}%%{?dist} # where %{release} is the normal release, starting at 1 (then 1.1, … for # updates for the current distro version; 2, … for updates for a new distro # version) # If 3.0.2 or whatever is released, the format will change to: # %%{release}%%{?dist} # and then when new commits to master are made: # git%%{snap}.%%{release}%%{?dist} # (basically the same, except without the OpenSUSE baggage) Release: %mkrel %{?opensuse_release:%{opensuse_release}+}%{?snap:git%{snap}.}1 Summary: Date and time library based on the C++11/14/17 chrono header License: MIT Group: Development/Libraries/C and C++ URL: https://github.com/HowardHinnant/date Source: %{url}/releases/download/%{version}/date-%{version}.tar.gz # The patch comes from https://github.com/HowardHinnant/date/compare/v%%{version}...master.diff # Mainly to fix the compilation problems in C++ 17+ compilers. %if 0%{?snap:1} Patch0: date-%{snap}.diff %endif BuildRequires: cmake BuildRequires: gcc-c++ %description A date and time library based on the C++11/14/17 chrono header. %package -n %{libname} Summary: Development files for Howard Hinnant's date library Group: Development/Libraries/C and C++ # Old SuSE name Obsoletes: hhdate-devel <= 3.0.1 %description -n %{libname} A date and time library based on the C++11/14/17 chrono header. %package -n %{develname} Summary: Development files for Howard Hinnant's date library Group: Development/Libraries/C and C++ Requires: %{libname} = %{version} Conflicts: %{name} <= %{version} # Old SuSE name Obsoletes: libdate-tz3 <= 3.0.1 %description -n %{develname} A date and time library based on the C++11/14/17 chrono header. %prep %autosetup -p1 %build %cmake -DBUILD_TZ_LIB=ON -DUSE_SYSTEM_TZ_DB=ON %cmake_build %install %cmake_install %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %files -n %{libname} %{_libdir}/libdate-tz.so.%{somajor}* %license LICENSE.txt %files -n %{develname} %license LICENSE.txt %{_includedir}/date/ %{_libdir}/cmake/date/ %{_libdir}/libdate-tz.so %changelog * Mon Jul 8 2024 Keith Bowes - Institute a live-at-head scheme, as recommended by the author * Thu Jul 4 2024 Keith Bowes - Rename library from hhdate to date - Use more Mageia-like package names * Mon Jan 9 2023 Filippo Bonazzi - Use local TZ database (https://bugzilla.opensuse.org/show_bug.cgi?id=1206951) - Remove now unnecessary libcurl build dependency * Wed Dec 7 2022 Filippo Bonazzi - Fix file conflicts with devel package * Tue Dec 6 2022 Soc Virnyl Estela - Clean up specfile: use `devel` instead of `-n hhdate-devel` - Improve description. It's based on the chrono header - Use %%cmake_install - Remove rpmlint errors: * Package is a library and does not include an executable * Create a libname package * add postun / post ldconfig declaration - Add license also in the libname * Thu Dec 1 2022 Filippo Bonazzi - Clean up spec file: redundant Provides in devel package * Thu Dec 1 2022 Filippo Bonazzi - Package version 3.0.1