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