- build binding subpackages
[platform/upstream/libsolv.git] / package / libsolv.spec.in
1 Name:           libsolv
2 Version:        @VERSION@
3 Release:        1
4 License:        BSD 3-Clause
5 Url:            git://gitorious.org/opensuse/libsolv.git
6 Source:         libsolv-%{version}.tar.bz2
7 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
8 Group:          Development/Libraries/C and C++
9 Prefix:         /usr
10
11 %bcond_without perl_binding
12 %bcond_without python_binding
13 %bcond_without ruby_binding
14
15 %if 0%{?mandriva_version}
16 # force this version on mandriva
17 BuildRequires:  libneon0.26-devel
18 %endif
19 %if 0%{?fedora_version}
20 BuildRequires:  db4-devel
21 %endif
22 %if 0%{?suse_version}
23 %if 0%{?suse_version} < 1030
24 BuildRequires:  expat
25 %else
26 BuildRequires:  libexpat-devel
27 %endif
28 %if 0%{?suse_version} < 1100
29 BuildRequires:  graphviz
30 %endif
31 %if 0%{?suse_version} > 1020
32 BuildRequires:  fdupes
33 %endif
34 %else
35 BuildRequires:  expat-devel
36 %endif
37 BuildRequires:  cmake rpm-devel gcc-c++
38 BuildRequires:  zlib-devel
39
40 %if %{with perl_binding}
41 BuildRequires: perl
42 %endif
43 %if %{with ruby_binding}
44 %global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"] ')}
45 BuildRequires: ruby-devel
46 %endif
47 %if %{with python_binding}
48 BuildRequires: python-devel
49 %endif
50
51 Summary:        A new approach to package dependency solving
52
53
54 %description
55 A new approach to package dependency solving
56
57 Authors:
58 --------
59     Michael Schroeder <mls@suse.de>
60     Klaus Kaempf <kkaempf@suse.de>
61     Stephan Kulow <coolo@suse.de>
62     Michael Matz <matz@suse.de>
63     Duncan Mac-Vicar P. <dmacvicar@suse.de>
64
65 %package -n libsolv@LIBSOLV_SOVERSION@
66 Summary:        A new approach to package dependency solving
67 Group:          Development/Libraries/C and C++
68
69 %description -n libsolv@LIBSOLV_SOVERSION@
70 A new approach to package dependency solving
71
72 Authors:
73 --------
74     Michael Schroeder <mls@suse.de>
75     Klaus Kaempf <kkaempf@suse.de>
76     Stephan Kulow <coolo@suse.de>
77     Michael Matz <matz@suse.de>
78     Duncan Mac-Vicar P. <dmacvicar@suse.de>
79
80 %package devel
81 Summary:        A new approach to package dependency solving
82 Group:          Development/Libraries/C and C++
83 Requires:       libsolv-tools = %version
84 Requires:       rpm-devel
85
86 %description devel
87 Development files for libsolv, a new approach to package dependency solving
88
89 Authors:
90 --------
91     Michael Schroeder <mls@suse.de>
92     Klaus Kaempf <kkaempf@suse.de>
93     Stephan Kulow <coolo@suse.de>
94     Michael Matz <matz@suse.de>
95     Duncan Mac-Vicar P. <dmacvicar@suse.de>
96
97 %package tools
98 Summary:        A new approach to package dependency solving
99 Group:          Development/Libraries/C and C++
100 Obsoletes:      libsatsolver <= 0.0.15
101 Provides:       libsatsolver = %{version}-%{release}
102 Requires:       gzip bzip2 coreutils
103
104 %description tools
105 A new approach to package dependency solving.
106
107 %package demo
108 Summary:        Applications demoing the libsolv library
109 Group:          System/Management
110 Requires:       curl
111 %if 0%{?fedora_version}
112 Requires:       gnupg2
113 %endif
114 %if 0%{?suse_version}
115 Requires:       gpg2
116 %endif
117
118 %description demo
119 Applications demoing the libsolv library.
120
121 %package -n ruby-solv
122 Summary:        Ruby bindings for the libsolv library
123 Group:          Development/Languages/Ruby
124
125 %description -n ruby-solv
126 Ruby bindings for sat solver.
127
128 %package -n python-solv
129 %py_requires
130 Summary:        Python bindings for the libsolv library
131 Group:          Development/Languages/Python
132
133 %description -n python-solv
134 Python bindings for sat solver.
135
136 %package -n perl-solv
137 Requires:       perl = %{perl_version}
138 Summary:        Perl bindings for the libsolv library
139 Group:          Development/Languages/Perl
140
141 %description -n perl-solv
142 Perl bindings for sat solver.
143
144 %prep
145 %setup -n libsolv-%{version}
146
147 %build
148 export CFLAGS="$RPM_OPT_FLAGS"
149 export CXXFLAGS="$CFLAGS"
150
151 CMAKE_FLAGS=
152 %if 0%{?fedora_version}
153 CMAKE_FLAGS="-DFEDORA=1"
154 %endif
155
156 cmake   $CMAKE_FLAGS \
157         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
158         -DLIB=%{_lib} \
159         -DCMAKE_VERBOSE_MAKEFILE=TRUE \
160         -DCMAKE_BUILD_TYPE=Release \
161         %{?with_perl_binding:-DENABLE_PERL=1} \
162         %{?with_python_binding:-DENABLE_PYTHON=1} \
163         %{?with_ruby_binding:-DENABLE_RUBYL=1} \
164         -DUSE_VENDORDIRS=1 \
165         -DCMAKE_SKIP_RPATH=1 
166 make %{?jobs:-j %jobs}
167
168 %install
169 make DESTDIR=$RPM_BUILD_ROOT install
170 # we want to leave the .a file untouched
171 export NO_BRP_STRIP_DEBUG=true
172
173 %clean
174 rm -rf "$RPM_BUILD_ROOT"
175
176 %files -n libsolv@LIBSOLV_SOVERSION@
177 %defattr(-,root,root)
178 %doc LICENSE*
179 %_libdir/libsolv.so.*
180 %_libdir/libsolvext.so.*
181
182 %files tools
183 %defattr(-,root,root)
184 %exclude /usr/bin/helix2solv
185 %exclude /usr/bin/solv
186 /usr/bin/*
187
188 %files devel
189 %defattr(-,root,root)
190 %_libdir/libsolv.so
191 %_libdir/libsolvext.so
192 /usr/include/solv
193 /usr/bin/helix2solv
194
195 %files demo
196 %defattr(-,root,root)
197 /usr/bin/solv
198
199 %if %{with perl_binding}
200 %files -n perl-solv
201 %defattr(-,root,root)
202 %{perl_vendorarch}/*
203 %endif
204
205 %if %{with ruby_binding}
206 %files -n ruby-solv
207 %defattr(-,root,root)
208 %{ruby_vendorarch}/*
209 %endif
210
211 %if %{with python_binding}
212 %files -n python-solv
213 %{ruby_vendorarch}/*
214 %defattr(-,root,root)
215 %{py_sitedir}/*
216 %endif
217
218 %changelog