]>
Commit | Line | Data |
---|---|---|
87d06430 ER |
1 | # TODO |
2 | # - html docs seems not to be built | |
3 | ||
4 | # Conditional build: | |
5 | %bcond_with doc # build doc | |
a881aed0 ER |
6 | %bcond_without qt # Qt support (qt4>4.3, qt5) |
7 | %bcond_without gist # Gecode Interactive Search Tool | |
8 | ||
9 | %if %{without qt} | |
10 | %undefine with_gist | |
11 | %endif | |
87d06430 ER |
12 | |
13 | Summary: Generic constraint development environment | |
14 | Name: gecode | |
5f141020 | 15 | Version: 4.4.0 |
c44d4218 | 16 | Release: 2 |
87d06430 ER |
17 | License: MIT |
18 | Group: Libraries | |
19 | Source0: http://www.gecode.org/download/%{name}-%{version}.7z | |
5f141020 | 20 | # Source0-md5: c27e20608076a9d18d9a97d47aae92e5 |
87d06430 ER |
21 | Patch0: no_examples.patch |
22 | URL: http://www.gecode.org/ | |
c6f181a8 | 23 | BuildRequires: autoconf |
87d06430 ER |
24 | BuildRequires: automake |
25 | BuildRequires: bison | |
26 | BuildRequires: boost-devel | |
27 | BuildRequires: flex >= 2.5.33 | |
28 | BuildRequires: graphviz | |
29 | BuildRequires: p7zip-standalone | |
30 | BuildRequires: qt4-build | |
a881aed0 ER |
31 | %if %{with qt} |
32 | BuildRequires: Qt5Core-devel | |
33 | BuildRequires: Qt5Gui-devel | |
34 | BuildRequires: Qt5PrintSupport-devel | |
35 | BuildRequires: Qt5Widgets-devel | |
36 | %endif | |
87d06430 ER |
37 | %if %{with doc} |
38 | BuildRequires: doxygen | |
39 | BuildRequires: tex(dvips) | |
40 | BuildRequires: tex(latex) | |
41 | %endif | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
5f141020 ER |
44 | %define sover 41 |
45 | ||
87d06430 ER |
46 | %description |
47 | Gecode is a toolkit for developing constraint-based systems and | |
48 | applications. Gecode provides a constraint solver with | |
49 | state-of-the-art performance while being modular and extensible. | |
50 | ||
a881aed0 ER |
51 | %package gist |
52 | Summary: Gecode Interactive Search Tool | |
53 | Group: Libraries | |
54 | Requires: %{name} = %{version}-%{release} | |
55 | ||
56 | %description gist | |
57 | Gecode Interactive Search Tool. | |
58 | ||
87d06430 ER |
59 | %package devel |
60 | Summary: Development files for %{name} | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description devel | |
65 | The %{name}-devel package contains libraries and header files for | |
66 | developing applications that use %{name}. | |
67 | ||
68 | %package doc | |
69 | Summary: Documentation for %{name} | |
70 | Group: Documentation | |
71 | Requires: %{name} = %{version}-%{release} | |
87d06430 | 72 | BuildArch: noarch |
87d06430 ER |
73 | |
74 | %description doc | |
75 | The %{name}-doc package contains documentation files for %{name}. | |
76 | ||
77 | %package examples | |
78 | Summary: Example code for %{name} | |
79 | Group: Documentation | |
80 | Requires: %{name} = %{version}-%{release} | |
87d06430 | 81 | BuildArch: noarch |
87d06430 ER |
82 | |
83 | %description examples | |
84 | The %{name}-examples package contains example code for %{name}. | |
85 | ||
86 | %prep | |
87 | %setup -q | |
88 | %patch0 -p1 | |
89 | ||
90 | # Fix permissions | |
91 | find . -name '*.hh' -exec chmod 0644 '{}' \; | |
92 | find . -name '*.hpp' -exec chmod 0644 '{}' \; | |
93 | find . -name '*.cpp' -exec chmod 0644 '{}' \; | |
94 | chmod 0644 LICENSE misc/doxygen/*.png | |
95 | ||
96 | # Fix encoding | |
97 | cd examples | |
98 | for file in bin-packing.cpp black-hole.cpp dominating-queens.cpp scowl.hpp word-square.cpp; do | |
99 | iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \ | |
100 | touch -r $file $file.new && \ | |
101 | mv $file.new $file | |
102 | done | |
103 | ||
104 | %build | |
105 | %{__aclocal} | |
106 | %{__autoconf} | |
5f141020 | 107 | chmod +x configure |
87d06430 ER |
108 | %configure \ |
109 | --disable-examples \ | |
a881aed0 ER |
110 | --enable-mpfr \ |
111 | %{__enable_disable qt} \ | |
112 | %{__enable_disable gist} \ | |
87d06430 ER |
113 | --enable-float-vars \ |
114 | --enable-leak-debug \ | |
115 | --with-boost-include=%{_includedir}/boost | |
116 | ||
117 | %{__make} | |
87d06430 ER |
118 | %{__make} ChangeLog |
119 | ||
120 | iconv --from=ISO-8859-1 --to=UTF-8 -o ChangeLog.new ChangeLog | |
121 | mv ChangeLog.new ChangeLog | |
122 | ||
a6e494a6 ER |
123 | %{?with_doc:%{__make} doc} |
124 | ||
87d06430 ER |
125 | %install |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | %{__make} install \ | |
128 | DESTDIR=$RPM_BUILD_ROOT | |
129 | ||
130 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
131 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
132 | ||
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %post -p /sbin/ldconfig | |
137 | %postun -p /sbin/ldconfig | |
138 | ||
139 | %files | |
140 | %defattr(644,root,root,755) | |
141 | %doc ChangeLog LICENSE | |
142 | %attr(755,root,root) %{_libdir}/libgecodedriver.so.*.* | |
5f141020 | 143 | %ghost %{_libdir}/libgecodedriver.so.%{sover} |
87d06430 | 144 | %attr(755,root,root) %{_libdir}/libgecodeflatzinc.so.*.* |
5f141020 | 145 | %ghost %{_libdir}/libgecodeflatzinc.so.%{sover} |
87d06430 | 146 | %attr(755,root,root) %{_libdir}/libgecodefloat.so.*.* |
5f141020 | 147 | %ghost %{_libdir}/libgecodefloat.so.%{sover} |
87d06430 | 148 | %attr(755,root,root) %{_libdir}/libgecodeint.so.*.* |
5f141020 | 149 | %ghost %{_libdir}/libgecodeint.so.%{sover} |
87d06430 | 150 | %attr(755,root,root) %{_libdir}/libgecodekernel.so.*.* |
5f141020 | 151 | %ghost %{_libdir}/libgecodekernel.so.%{sover} |
87d06430 | 152 | %attr(755,root,root) %{_libdir}/libgecodeminimodel.so.*.* |
5f141020 | 153 | %ghost %{_libdir}/libgecodeminimodel.so.%{sover} |
87d06430 | 154 | %attr(755,root,root) %{_libdir}/libgecodesearch.so.*.* |
5f141020 | 155 | %ghost %{_libdir}/libgecodesearch.so.%{sover} |
87d06430 | 156 | %attr(755,root,root) %{_libdir}/libgecodeset.so.*.* |
5f141020 | 157 | %ghost %{_libdir}/libgecodeset.so.%{sover} |
87d06430 | 158 | %attr(755,root,root) %{_libdir}/libgecodesupport.so.*.* |
5f141020 | 159 | %ghost %{_libdir}/libgecodesupport.so.%{sover} |
87d06430 | 160 | |
a881aed0 ER |
161 | %if %{with gist} |
162 | %files gist | |
163 | %defattr(644,root,root,755) | |
164 | %attr(755,root,root) %{_libdir}/libgecodegist.so.*.* | |
165 | %ghost %{_libdir}/libgecodegist.so.%{sover} | |
166 | %endif | |
167 | ||
87d06430 ER |
168 | %files devel |
169 | %defattr(644,root,root,755) | |
170 | %attr(755,root,root) %{_bindir}/fzn-gecode | |
171 | %attr(755,root,root) %{_bindir}/mzn-gecode | |
172 | %{_datadir}/%{name} | |
173 | %{_includedir}/%{name} | |
174 | %{_libdir}/libgecodedriver.so | |
175 | %{_libdir}/libgecodeflatzinc.so | |
176 | %{_libdir}/libgecodefloat.so | |
87d06430 ER |
177 | %{_libdir}/libgecodeint.so |
178 | %{_libdir}/libgecodekernel.so | |
179 | %{_libdir}/libgecodeminimodel.so | |
180 | %{_libdir}/libgecodesearch.so | |
181 | %{_libdir}/libgecodeset.so | |
182 | %{_libdir}/libgecodesupport.so | |
183 | ||
a881aed0 ER |
184 | %if %{with gist} |
185 | %{_libdir}/libgecodegist.so | |
186 | %endif | |
187 | ||
87d06430 ER |
188 | %if %{with doc} |
189 | %files doc | |
190 | %defattr(644,root,root,755) | |
191 | %doc doc/* | |
192 | %endif | |
193 | ||
194 | %files examples | |
195 | %defattr(644,root,root,755) | |
196 | %{_examplesdir}/%{name}-%{version} |