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