/[ascend]/trunk/ascend.spec
ViewVC logotype

Contents of /trunk/ascend.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2683 - (show annotations) (download)
Fri Feb 22 01:31:37 2013 UTC (5 years, 5 months ago) by jpye
File size: 11125 byte(s)
Some updates on ascend.spec from Antonio Trande.
1 %define pyver %(python -c 'import sys ; print sys.version[:3]')
2
3 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
4 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
5
6 %define gtksourceview_lang_file %{_datadir}/gtksourceview-3.0/language-specs/ascend.lang
7
8 Name: ascend
9 Summary: ASCEND modelling environment
10 Version: 0.9.8
11 Release: 0.1.4424svn%{?dist}
12 Group: Applications/Engineering
13 License: GPLv2+
14 URL: http://ascend.cheme.cmu.edu/
15 # This package has been obtained by executing:
16 # svn co svn://ascend4.org/code/trunk ascend (changeset 4424)
17 # tar -cvzf ascend-0.9.8.tar.gz ascend
18 Source0: ascend-0.9.8.tar.gz
19
20 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21
22 #------ build dependencies -------
23 BuildRequires: scons >= 0.96.92
24 BuildRequires: bison
25 BuildRequires: flex >= 2.5.4
26 BuildRequires: swig >= 1.3.24
27 BuildRequires: gcc-gfortran gcc-c++ >= 4
28 BuildRequires: blas-devel
29 BuildRequires: sundials-devel >= 2.4.0
30 BuildRequires: ipopt-devel >= 3.10
31 BuildRequires: python-devel >= 2.4
32 BuildRequires: tk-devel, tk, tcl-devel, tcl, tktable
33 BuildRequires: graphviz-devel
34
35 # ... documentation
36 # There are no dependencies for documentation as the tarball
37 # will always contain documentation in compiled form. Only
38 # when building from subversion are targets formats of the
39 # documentation files not available.
40 #BuildRequires: lyx
41 #BuildRequires: texlive-collection-fontsrecommended
42 #BuildRequires: texlive-epstopdf
43 #BuildRequires: texlive-ulem
44 #BuildRequires: texlive-lm-math
45 BuildRequires: desktop-file-utils
46
47 #------ runtime dependencies --------
48 Requires: blas%{?_isa}
49 Requires: sundials%{?_isa}
50 Requires: ipopt%{?_isa}
51
52 # ...pygtk
53 Requires: python%{?_isa} >= 2.4
54 Requires: pygtk2 >= 2.6
55 # fairly sure we don't need this any more? JP -- using GtkBuilder now, part of core PyGTK
56 #Requires: pygtk2-libglade
57 Requires: python-matplotlib
58 Requires: numpy
59 Requires: ipython
60
61 # ... file association
62 Requires(post): desktop-file-utils shared-mime-info
63 Requires(postun): desktop-file-utils shared-mime-info
64
65 # syntax highlighting for gedit
66 Requires: gtksourceview3
67
68 %{?filter_setup:
69 %filter_provides_in %{_libdir}/ascend/models/.*\.so$
70 %filter_provides_in %{_libdir}/ascend/solvers/.*\.so$
71 %filter_setup
72 }
73
74 %description
75 ASCEND IV is both a large-scale object-oriented mathematical
76 modeling environment and a strongly typed mathematical modeling
77 language. Although ASCEND has primarily been developed by Chemical
78 Engineers, great care has been exercised to assure that it is
79 domain independent. ASCEND can support modeling activities in
80 fields from Architecture to (computational) Zoology.
81
82 # for the moment we'll just make one big super-package, to keep things
83 # simple for end-users.
84
85 %package devel
86 Summary: Developer files ASCEND
87 Group: Applications/Engineering
88 Requires: %{name}
89 %description devel
90 Developer files for ASCEND, in the form for C header files for the core
91 ASCEND library, 'libascend'.
92
93 %package doc
94 Summary: Documentation for ASCEND
95 Group: Applications/Engineering
96 %description doc
97 Documentation for ASCEND, in the form of a PDF User's Manual.
98
99
100 %package tcltk
101 Summary: Tcl/Tk user interface for ASCEND
102 Group: Applications/Engineering
103 Requires: xgraph >= 11
104 Requires: tcl%{?_isa} >= 8.3
105 Requires: tk%{?_isa} >= 8.3
106 Requires: tktable < 2.10, tktable >= 2.8
107
108 %description tcltk
109 Tcl/Tk user interface for ASCEND. This is the original ASCEND IV interface
110 and is a more complete and mature interface than the alternative PyGTK
111 interface. Use this interface if you need to use ASCEND *.a4s files or other
112 functionality not provided by the PyGTK interface.
113
114 %prep
115 %setup -q -n %{name}
116
117 %build
118 scons %{_smp_mflags} \
119 INSTALL_ROOT=%{buildroot} \
120 INSTALL_PREFIX=%{_prefix} \
121 INSTALL_SHARE=%{_datadir} \
122 INSTALL_BIN=%{_bindir} \
123 INSTALL_INCLUDE=%{_includedir} \
124 INSTALL_LIB=%{_libdir} \
125 INSTALL_DOC=%{_docdir}/%{name}-%{version} \
126 DEBUG=1 \
127 WITH_DOC_BUILD=1 \
128 WITH_DOC_INSTALL=1 \
129 WITH_SOLVERS=QRSLV,LSODE,CMSLV,IDA,LRSLV,CONOPT,DOPRI5,IPOPT \
130 ABSOLUTE_PATHS=0 \
131 %{?__cc:CC="%__cc"} %{?__cxx:CXX="%__cxx"} \
132 ascend ascxx pygtk tcltk models solvers
133
134 %install
135 rm -rf %{buildroot}
136 scons %{_smp_mflags} install
137
138 # Install menu entry for PyGTK interface, gtksourceview syntax highlighting, and MIME definition
139 pushd pygtk/gnome
140 install -m 644 -D %{name}.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop
141 install -m 644 -D %{name}.png %{buildroot}/%{_datadir}/icons/%{name}-app.png
142 install -m 644 -D %{name}.png %{buildroot}/%{_datadir}/icons/hicolor/64x64/%{name}.png
143 install -m 644 -D %{name}.xml %{buildroot}/%{_datadir}/mime/packages/%{name}.xml
144 popd
145
146 # file-type icon for ascend models (double click should open in ASCEND)
147 pushd pygtk/glade
148 install -m 644 -D %{name}-doc-48x48.svg %{buildroot}/%{_datadir}/icons/text-x-%{name}-model.svg
149 popd
150
151 # language file for use with gedit
152 # gtksourceview-3.0?
153 pushd tools/gtksourceview-2.0
154 install -m 644 -D %{name}.lang %{buildroot}/%{gtksourceview_lang_file}
155 popd
156
157 # Install menu entry for Tcl/Tk interface
158 pushd tcltk/gnome
159 install -m 644 -D %{name}4.desktop %{buildroot}/%{_datadir}/applications/%{name}4.desktop
160 install -m 644 -D %{name}4.png %{buildroot}/%{_datadir}/icons/%{name}4-app.png
161 install -m 644 -D %{name}4.png %{buildroot}/%{_datadir}/icons/hicolor/64x64/%{name}4.png
162 popd
163
164 # Fix .desktop files entries
165
166 desktop-file-edit \
167 --set-icon="ascend-app" \
168 --add-category="Science" \
169 --remove-key="Encoding" \
170 --remove-key="Categories" \
171 %{buildroot}/%{_datadir}/applications/%{name}.desktop
172
173 desktop-file-edit \
174 --set-icon="ascend-app" \
175 --add-category="Science" \
176 --remove-key="Encoding" \
177 --remove-key="Categories" \
178 %{buildroot}/%{_datadir}/applications/%{name}4.desktop
179
180 desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
181 desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}4.desktop
182
183 # Fixed execute permission
184 chmod +x %{buildroot}/%{_libdir}/%{name}/solvers/*.so
185 chmod +x %{buildroot}/%{_libdir}/%{name}/models/*/*.so
186 chmod +x %{buildroot}/%{_libdir}/%{name}/models/*/*/*.so
187 chmod +x %{buildroot}/%{_libdir}/libascend.so.1.0
188 chmod +x %{buildroot}/%{_libdir}/libascendtcl.so
189 chmod +x %{buildroot}/%{_libdir}/%{name}/models/johnpye/fprops/test/ph
190 chmod +x %{buildroot}/%{_libdir}/%{name}/models/johnpye/fprops/test/sat
191 chmod +x %{buildroot}/%{python_sitearch}/%{name}/_ascpy.so
192 chmod +x %{buildroot}/%{python_sitearch}/_fprops.so
193
194
195 # Fix non-executable-script warnings
196 for lib in %{buildroot}/%{_libdir}/%{name}/models/test/reverse_ad/modelgen.py; do
197 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
198 touch -r $lib $lib.new &&
199 mv $lib.new $lib
200 done
201
202 # Fix non-executable-script warnings
203 for lib in %{buildroot}/%{_libdir}/%{name}/models/johnpye/fprops/convcomp.py; do
204 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
205 touch -r $lib $lib.new &&
206 mv $lib.new $lib
207 done
208
209
210 %clean
211 rm -rf %{buildroot}
212
213 %post
214 /sbin/ldconfig
215 update-desktop-database
216 update-mime-database /usr/share/mime &> /dev/null || :
217
218 %postun
219 /sbin/ldconfig
220 update-desktop-database
221 update-mime-database /usr/share/mime &> /dev/null || :
222
223 %files
224 #%defattr(644,root,root)
225 %doc INSTALL.txt LICENSE.txt
226 #%defattr(755,root,root)
227 %{_libdir}/%{name}/models
228 %{_libdir}/%{name}/solvers
229 %{_datadir}/mime/packages/%{name}.xml
230 %{gtksourceview_lang_file}
231 %{_datadir}/icons/text-x-%{name}-model.svg
232 #%defattr(755,root,root)
233 %{_libdir}/libascend.so.*
234 %dir %{python_sitearch}/%{name}
235 #%defattr(755,root,root)
236 %{_bindir}/%{name}
237 %{python_sitearch}/%{name}/_ascpy.so
238 #%defattr(644,root,root)
239 %{python_sitearch}/%{name}/*.py
240 %{python_sitearch}/%{name}/*.py[oc]
241 %{_datadir}/%{name}/glade
242 %{_datadir}/applications/%{name}.desktop
243 %{_datadir}/icons/%{name}-app.png
244 %{_datadir}/icons/hicolor/64x64/%{name}.png
245 #%defattr(755,root,root)
246 %{python_sitearch}/_fprops.so
247 #%defattr(644,root,root)
248 %{python_sitearch}/fprops.py
249 %{python_sitearch}/fprops.py[oc]
250
251
252 %files tcltk
253 #%defattr(755,root,root)
254 %{_bindir}/%{name}4
255 %{_libdir}/libascendtcl.so
256 #%defattr(644,root,root)
257 %{_datadir}/%{name}/tcltk
258 %{_datadir}/applications/%{name}4.desktop
259 %{_datadir}/icons/%{name}4-app.png
260 %{_datadir}/icons/hicolor/64x64/%{name}4.png
261
262 %files devel
263 #%defattr(755,root,root)
264 %{_bindir}/%{name}-config
265 %{_includedir}/%{name}
266 %{_libdir}/lib*.so
267
268 %files doc
269 #%defattr(644,root,root)
270 %doc doc/book.pdf
271
272 %changelog
273 * Thu Jan 24 2013 Antonio Trande <sagitter@fedoraproject.org> 0.9.8-0.1.4424svn
274 - Fixed .desktop files entries
275 - Fixed source package origin
276 - Added BR texlive-collection-fontsrecommended,texlive-epstopdf,texlive-ulem
277 texlive-lm-math,desktop-file-utils
278 - Fixed execute permission to various file
279 - Added Buildroot tag
280 - Fixed non-executable-script warnings
281
282 * Thu Jan 24 2013 Antonio Trande <sagitter@fedoraproject.org> 0.9.8-0.0.4424svn
283 - Initial package
284
285 * Wed Dec 12 2012 John Pye <john.pye@anu.edu.au> 0.9.8
286 - New version
287
288 * Thu Apr 30 2009 John Pye <john.pye@anu.edu.au> 0.9.6
289 - New version
290
291 * Wed Jun 25 2008 John Pye <john.pye@anu.edu.au> 0.9.5.115
292 - New version
293 - Moved ascend-config to -devel pkg.
294
295 * Wed Dec 26 2007 John Pye <john.pye@anu.edu.au> 0.9.5.114
296 - Minor fixes: error output.
297 - New 'air properties' model.
298 - GtkSourceView installed by Scons now.
299 - Added 'Incidence Graph' feature.
300
301 * Sun Aug 19 2007 John Pye <john.pye@anu.edu.au> 0.9.5.113
302 - External libraries renamed to 'lib<name>_ascend.so' for clarity
303 and to solve a Windows-based naming problem.
304 - Links in Help menu fixed (problem with call to Python webbrowser component).
305 - License re-tagged according to Fedora requirements.
306
307 * Sun Jul 25 2007 John Pye <john.pye@anu.edu.au> 0.9.5.112
308 - solvers are now all built as separate shared libraries
309 - mime-type icon added
310 - RPM now builds on Fedora 5,6,7 and SUSE 10.0 and newer. Not Mandriva though.
311
312 * Mon Apr 23 2007 John Pye <john.pye@student.unsw.edu.au> 0.9.5.108
313 - File ascend.lang has moved.
314 - book.pdf is included in package.
315 - some header files have been moved.
316
317 * Fri Jul 28 2006 John Pye <john.pye@student.unsw.edu.au>
318 - Added CONOPT support
319
320 * Wed Jul 12 2006 John Pye <john.pye@student.unsw.edu.au>
321 - Fixed fortran linking
322 - Removed ccache dependency
323 - Added xgraph dependency
324 - Added 'include' files plus 'ascend-config' script
325
326 * Thu Jun 01 2006 John Pye <john.pye@student.unsw.edu.au>
327 - Add Tcl/Tk interface to GNOME menu
328
329 * Tue May 02 2006 John Pye <john.pye@student.unsw.edu.au>
330 - Break out ascend-core, ascend-python and ascend-tcltk packages.
331
332 * Mon Apr 24 2006 John Pye <john.pye@student.unsw.edu.au>
333 - Modified for removed dir in pygtk source hierachy
334
335 * Thu Apr 04 2006 John Pye <john.pye@student.unsw.edu.au>
336 - First RPM package for new SCons build
337
338 # vim: set syntax=spec:
339

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22