fix spec
[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:       rpm-devel
90
91 %description devel
92 Development files for libsolv, a new approach to package dependency solving
93
94 Authors:
95 --------
96     Michael Schroeder <mls@suse.de>
97     Klaus Kaempf <kkaempf@suse.de>
98     Stephan Kulow <coolo@suse.de>
99     Michael Matz <matz@suse.de>
100     Duncan Mac-Vicar P. <dmacvicar@suse.de>
101
102 %package tools
103 Summary:        A new approach to package dependency solving
104 Group:          Development/Libraries/C and C++
105 Obsoletes:      libsatsolver <= 0.0.15
106 Provides:       libsatsolver = %{version}-%{release}
107 Requires:       gzip bzip2 coreutils
108
109 %description tools
110 A new approach to package dependency solving.
111
112 %package demo
113 Summary:        Applications demoing the libsolv library
114 Group:          System/Management
115 Requires:       curl
116 %if 0%{?fedora_version}
117 Requires:       gnupg2
118 %endif
119 %if 0%{?suse_version}
120 Requires:       gpg2
121 %endif
122
123 %description demo
124 Applications demoing the libsolv library.
125
126 %package -n ruby-solv
127 Summary:        Ruby bindings for the libsolv library
128 Group:          Development/Languages/Ruby
129
130 %description -n ruby-solv
131 Ruby bindings for sat solver.
132
133 %package -n python-solv
134 %py_requires
135 Summary:        Python bindings for the libsolv library
136 Group:          Development/Languages/Python
137
138 %description -n python-solv
139 Python bindings for sat solver.
140
141 %package -n perl-solv
142 Requires:       perl = %{perl_version}
143 Summary:        Perl bindings for the libsolv library
144 Group:          Development/Languages/Perl
145
146 %description -n perl-solv
147 Perl bindings for sat solver.
148
149 %prep
150 %setup -n libsolv-%{version}
151
152 %build
153 export CFLAGS="$RPM_OPT_FLAGS"
154 export CXXFLAGS="$CFLAGS"
155
156 CMAKE_FLAGS=
157 %if 0%{?fedora_version}
158 CMAKE_FLAGS="-DFEDORA=1"
159 %endif
160
161 cmake   $CMAKE_FLAGS \
162         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
163         -DLIB=%{_lib} \
164         -DCMAKE_VERBOSE_MAKEFILE=TRUE \
165         -DCMAKE_BUILD_TYPE=Release \
166         %{?with_enable_static:-DENABLE_STATIC=1} \
167         %{?with_disable_shared:-DDISABLE_SHARED=1} \
168         %{?with_perl_binding:-DENABLE_PERL=1} \
169         %{?with_python_binding:-DENABLE_PYTHON=1} \
170         %{?with_ruby_binding:-DENABLE_RUBY=1} \
171         -DUSE_VENDORDIRS=1 \
172         -DCMAKE_SKIP_RPATH=1 
173 make %{?jobs:-j %jobs}
174
175 %install
176 make DESTDIR=$RPM_BUILD_ROOT install
177 # we want to leave the .a file untouched
178 export NO_BRP_STRIP_DEBUG=true
179
180 %clean
181 rm -rf "$RPM_BUILD_ROOT"
182
183 %files -n libsolv@LIBSOLV_SOVERSION@
184 %defattr(-,root,root)
185 %doc LICENSE*
186 %_libdir/libsolv.so.*
187 %_libdir/libsolvext.so.*
188
189 %files tools
190 %defattr(-,root,root)
191 %exclude /usr/bin/helix2solv
192 %exclude /usr/bin/solv
193 /usr/bin/*
194
195 %files devel
196 %defattr(-,root,root)
197 %_libdir/libsolv.so
198 %_libdir/libsolvext.so
199 /usr/include/solv
200 /usr/bin/helix2solv
201
202 %files demo
203 %defattr(-,root,root)
204 /usr/bin/solv
205
206 %if %{with perl_binding}
207 %files -n perl-solv
208 %defattr(-,root,root)
209 %{perl_vendorarch}/*
210 %endif
211
212 %if %{with ruby_binding}
213 %files -n ruby-solv
214 %defattr(-,root,root)
215 %{ruby_vendorarch}/*
216 %endif
217
218 %if %{with python_binding}
219 %files -n python-solv
220 %defattr(-,root,root)
221 %{py_sitedir}/*
222 %endif
223
224 %changelog