diff --git a/.gitignore b/.gitignore index 0267e3d..eb4c03f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ shapelib-1.3.0b2.tar.gz /shapelib-1.4.1.tar.gz /shapelib-man.tar.gz /shapelib-1.5.0.tar.gz +/shapelib-1.6.0.tar.gz +/shapelib-1.6.1.tar.gz +/shapelib-1.6.2.tar.gz +/shapelib-1.6.3.tar.gz diff --git a/shapelib.spec b/shapelib.spec index 69d211a..2f183d3 100644 --- a/shapelib.spec +++ b/shapelib.spec @@ -1,15 +1,21 @@ #global pre RC1 +%if %{defined rhel} || %{defined flatpak} +%bcond_with mingw +%else +%bcond_without mingw +%endif + Name: shapelib -Version: 1.5.0 -Release: 5%{?pre:.%pre}%{?dist} +Version: 1.6.3 +Release: 2%{?dist} Summary: C library for handling ESRI Shapefiles # The core library is dual-licensed LGPLv2 or MIT. # Some contributed files have different licenses: # - contrib/csv2shp.c: GPLv2+ # - contrib/dbfinfo.c: Public domain # - contrib/dbfcat.c: Public domain -License: (LGPLv2+ or MIT) and GPLv2+ and Public Domain +License: (LGPL-2.0-or-later OR MIT) AND GPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain URL: http://shapelib.maptools.org/ Source0: http://download.osgeo.org/shapelib/%{name}-%{version}%{?pre:%pre}.tar.gz # Man pages from debian package @@ -18,14 +24,28 @@ Source0: http://download.osgeo.org/shapelib/%{name}-%{version}%{?pre:%pre} # tar -czf shapelib-man.tar.gz man/ # rm -r man Source1: %{name}-man.tar.gz +# Add library version suffix for mingw dlls +Patch1: shapelib_libver.patch -BuildRequires: automake autoconf libtool +BuildRequires: cmake BuildRequires: gcc-c++ -BuildRequires: make BuildRequires: proj-devel >= 4.4.1 # For man pages BuildRequires: rubygem-ronn +%if %{with mingw} +BuildRequires: mingw32-filesystem +BuildRequires: mingw32-gcc-c++ +BuildRequires: mingw32-binutils +BuildRequires: mingw32-proj + +BuildRequires: mingw64-filesystem +BuildRequires: mingw64-gcc-c++ +BuildRequires: mingw64-binutils +BuildRequires: mingw64-proj +%endif + + %description The Shapefile C Library provides the ability to write simple C programs for reading, writing and updating (to a @@ -49,49 +69,182 @@ Requires: %{name}%{?_isa} = %{version}-%{release} This package contains various utility programs distributed with shapelib. +%if %{with mingw} +%package -n mingw32-%{name} +Summary: MinGW Windows %{name} library +BuildArch: noarch +Obsoletes: mingw32-%{name}-static < 1.6.2-1 +Provides: mingw32-%{name}-static = %{version}-%{release} + +%description -n mingw32-%{name} +%{summary}. + + +%package -n mingw32-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw32-%{name} = %{version}-%{release} +BuildArch: noarch + +%description -n mingw32-%{name}-tools +%{summary}. + + +%package -n mingw64-%{name} +Summary: MinGW Windows %{name} library +BuildArch: noarch +Obsoletes: mingw64-%{name}-static < 1.6.2-1 +Provides: mingw64-%{name}-static = %{version}-%{release} + +%description -n mingw64-%{name} +%{summary}. + + +%package -n mingw64-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw64-%{name} = %{version}-%{release} +BuildArch: noarch + +%description -n mingw64-%{name}-tools +%{summary}. +%endif + + +%{?mingw_debug_package} + + %prep -%autosetup -a1 +%autosetup -p1 -a1 %build -# Kill rpath -autoreconf -ifv +# Native build +%cmake -DBUILD_TESTING=OFF -DUSE_RPATH=OFF -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_CMAKEDIR=%{_libdir}/cmake/%{name} +%cmake_build -%configure --disable-static -%make_build +%if %{with mingw} +# MinGW build +MINGW32_CMAKE_ARGS="-DCMAKE_INSTALL_CMAKEDIR=%{mingw32_libdir}/cmake/%{name}" \ +MINGW64_CMAKE_ARGS="-DCMAKE_INSTALL_CMAKEDIR=%{mingw64_libdir}/cmake/%{name}" \ +%mingw_cmake -DBUILD_TESTING=OFF +%mingw_make_build +%endif %install -%make_install - -# Remove static libraries -find %{buildroot} -name '*.la' -exec rm -f {} ';' +%cmake_install +%if %{with mingw} +%mingw_make_install +%endif # Build man pages ronn -r --date="$(LC_ALL=C date -u "+%Y-%m-%d")" --manual=%{name} man/*.md mkdir -p %{buildroot}%{_mandir}/man1/ install -pm 0644 man/*.1 %{buildroot}%{_mandir}/man1/ -%ldconfig_scriptlets + +%{?mingw_debug_install_post} %files %doc README README.tree ChangeLog web/*.html -%license COPYING -%{_libdir}/libshp.so.2* +%license LICENSE* +%{_libdir}/libshp.so.%{version} +%{_libdir}/libshp.so.4* %files devel %{_includedir}/shapefil.h %{_libdir}/libshp.so %{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/cmake/%{name}/ %files tools %doc contrib/doc/ %{_bindir}/* %{_mandir}/man1/*.1* +%if %{with mingw} +%files -n mingw32-%{name} +%license LICENSE* +%{mingw32_bindir}/libshp-4.dll +%{mingw32_includedir}/shapefil.h +%{mingw32_libdir}/libshp.dll.a +%{mingw32_libdir}/pkgconfig/shapelib.pc +%{mingw32_libdir}/cmake/%{name}/ + +%files -n mingw32-%{name}-tools +%{mingw32_bindir}/*.exe + +%files -n mingw64-%{name} +%license LICENSE* +%{mingw64_bindir}/libshp-4.dll +%{mingw64_includedir}/shapefil.h +%{mingw64_libdir}/libshp.dll.a +%{mingw64_libdir}/pkgconfig/shapelib.pc +%{mingw64_libdir}/cmake/%{name}/ + +%files -n mingw64-%{name}-tools +%{mingw64_bindir}/*.exe +%endif + %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 1.6.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Thu Mar 19 2026 Sandro Mani - 1.6.3-1 +- Update to 1.6.3 + +* Sat Jan 17 2026 Fedora Release Engineering - 1.6.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Tue Sep 23 2025 Sandro Mani - 1.6.2-1 +- Update to 1.6.2 + +* Fri Jul 25 2025 Fedora Release Engineering - 1.6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 1.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Wed Aug 14 2024 Sandro Mani - 1.6.1-1 +- Update to 1.6.1 + +* Sat Jul 20 2024 Fedora Release Engineering - 1.6.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 1.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Dec 22 2023 Sandro Mani - 1.6.0-1 +- Update to 1.6.0 + +* Sat Jul 22 2023 Fedora Release Engineering - 1.5.0-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 1.5.0-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1.5.0-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Mar 25 2022 Sandro Mani - 1.5.0-13 +- Rebuild with mingw-gcc-12 + +* Wed Mar 02 2022 Sandro Mani - 1.5.0-12 +- Backport fix for CVE-2022-0699 + +* Thu Feb 24 2022 Sandro Mani - 1.5.0-11 +- Make mingw subpackages noarch + +* Thu Feb 24 2022 Sandro Mani - 1.5.0-10 +- Make mingw subpackages noarch + +* Thu Feb 24 2022 Sandro Mani - 1.5.0-9 +- Add mingw subpackage + +* Sat Jan 22 2022 Fedora Release Engineering - 1.5.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 1.5.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/shapelib_libver.patch b/shapelib_libver.patch new file mode 100644 index 0000000..f8ba064 --- /dev/null +++ b/shapelib_libver.patch @@ -0,0 +1,13 @@ +diff -rupN --no-dereference shapelib-1.6.3/CMakeLists.txt shapelib-1.6.3-new/CMakeLists.txt +--- shapelib-1.6.3/CMakeLists.txt 2026-03-18 17:27:15.000000000 +0100 ++++ shapelib-1.6.3-new/CMakeLists.txt 2026-03-19 14:28:33.599270296 +0100 +@@ -176,6 +176,9 @@ set_target_properties(${PACKAGE} PROPERT + SOVERSION ${shp_SOVERSION} + VERSION ${shp_VERSION} + ) ++if(MINGW) ++ set_target_properties(${PACKAGE} PROPERTIES SUFFIX "-${shp_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++endif(MINGW) + + if(USE_RPATH) + set_target_properties(${PACKAGE} PROPERTIES diff --git a/sources b/sources index e3e0194..412e1b9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ +SHA512 (shapelib-1.6.3.tar.gz) = 9cb5625f6b94ca2f48c222b5adaee0d9955b70f621c51bc54a47e922e9b6ac547bc3efaf67df56ecb3829d9313d57c85afa46cf00a7e03f779c694407e371943 SHA512 (shapelib-man.tar.gz) = 0625355e51005b032c2ea441d888868fa13bcdee862d9c5bae5aa26cb98e40e7eeb414f52dc63d433692dbe3873d037740e8bf650a30e6e4d56b216d48bda6da -SHA512 (shapelib-1.5.0.tar.gz) = 6dbd5fc7929ca403e65017ef58211f351608d9ad08221bf68bde047ceecfd27013ce731f9ae4edcfd040bc3db7fe9054b5d96e46128d2968788bef19532b1721