summaryrefslogtreecommitdiff
path: root/packaging/libsolv.spec
blob: de1164b793eef272aeb6db352fbae7ad278a8c89 (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
Name:           libsolv
Version:        0.3.0
Release:        0
Url:            https://github.com/openSUSE/libsolv
Source:         libsolv-%{version}.tar.bz2

%bcond_without enable_static
%bcond_without perl_binding
%bcond_without python_binding

BuildRequires:  db4-devel
BuildRequires:  expat-devel
BuildRequires:  fdupes
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  rpm-devel
BuildRequires:  zlib-devel

%if %{with perl_binding}
BuildRequires:  perl
BuildRequires:  swig
%endif
%if %{with python_binding}
%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
BuildRequires:  python-devel
BuildRequires:  swig
%endif

Summary:        A new approach to package dependency solving
License:        BSD-3-Clause
Group:          System/Package Management

%description
A new approach to package dependency solving.

%package devel
Summary:        A new approach to package dependency solving
Group:          Development/Libraries
Requires:       libsolv-tools = %version
Requires:       libsolv = %version
Requires:       rpm-devel

%description devel
Development files for libsolv, a new approach to package dependency solving

%package tools
Summary:        A new approach to package dependency solving
Group:          Development/Libraries
Obsoletes:      satsolver-tools < 0.18
Provides:       satsolver-tools = 0.18
Requires:       gzip bzip2 coreutils findutils

%description tools
A new approach to package dependency solving.

%package demo
Summary:        Applications demoing the libsolv library
Group:          System/Package Management
Requires:       curl

%description demo
Applications demoing the libsolv library.

%package -n python-solv
Requires:       python
Summary:        Python bindings for the libsolv library
Group:          Platfrom Development/Python

%description -n python-solv
Python bindings for sat solver.

%package -n perl-solv
Requires:       perl = %{perl_version}
Summary:        Perl bindings for the libsolv library
Group:          Platfrom Development/Perl

%description -n perl-solv
Perl bindings for sat solver.

%prep
%setup -n libsolv-%{version}

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$CFLAGS"

CMAKE_FLAGS=
CMAKE_FLAGS="-DSUSE=1"

cmake   $CMAKE_FLAGS \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DLIB=%{_lib} \
	-DCMAKE_VERBOSE_MAKEFILE=TRUE \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
	%{?with_enable_static:-DENABLE_STATIC=1} \
	%{?with_perl_binding:-DENABLE_PERL=1} \
	%{?with_python_binding:-DENABLE_PYTHON=1} \
	-DUSE_VENDORDIRS=1 \
	-DCMAKE_SKIP_RPATH=1
make %{?jobs:-j %jobs}

%install
make DESTDIR=$RPM_BUILD_ROOT install
%if %{with python_binding}
pushd $RPM_BUILD_ROOT/%{python_sitearch}
python %py_libdir/py_compile.py *.py
python -O %py_libdir/py_compile.py *.py
popd
%endif
# we want to leave the .a file untouched
export NO_BRP_STRIP_DEBUG=true

%post  -p /sbin/ldconfig

%postun  -p /sbin/ldconfig

%files 
%defattr(-,root,root)
%license LICENSE*
%{_libdir}/libsolv.so.*
%{_libdir}/libsolvext.so.*

%files tools
%defattr(-,root,root)
%{_bindir}/solv
%{_bindir}/*

%files devel
%defattr(-,root,root)
%if %{with enable_static}
%{_libdir}/libsolv.a
%{_libdir}/libsolvext.a
%endif
%if !%{with disable_shared}
%{_libdir}/libsolv.so
%{_libdir}/libsolvext.so
%endif
%{_includedir}/solv
%{_bindir}/helix2solv
%{_datadir}/cmake/Modules/*

%files demo
%defattr(-,root,root)
%{_bindir}/solv

%if %{with perl_binding}
%files -n perl-solv
%defattr(-,root,root)
%{perl_vendorarch}/*
%endif

%if %{with python_binding}
%files -n python-solv
%defattr(-,root,root)
%{python_sitearch}/*
%endif

%changelog