# # 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-tz %{somajor} %define develname %mklibname date-tz -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.4 # 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) Release: %mkrel %{?opensuse_release:%{opensuse_release}+}%{?snap:git%{snap}.}2.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 newer C++ compilers. %if 0%{?snap:1} Patch0: date-%{snap}.diff %endif Patch1: date-3.0.4-fix-gcc14-ambiguity.diff %if 0%{?mageia} >= 10 Patch2: https://github.com/HowardHinnant/date/pull/538.patch#/date-output-pc-for-pkg-config.patch %endif BuildRequires: cmake BuildRequires: make 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; now the name on 32-bit systems, so don't obsolete Provides: libdate-tz3 = %{version}-%{release} # Older name, supplanted by the official one used by Mageia Obsoletes: %{mklibname date %{somajor}} <= %{version}-%{release} Provides: %{mklibname date %{somajor}} = %{version}-%{release} %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: hhdate-devel <= 3.0.1 Provides: hhdate-devel = %{version}-%{release} # Older name, supplanted by the official one used by Mageia Obsoletes: %{mklibname date -d} <= %{version}-%{release} Provides: %{mklibname date -d} = %{version}-%{release} %description -n %{develname} A date and time library based on the C++11/14/17 chrono header. %prep %autosetup -p1 %build %cmake -B build -DBUILD_TZ_LIB=ON -DUSE_SYSTEM_TZ_DB=ON %make_build -C build %install %if 0%{?suse_version} %make_install -C build/build %else %make_install -C build %endif %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 %if 0%{?mageia} >= 10 %{_libdir}/pkgconfig/%{name}.pc %endif %changelog * 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