summaryrefslogtreecommitdiffstats
path: root/libxlsxio.spec
blob: 60b23af4553bf89752708a8ea0786183983651fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# remirepo/fedora spec file for xlsxio
#
# Copyright (c) 2019-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_commit   cfd9ed517417000f5ffce428f2a4a7da0847c145
%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.29
Release:       2%{?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

BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake >= 2.6
BuildRequires: zlib-devel
# Ensure we use latest version
BuildRequires: libzip-devel >= 1.5
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

%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}

# 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 \
  -S .

%if 0%{?cmake_build:1}
%cmake_build
%else
make %{?_smp_mflags}
%endif


%install
%if 0%{?cmake_install:1}
%cmake_install
%else
make install DESTDIR=%{buildroot}
%endif

# Clean with old cmake version
rm -rf %{buildroot}%{_mandir}/man3/_builddir_*
# installed as %%doc
rm -rf %{buildroot}%{_datadir}/%{gh_project}


%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
%doc doc/html
%{_includedir}/xls*
%{_mandir}/man3/%{gh_project}*


%changelog
* Tue Aug 18 2020 Remi Collet <remi@remirepo.net> - 0.2.29-2
- F33 build

* Sat Jul 11 2020 Remi Collet <remi@remirepo.net> - 0.2.29-1
- update to 0.2.29

* Tue Jul  7 2020 Remi Collet <remi@remirepo.net> - 0.2.28-1
- update to 0.2.28

* Mon Jul  6 2020 Remi Collet <remi@remirepo.net> - 0.2.27-3
- test build for upstream patch

* Mon Jul  6 2020 Remi Collet <remi@remirepo.net> - 0.2.27-1
- update to 0.2.27
- open https://github.com/brechtsanders/xlsxio/issues/75
  behavior change in EMPTY management (infinite loop)

* Tue Mar 24 2020 Remi Collet <remi@remirepo.net> - 0.2.26-1
- update to 0.2.26
- drop patch merged upstream

* Sun Mar 22 2020 Remi Collet <remi@remirepo.net> - 0.2.25-1
- update to 0.2.25

* Thu Mar 19 2020 Remi Collet <remi@remirepo.net> - 0.2.24-2
- add patch for pec/xlswriter from
  https://github.com/viest/xlsxio

* Thu Mar 19 2020 Remi Collet <remi@remirepo.net> - 0.2.24-1
- update to 0.2.24
- drop patch merged upstream

* Tue Mar 10 2020 Remi Collet <remi@remirepo.net> - 0.2.22-1
- update to 0.2.22

* 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