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