source: spec/trunk/SPECS/tinyxml2.spec

Last change on this file was 1811, checked in by tellie, 3 years ago

spec: tinyxml2: Release version 9.0.0-1.

File size: 4.5 KB
Line 
1#
2# spec file for package tinyxml2
3#
4# Copyright (c) 2021 SUSE LLC
5#
6# All modifications and additions to the file contributed by third parties
7# remain the property of their copyright owners, unless otherwise agreed
8# upon. The license for this file, and modifications and additions to the
9# file, is the same license as for the pristine package itself (unless the
10# license for the pristine package is not an Open Source License, in which
11# case the license is the MIT License). An "Open Source License" is a
12# license that conforms to the Open Source Definition (Version 1.9)
13# published by the Open Source Initiative.
14
15# Please submit bugfixes or comments via https://bugs.opensuse.org/
16#
17
18%if !0%{?os2_version}
19%define so_version 9
20%define lib_package lib%{name}-%{so_version}
21%endif
22Name: tinyxml2
23Version: 9.0.0
24Release: 1%{?dist}
25Vendor: TeLLie
26Summary: Basic XML parser in C++
27License: Zlib
28Group: Development/Libraries/C and C++
29URL: https://github.com/leethomason/tinyxml2
30%if !0%{?os2_version}
31Source: https://github.com/leethomason/tinyxml2/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
32%else
33%scm_source github https://github.com/Tellie/%{name}-os2 master-os2
34%endif
35BuildRequires: cmake >= 3.15
36BuildRequires: gcc-c++
37BuildRequires: pkgconfig
38
39%description
40TinyXML is a feature-bounded XML parser in C++ that can be integrated
41into other programs.
42
43TinyXML-2 does not parse or use DTDs (Document Type Definitions) or
44XSLs (eXtensible Stylesheet Language). There are other parsers (with
45different footprints) to do such.
46
47%package -n %{lib_package}
48Summary: Basic XML parser in C++
49License: Zlib
50Group: System/Libraries
51
52%description -n %{lib_package}
53TinyXML is a feature-bounded XML parser in C++ that can be integrated
54into other programs.
55
56TinyXML-2 does not parse or use DTDs (Document Type Definitions) or
57XSLs (eXtensible Stylesheet Language). There are other parsers (with
58different footprints) to do such.
59
60%package devel
61Summary: Development files for libtinyxml2
62License: GPL-2.0-or-later
63Group: Development/Libraries/C and C++
64%if !0%{?os2_version}
65Requires: %{lib_package} = %{version}
66%else
67Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
68%endif
69%description devel
70Contains libraries and header files for
71developing applications that use libtinyxml2.
72
73%debug_package
74
75%prep
76%if !0%{?os2_version}
77%setup -q
78%else
79%scm_setup
80chmod -c -x *.cpp *.h
81%endif
82
83%build
84%if 0%{?os2_version}
85mkdir builder
86cd builder
87export LDFLAGS="-Zhigh-mem -Zomf -lcx"
88export CFLAGS="-O2 -g -march=i686"
89export CXXFLAGS="-O2 -g -march=i686"
90export FFLAGS="-O2 -g -march=i686"
91export FCFLAGS="-O2 -g -march=i686"
92
93cmake -DCMAKE_INSTALL_PREFIX:PATH=/@unixroot/usr \
94 -DCMAKE_SKIP_RPATH:BOOL=YES \
95 -DBUILD_SHARED_LIBS=ON \
96 -DCMAKE_BUILD_TYPE=Release \
97 -DOS2_USE_CXX_EMXEXP=ON \
98 -DBUILD_TESTING=ON \
99 -Wno-dev \
100 .. 2>stdout 1>stderr
101make %{?_smp_mflags}
102%else
103%cmake
104%make_build
105%endif
106
107%install
108%if !0%{?os2_version}
109%cmake_install
110find %{buildroot} -type f -name "*.la" -delete -print
111# /usr/lib/cmake is not owned by cmake; avoid any further conflicts
112if [ ! -d "%{buildroot}/%{_libdir}/cmake/%{name}" ]; then
113mkdir -p %{buildroot}/%{_libdir}/cmake/%{name}
114mv %{buildroot}%{_prefix}/lib/cmake/tinyxml2 %{buildroot}/%{_libdir}/cmake/tinyxml2
115fi
116%else
117rm -rf %{buildroot}
118cd builder
119make install DESTDIR=%{buildroot}
120%endif
121
122%check
123%if !0%{?os2_version}
124%make_build test
125%else
126cd builder
127export BEGINLIBPATH=%{_builddir}/%{buildsubdir}/builder
128make -k test
129%endif
130
131%if !0%{?os2_version}
132%post -n %{lib_package} -p /sbin/ldconfig
133%postun -n %{lib_package} -p /sbin/ldconfig
134%endif
135
136%files
137%defattr(-,root,root,-)
138%license LICENSE.txt
139%doc readme.md
140%if !0%{?os2_version}
141%{_libdir}/libtinyxml2.so.%{so_version}*
142%else
143%{_libdir}/tinyxml9.dll
144%endif
145
146%files devel
147%license LICENSE.txt
148%{_includedir}/tinyxml2.h
149%if !0%{?os2_version}
150%{_libdir}/libtinyxml2.so
151%else
152%{_libdir}/tinyxml2_dll.a
153%endif
154%{_libdir}/pkgconfig/tinyxml2.pc
155%{_libdir}/cmake/tinyxml2
156
157%changelog
158* Thu Apr 28 2022 Elbert Pol <elbert.pol@gmail.com> - 9.0.0 -1
159- Updated to latest version
160- Add os2 specification
161
162* Sun May 05 2019 Elbert Pol <elbert.pol@gmail.com> - 7.0.1-2
163- Add debug package
164
165* Sat May 04 2019 Elbert Pol <elbert.pol@gmail.com> - 7.0.1-1
166- Updated to latest source
167- Fix wrong dll place
168
169* Fri May 11 2018 Elbert Pol <elbert.pol@gmail.com> - 6.2.0-1
170- initial rpm for OS2
171- Add buildlevel os2
Note: See TracBrowser for help on using the repository browser.