forked from rpm-software-management/libcomps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libcomps.spec.in
156 lines (123 loc) · 3.52 KB
/
libcomps.spec.in
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
%global commit ${GITREVLONG}
%if 0%{?rhel} && 0%{?rhel} <= 7
%define python3_build 0
#%{!?__python2: %global __python2 /usr/bin/python2}
#%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
#%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%else
%define python3_build 1
%endif
Name: libcomps
Version: ${VERSION}
Release: ${libcomps_RELEASE}%{?dist}
Summary: Comps XML file manipulation library
Group: Development/Libraries
License: GPLv2+
URL: https://github.com/midnightercz/libcomps/
Source0: https://github.com/midnightercz/libcomps/${SOURCE_URL_PATH}
BuildRequires: libxml2-devel
BuildRequires: check-devel
BuildRequires: expat-devel
#%if 0%{?rhel} == 6
#BuildRequires: cmake28
#%else
BuildRequires: cmake
#%endif
%description
Libcomps is library for structure-like manipulation with content of
comps XML files. Supports read/write XML file, structure(s) modification.
%package doc
Summary: Documentation files for libcomps library
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
BuildRequires: doxygen
%description doc
Documentation files for libcomps library
%package -n python-libcomps-doc
Summary: Documentation files for python bindings libcomps library
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
BuildRequires: python-sphinx
%description -n python-libcomps-doc
Documentation files for python bindings libcomps library
%package devel
Summary: Development files for libcomps library
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development files for libcomps library
%package -n python-libcomps
Summary: Python2 bindings for libcomps library
Group: Development/Libraries
BuildRequires: python-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python-libcomps
Python2 bindings for libcomps library
%if %python3_build
%package -n python3-libcomps
Summary: Python3 bindings for libcomps library
Group: Development/Libraries
BuildRequires: python3-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python3-libcomps
Python3 bindings for libcomps library
%endif
%prep
%setup -qn %{name}-%{commit}
%if %python3_build == 1
rm -rf py3
mkdir ../py3
cp -a . ../py3/
mv ../py3 ./
%endif
%build
%cmake -DPYTHON_DESIRED:STRING=2 libcomps/
make %{?_smp_mflags}
make %{?_smp_mflags} docs
make %{?_smp_mflags} pydocs
%if %python3_build == 1
pushd py3
%cmake -DPYTHON_DESIRED:STRING=3 libcomps/
make %{?_smp_mflags}
popd
%endif
%check
make test
%if %{python3_build}
pushd py3
make pytest
popd
%endif
%install
make install DESTDIR=%{buildroot}
%if %{python3_build}
pushd py3
make install DESTDIR=%{buildroot}
popd
%endif
%clean
rm -rf $buildroot
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%{_libdir}/libcomps.so.*
%doc README.md COPYING
%files devel
%{_libdir}/libcomps.so
%{_includedir}/*
%files doc
%doc docs/libcomps-doc/html
%files -n python-libcomps-doc
%doc src/python/docs/html
%files -n python-libcomps
%{_libdir}/python2*
#%exclude %{_libdir}/python2/libcomps/__pycache__
%if %{python3_build}
%files -n python3-libcomps
%{_libdir}/python3*
#%exclude %{_libdir}/python3/libcomps/__pycache__
%endif
%changelog
${CHANGELOG}