]> git.pld-linux.org Git - packages/libcomps.git/blob - libcomps.spec
315ea080c64e12dc751038fcb073edab26a51319
[packages/libcomps.git] / libcomps.spec
1 #
2 # TODO
3 # - fix missing -lm
4 # - convince upstream to fix SONAME: libcomps.so.0.1.6
5 #
6 # Conditional build:
7 %bcond_without  doc             # don't build doc
8 %bcond_without  python2 # CPython 2.x module
9 %bcond_without  python3 # CPython 3.x module
10
11 Summary:        Comps XML file manipulation library
12 Name:           libcomps
13 Version:        0.1.6
14 Release:        1
15 License:        GPL v2+
16 Group:          Development/Libraries
17 Source0:        https://github.com/midnightercz/libcomps/archive/%{name}-%{version}.tar.gz
18 # Source0-md5:  50611b9564f15b6a06e0f40f7683a0f0
19 URL:            https://github.com/midnightercz/libcomps/
20 BuildRequires:  check-devel
21 BuildRequires:  cmake
22 %{?with_doc:BuildRequires:      doxygen}
23 BuildRequires:  expat-devel
24 BuildRequires:  libxml2-devel
25 %{?with_doc:BuildRequires:      python-Sphinx}
26 %{?with_python2:BuildRequires:  python-devel}
27 %{?with_python3:BuildRequires:  python3-devel}
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 # Unresolved symbols: log10
31 %define         skip_post_check_so      libcomps.so.%{version}
32
33 %description
34 Libcomps is library for structure-like manipulation with content of
35 comps XML files. Supports read/write XML file, structure(s)
36 modification.
37
38 %package devel
39 Summary:        Development files for libcomps library
40 Group:          Development/Libraries
41 Requires:       %{name} = %{version}-%{release}
42
43 %description devel
44 Development files for libcomps library
45
46 %package -n python-libcomps
47 Summary:        Python2 bindings for libcomps library
48 Group:          Development/Libraries
49 Requires:       %{name} = %{version}-%{release}
50
51 %description -n python-libcomps
52 Python2 bindings for libcomps library
53
54 %package -n python3-libcomps
55 Summary:        Python3 bindings for libcomps library
56 Group:          Development/Libraries
57 Requires:       %{name} = %{version}-%{release}
58
59 %description -n python3-libcomps
60 Python3 bindings for libcomps library
61
62 %prep
63 %setup -qn %{name}-%{name}-%{version}
64
65 %if %{with python3}
66 rm -rf py3
67 set -- *
68 install -d py3
69 cp -a "$@" py3
70 %endif
71
72 %build
73 %cmake \
74         -DPYTHON_DESIRED:STRING=2 \
75         libcomps/
76
77 %{__make}
78 %{__make} docs
79 %{__make} pydocs
80
81 %if %{with python3}
82 cd py3
83 %cmake \
84         -DPYTHON_DESIRED:STRING=3 \
85         libcomps/
86 %{__make}
87 cd -
88 %endif
89
90 %if %{with tests}
91 %{__make} test
92 %if %{with python3}
93 cd py3
94 %{__make} pytest
95 cd -
96 %endif
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 %{__make} install \
102         DESTDIR=$RPM_BUILD_ROOT
103
104 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
105 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
106 %py_postclean
107
108 %if %{with python3}
109 cd py3
110 %{__make} install \
111         DESTDIR=$RPM_BUILD_ROOT
112
113 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
114 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
115 cd -
116 %endif
117
118 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %post   -p /sbin/ldconfig
124 %postun -p /sbin/ldconfig
125
126 %files
127 %defattr(644,root,root,755)
128 %doc README.md COPYING
129 %attr(755,root,root) %{_libdir}/libcomps.so.0.1.6
130
131 %files devel
132 %defattr(644,root,root,755)
133 %doc docs/libcomps-doc/html
134 %doc src/python/docs/html
135 %{_libdir}/libcomps.so
136 %{_includedir}/libcomps
137
138 %files -n python-libcomps
139 %defattr(644,root,root,755)
140 %dir %{py_sitedir}/libcomps
141 %{py_sitedir}/libcomps/__init__.py[co]
142 %attr(755,root,root) %{py_sitedir}/libcomps/_libpycomps.so
143
144 %if %{with python3}
145 %files -n python3-libcomps
146 %defattr(644,root,root,755)
147 %dir %{py3_sitedir}/libcomps
148 %{py3_sitedir}/libcomps/__init__.py
149 %attr(755,root,root) %{py3_sitedir}/libcomps/_libpycomps.so
150 %{py3_sitedir}/libcomps/__pycache__
151 %endif
This page took 0.078949 seconds and 2 git commands to generate.