]> git.pld-linux.org Git - packages/gecode.git/blob - gecode.spec
- unconditional noarch subpackages
[packages/gecode.git] / gecode.spec
1 # TODO
2 # - html docs seems not to be built
3
4 # Conditional build:
5 %bcond_with     doc             # build doc
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
12
13 Summary:        Generic constraint development environment
14 Name:           gecode
15 Version:        4.4.0
16 Release:        2
17 License:        MIT
18 Group:          Libraries
19 Source0:        http://www.gecode.org/download/%{name}-%{version}.7z
20 # Source0-md5:  c27e20608076a9d18d9a97d47aae92e5
21 Patch0:         no_examples.patch
22 URL:            http://www.gecode.org/
23 BuildRequires:  autoconf
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
31 %if %{with qt}
32 BuildRequires:  Qt5Core-devel
33 BuildRequires:  Qt5Gui-devel
34 BuildRequires:  Qt5PrintSupport-devel
35 BuildRequires:  Qt5Widgets-devel
36 %endif
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
44 %define         sover   41
45
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
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
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}
72 %if "%{_rpmversion}" >= "5"
73 BuildArch:      noarch
74 %endif
75
76 %description doc
77 The %{name}-doc package contains documentation files for %{name}.
78
79 %package examples
80 Summary:        Example code for %{name}
81 Group:          Documentation
82 Requires:       %{name} = %{version}-%{release}
83 %if "%{_rpmversion}" >= "5"
84 BuildArch:      noarch
85 %endif
86
87 %description examples
88 The %{name}-examples package contains example code for %{name}.
89
90 %prep
91 %setup -q
92 %patch0 -p1
93
94 # Fix permissions
95 find . -name '*.hh' -exec chmod 0644 '{}' \;
96 find . -name '*.hpp' -exec chmod 0644 '{}' \;
97 find . -name '*.cpp' -exec chmod 0644 '{}' \;
98 chmod 0644 LICENSE misc/doxygen/*.png
99
100 # Fix encoding
101 cd examples
102 for file in bin-packing.cpp black-hole.cpp dominating-queens.cpp scowl.hpp word-square.cpp; do
103         iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
104         touch -r $file $file.new && \
105         mv $file.new $file
106 done
107
108 %build
109 %{__aclocal}
110 %{__autoconf}
111 chmod +x configure
112 %configure \
113         --disable-examples \
114         --enable-mpfr \
115         %{__enable_disable qt} \
116         %{__enable_disable gist} \
117         --enable-float-vars \
118         --enable-leak-debug \
119         --with-boost-include=%{_includedir}/boost
120
121 %{__make}
122 %{__make} ChangeLog
123
124 iconv --from=ISO-8859-1 --to=UTF-8 -o ChangeLog.new ChangeLog
125 mv ChangeLog.new ChangeLog
126
127 %{?with_doc:%{__make} doc}
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131 %{__make} install \
132         DESTDIR=$RPM_BUILD_ROOT
133
134 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
135 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %post   -p /sbin/ldconfig
141 %postun -p /sbin/ldconfig
142
143 %files
144 %defattr(644,root,root,755)
145 %doc ChangeLog LICENSE
146 %attr(755,root,root) %{_libdir}/libgecodedriver.so.*.*
147 %ghost %{_libdir}/libgecodedriver.so.%{sover}
148 %attr(755,root,root) %{_libdir}/libgecodeflatzinc.so.*.*
149 %ghost %{_libdir}/libgecodeflatzinc.so.%{sover}
150 %attr(755,root,root) %{_libdir}/libgecodefloat.so.*.*
151 %ghost %{_libdir}/libgecodefloat.so.%{sover}
152 %attr(755,root,root) %{_libdir}/libgecodeint.so.*.*
153 %ghost %{_libdir}/libgecodeint.so.%{sover}
154 %attr(755,root,root) %{_libdir}/libgecodekernel.so.*.*
155 %ghost %{_libdir}/libgecodekernel.so.%{sover}
156 %attr(755,root,root) %{_libdir}/libgecodeminimodel.so.*.*
157 %ghost %{_libdir}/libgecodeminimodel.so.%{sover}
158 %attr(755,root,root) %{_libdir}/libgecodesearch.so.*.*
159 %ghost %{_libdir}/libgecodesearch.so.%{sover}
160 %attr(755,root,root) %{_libdir}/libgecodeset.so.*.*
161 %ghost %{_libdir}/libgecodeset.so.%{sover}
162 %attr(755,root,root) %{_libdir}/libgecodesupport.so.*.*
163 %ghost %{_libdir}/libgecodesupport.so.%{sover}
164
165 %if %{with gist}
166 %files gist
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_libdir}/libgecodegist.so.*.*
169 %ghost %{_libdir}/libgecodegist.so.%{sover}
170 %endif
171
172 %files devel
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_bindir}/fzn-gecode
175 %attr(755,root,root) %{_bindir}/mzn-gecode
176 %{_datadir}/%{name}
177 %{_includedir}/%{name}
178 %{_libdir}/libgecodedriver.so
179 %{_libdir}/libgecodeflatzinc.so
180 %{_libdir}/libgecodefloat.so
181 %{_libdir}/libgecodeint.so
182 %{_libdir}/libgecodekernel.so
183 %{_libdir}/libgecodeminimodel.so
184 %{_libdir}/libgecodesearch.so
185 %{_libdir}/libgecodeset.so
186 %{_libdir}/libgecodesupport.so
187
188 %if %{with gist}
189 %{_libdir}/libgecodegist.so
190 %endif
191
192 %if %{with doc}
193 %files doc
194 %defattr(644,root,root,755)
195 %doc doc/*
196 %endif
197
198 %files examples
199 %defattr(644,root,root,755)
200 %{_examplesdir}/%{name}-%{version}
This page took 0.102193 seconds and 3 git commands to generate.