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
|
---|
22 | Name: tinyxml2
|
---|
23 | Version: 9.0.0
|
---|
24 | Release: 1%{?dist}
|
---|
25 | Vendor: TeLLie
|
---|
26 | Summary: Basic XML parser in C++
|
---|
27 | License: Zlib
|
---|
28 | Group: Development/Libraries/C and C++
|
---|
29 | URL: https://github.com/leethomason/tinyxml2
|
---|
30 | %if !0%{?os2_version}
|
---|
31 | Source: 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
|
---|
35 | BuildRequires: cmake >= 3.15
|
---|
36 | BuildRequires: gcc-c++
|
---|
37 | BuildRequires: pkgconfig
|
---|
38 |
|
---|
39 | %description
|
---|
40 | TinyXML is a feature-bounded XML parser in C++ that can be integrated
|
---|
41 | into other programs.
|
---|
42 |
|
---|
43 | TinyXML-2 does not parse or use DTDs (Document Type Definitions) or
|
---|
44 | XSLs (eXtensible Stylesheet Language). There are other parsers (with
|
---|
45 | different footprints) to do such.
|
---|
46 |
|
---|
47 | %package -n %{lib_package}
|
---|
48 | Summary: Basic XML parser in C++
|
---|
49 | License: Zlib
|
---|
50 | Group: System/Libraries
|
---|
51 |
|
---|
52 | %description -n %{lib_package}
|
---|
53 | TinyXML is a feature-bounded XML parser in C++ that can be integrated
|
---|
54 | into other programs.
|
---|
55 |
|
---|
56 | TinyXML-2 does not parse or use DTDs (Document Type Definitions) or
|
---|
57 | XSLs (eXtensible Stylesheet Language). There are other parsers (with
|
---|
58 | different footprints) to do such.
|
---|
59 |
|
---|
60 | %package devel
|
---|
61 | Summary: Development files for libtinyxml2
|
---|
62 | License: GPL-2.0-or-later
|
---|
63 | Group: Development/Libraries/C and C++
|
---|
64 | %if !0%{?os2_version}
|
---|
65 | Requires: %{lib_package} = %{version}
|
---|
66 | %else
|
---|
67 | Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
---|
68 | %endif
|
---|
69 | %description devel
|
---|
70 | Contains libraries and header files for
|
---|
71 | developing applications that use libtinyxml2.
|
---|
72 |
|
---|
73 | %debug_package
|
---|
74 |
|
---|
75 | %prep
|
---|
76 | %if !0%{?os2_version}
|
---|
77 | %setup -q
|
---|
78 | %else
|
---|
79 | %scm_setup
|
---|
80 | chmod -c -x *.cpp *.h
|
---|
81 | %endif
|
---|
82 |
|
---|
83 | %build
|
---|
84 | %if 0%{?os2_version}
|
---|
85 | mkdir builder
|
---|
86 | cd builder
|
---|
87 | export LDFLAGS="-Zhigh-mem -Zomf -lcx"
|
---|
88 | export CFLAGS="-O2 -g -march=i686"
|
---|
89 | export CXXFLAGS="-O2 -g -march=i686"
|
---|
90 | export FFLAGS="-O2 -g -march=i686"
|
---|
91 | export FCFLAGS="-O2 -g -march=i686"
|
---|
92 |
|
---|
93 | cmake -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
|
---|
101 | make %{?_smp_mflags}
|
---|
102 | %else
|
---|
103 | %cmake
|
---|
104 | %make_build
|
---|
105 | %endif
|
---|
106 |
|
---|
107 | %install
|
---|
108 | %if !0%{?os2_version}
|
---|
109 | %cmake_install
|
---|
110 | find %{buildroot} -type f -name "*.la" -delete -print
|
---|
111 | # /usr/lib/cmake is not owned by cmake; avoid any further conflicts
|
---|
112 | if [ ! -d "%{buildroot}/%{_libdir}/cmake/%{name}" ]; then
|
---|
113 | mkdir -p %{buildroot}/%{_libdir}/cmake/%{name}
|
---|
114 | mv %{buildroot}%{_prefix}/lib/cmake/tinyxml2 %{buildroot}/%{_libdir}/cmake/tinyxml2
|
---|
115 | fi
|
---|
116 | %else
|
---|
117 | rm -rf %{buildroot}
|
---|
118 | cd builder
|
---|
119 | make install DESTDIR=%{buildroot}
|
---|
120 | %endif
|
---|
121 |
|
---|
122 | %check
|
---|
123 | %if !0%{?os2_version}
|
---|
124 | %make_build test
|
---|
125 | %else
|
---|
126 | cd builder
|
---|
127 | export BEGINLIBPATH=%{_builddir}/%{buildsubdir}/builder
|
---|
128 | make -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
|
---|