diff options
author | Remi Collet <remi@remirepo.net> | 2019-09-16 12:15:21 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-09-16 12:15:21 +0200 |
commit | 7454538f1e42fb4929ec96cf6e4fb8b71b349bfb (patch) | |
tree | 02f6cf62f5cd706d526d6c03f098781dbad3ce0b |
New package
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | 53.patch | 22 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | libxlsxio.spec | 123 |
4 files changed, 158 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f69818 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.bz2 +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/53.patch b/53.patch new file mode 100644 index 0000000..4196663 --- /dev/null +++ b/53.patch @@ -0,0 +1,22 @@ +From 045156077073514f5838c0f6c813f5a5b5cfcc1b Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Mon, 16 Sep 2019 10:44:33 +0200 +Subject: [PATCH] fix format not a string literal and no format arguments + +--- + lib/xlsxio_write.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/xlsxio_write.c b/lib/xlsxio_write.c +index 0cc0c5d..84dc493 100644 +--- a/lib/xlsxio_write.c ++++ b/lib/xlsxio_write.c +@@ -858,7 +858,7 @@ void write_cell_data (xlsxiowriter handle, const char* rowattr, const char* pref + if (data)
+ fprintf(handle->pipe_write, "%s", data);
+ if (suffix)
+- fprintf(handle->pipe_write, suffix);
++ fprintf(handle->pipe_write, "%s", suffix);
+ } else {
+ //add cell data to buffer
+ if (prefix)
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/libxlsxio.spec b/libxlsxio.spec new file mode 100644 index 0000000..8150219 --- /dev/null +++ b/libxlsxio.spec @@ -0,0 +1,123 @@ +# remirepo/fedora spec file for xlsxio +# +# Copyright (c) 2019 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# + +%global gh_commit b2b39b91c5005b4edc78ff8145226338aaea1c2c +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner brechtsanders +%global gh_project xlsxio +%global libname lib%{gh_project} + +Name: %{gh_project} +Summary: XLSX tools from %{libname} +Version: 0.2.21 +Release: 1%{?dist} +License: MIT + +URL: https://github.com/%{gh_owner}/%{gh_project}/ +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz + +Patch0: https://patch-diff.githubusercontent.com/raw/brechtsanders/xlsxio/pull/53.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake >= 2.6 +BuildRequires: zlib-devel +BuildRequires: libzip-devel +BuildRequires: expat-devel +BuildRequires: doxygen + +Requires: %{libname}%{?_isa} = %{version}-%{release} + + +%description +This package provides XLSX commands using %{libname}: +- xlsxio_csv2xlsx +- xlsxio_xlsx2csv + + +%package -n %{libname} +Summary: C library for reading values from and writing values to .xlsx files +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n %{libname} +XLSX I/O aims to provide a C library for reading and writing .xlsx files. +The .xlsx file format is the native format used by Microsoft(R) Excel(TM) +since version 2007. + + +%package -n %{libname}-devel +Summary: Header files and development libraries for %{name} +Group: Development/Libraries +Requires: %{libname}%{?_isa} = %{version}-%{release} + +%description -n %{libname}-devel + +This package contains the header files and development libraries +for %{libname}. + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 + +# Fix installation layout +sed -e '/LIBRARY DESTINATION/s/lib/%{_lib}/' \ + -e 's/DESTINATION \./DESTINATION share/' \ + -i CMakeLists.txt + + +%build +# TODO: WITH_WIDE requires expatw + +%cmake \ + -DWITH_LIBZIP:BOOL=ON \ + -DBUILD_STATIC:BOOL=OFF \ + -DBUILD_EXAMPLES:BOOL=OFF \ + -DWITH_WIDE:BOOL=OFF \ + . + +make %{_smp_mflags} + + +%install +make install DESTDIR="%{buildroot}" + +# Clean with old cmake version +rm -rf %{buildroot}%{_mandir}/man3/_builddir_* + + +%if 0%{?fedora} < 28 && 0%{?rhel} < 8 +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig +%endif + + +%files +%{_bindir}/%{gh_project}* + + +%files -n %{libname} +%{!?_licensedir:%global license %%doc} +%license LICENSE.txt +%{_libdir}/%{libname}_*.so + + +%files -n %{libname}-devel +%doc *.md +%doc examples +%{_includedir}/xls* +%{_mandir}/man3/%{gh_project}* + + +%changelog +* Mon Sep 16 2019 Remi Collet <remi@remirepo.net> - 0.2.21-1 +- initial package +- add patch for -Werror=format-security from + https://github.com/brechtsanders/xlsxio/pull/53 |