%if 0%{?rhel} && 0%{?rhel} <= 5 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %define gtksourceview_lang_file %{_datadir}/gtksourceview-3.0/language-specs/ascend.lang Name: ascend Summary: ASCEND modelling environment Version: 0.9.8 Release: 5%{?dist} Group: Applications/Engineering License: GPLv2+ URL: http://ascend.cheme.cmu.edu/ Source0: http://sourceforge.net/projects/ascend-sim/files/ASCEND%20%28current%29/%{version}/%{name}-%{version}.tar.bz2 #------ build dependencies ------- BuildRequires: scons >= 0.96.92 BuildRequires: bison BuildRequires: flex >= 2.5.4 BuildRequires: swig >= 1.3.24 BuildRequires: gcc-gfortran gcc-c++ >= 4 BuildRequires: blas-devel BuildRequires: sundials-devel >= 2.4.0 BuildRequires: coin-or-Ipopt-devel >= 3.10 BuildRequires: python-devel >= 2.4 BuildRequires: tk-devel, tk, tcl-devel, tcl, tktable BuildRequires: graphviz-devel BuildRequires: desktop-file-utils #------ runtime dependencies -------- Requires: blas%{?_isa} Requires: sundials%{?_isa} Requires: coin-or-Ipopt%{?_isa} # ...pygtk Requires: python%{?_isa} >= 2.4 Requires: pygtk2 >= 2.6 Requires: pygtk2-libglade Requires: python-matplotlib Requires: numpy Requires: ipython # ... file association Requires(post): desktop-file-utils shared-mime-info Requires(postun): desktop-file-utils shared-mime-info # syntax highlighting for gedit Requires: gtksourceview3 %description ASCEND IV is both a large-scale object-oriented mathematical modeling environment and a strongly typed mathematical modeling language. Although ASCEND has primarily been developed by Chemical Engineers, great care has been exercised to assure that it is domain independent. ASCEND can support modeling activities in fields from Architecture to (computational) Zoology. %package devel Summary: Developer files ASCEND Group: Applications/Engineering Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Developer files for ASCEND, in the form for C header files for the core ASCEND library, 'libascend'. %package doc Summary: Documentation for ASCEND Group: Applications/Engineering BuildArch: noarch %description doc Documentation for ASCEND, in the form of a PDF User's Manual. %package tcltk Summary: Tcl/Tk user interface for ASCEND Group: Applications/Engineering Requires: tcl%{?_isa} >= 8.3 Requires: tk%{?_isa} >= 8.3 Requires: tktable < 2.10, tktable >= 2.8 %description tcltk Tcl/Tk user interface for ASCEND. This is the original ASCEND IV interface and is a more complete and mature interface than the alternative PyGTK interface. Use this interface if you need to use ASCEND *.a4s files or other functionality not provided by the PyGTK interface. ## Preventing files from being scanned for provides (pre-scan filtering) %{?filter_setup: %filter_provides_in %{_libdir}/ascend/models/.*\.so$ %filter_provides_in %{_libdir}/ascend/solvers/.*\.so$ %filter_setup } %prep %setup -q -n %{name}-%{version} %build scons %{?_smp_mflags} \ INSTALL_ROOT=%{buildroot} \ INSTALL_PREFIX=%{_prefix} \ INSTALL_SHARE=%{_datadir} \ INSTALL_BIN=%{_bindir} \ INSTALL_INCLUDE=%{_includedir} \ INSTALL_LIB=%{_libdir} \ TCL=%{_prefix} \ DEBUG=0 \ WITH_DOC_BUILD=0 \ WITH_DOC_INSTALL=1 \ WITH_SOLVERS=QRSLV,LSODE,CMSLV,IDA,LRSLV,DOPRI5,IPOPT \ ABSOLUTE_PATHS=1 \ ascend ascxx pygtk tcltk models solvers %install scons %{?_smp_mflags} install # Install menu entry for PyGTK interface, gtksourceview syntax highlighting, and MIME definition pushd pygtk/gnome install -m 644 -D %{name}.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop install -m 644 -D %{name}.png %{buildroot}/%{_datadir}/icons/%{name}-app.png install -m 644 -D %{name}.png %{buildroot}/%{_datadir}/icons/hicolor/64x64/%{name}.png install -m 644 -D %{name}.xml %{buildroot}/%{_datadir}/mime/packages/%{name}.xml popd # file-type icon for ascend models (double click should open in ASCEND) pushd pygtk/glade install -m 644 -D %{name}-doc-48x48.svg %{buildroot}/%{_datadir}/icons/text-x-%{name}-model.svg popd # language file for use with gedit pushd tools/gtksourceview-2.0 install -m 644 -D %{name}.lang %{buildroot}/%{gtksourceview_lang_file} popd # Install menu entry for Tcl/Tk interface pushd tcltk/gnome install -m 644 -D %{name}4.desktop %{buildroot}/%{_datadir}/applications/%{name}4.desktop install -m 644 -D %{name}4.png %{buildroot}/%{_datadir}/icons/%{name}4-app.png install -m 644 -D %{name}4.png %{buildroot}/%{_datadir}/icons/hicolor/64x64/%{name}4.png popd # Fix .desktop files entries %if 0%{?fedora} desktop-file-install \ --set-icon="ascend-app" \ --remove-key="Encoding" \ %{buildroot}/%{_datadir}/applications/%{name}.desktop desktop-file-install \ --set-icon="ascend-app" \ --remove-key="Encoding" \ %{buildroot}/%{_datadir}/applications/%{name}4.desktop %endif %if 0%{?rhel} # Remove extension from icon entries in the .desktop files sed -i 's/Icon=ascend-app.png/Icon=ascend-app/g' %{buildroot}/%{_datadir}/applications/%{name}.desktop sed -i 's/Icon=ascend4-app.png/Icon=ascend4-app/g' %{buildroot}/%{_datadir}/applications/%{name}4.desktop # Remove deprecated entry desktop-file-install \ --remove-key="Encoding" \ --delete-original \ --dir=%{buildroot}%{_datadir}/applications \ %{buildroot}/%{_datadir}/applications/%{name}.desktop desktop-file-install \ --remove-key="Encoding" \ --delete-original \ --dir=%{buildroot}%{_datadir}/applications \ %{buildroot}/%{_datadir}/applications/%{name}4.desktop %endif # Fixed execute permission chmod +x %{buildroot}/%{_libdir}/%{name}/solvers/*.so chmod +x %{buildroot}/%{_libdir}/%{name}/models/*/*.so chmod +x %{buildroot}/%{_libdir}/%{name}/models/*/*/*.so chmod +x %{buildroot}/%{_libdir}/libascend.so.1.0 chmod +x %{buildroot}/%{_libdir}/libascendtcl.so # Fix non-executable-script warnings for lib in %{buildroot}/%{_libdir}/%{name}/models/test/reverse_ad/modelgen.py; do sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done %post /sbin/ldconfig update-desktop-database update-mime-database /usr/share/mime &> /dev/null || : %postun /sbin/ldconfig update-desktop-database update-mime-database /usr/share/mime &> /dev/null || : %files %doc INSTALL.txt LICENSE.txt %{_bindir}/%{name} %dir %{_libdir}/%{name} %{_libdir}/%{name}/models/*.a4[lc] %{_libdir}/%{name}/models/examples %{_libdir}/%{name}/models/kchittur %{_libdir}/%{name}/models/pending %{_libdir}/%{name}/models/steam %{_libdir}/%{name}/models/test/blackbox/libbboxtest_%{name}.so %{_libdir}/%{name}/models/test/*/*/*.py %{_libdir}/%{name}/models/test/*/*/*.py[oc] %{_libdir}/%{name}/models/test/*/*/*.a4c %{_libdir}/%{name}/models/test/*/*.py %{_libdir}/%{name}/models/test/*/*.py[oc] %{_libdir}/%{name}/models/test/*/*.a4c %{_libdir}/%{name}/models/test/*.a4[cs] %{_libdir}/%{name}/models/test/ipopt/MD5Hash %{_libdir}/%{name}/models/test/link/README.txt %{_libdir}/%{name}/models/westerberg %{_libdir}/%{name}/models/solar %{_libdir}/%{name}/models/libraries %{_libdir}/%{name}/models/hydrosim %{_libdir}/%{name}/models/ivpNondimensional %{_libdir}/%{name}/models/ben %{_libdir}/%{name}/models/johnpye/fprops %{_libdir}/%{name}/models/johnpye/grena/*.a4c %{_libdir}/%{name}/models/johnpye/grena/libsunpos_%{name}.so %{_libdir}/%{name}/models/johnpye/grena/grena-date-check.ods %{_libdir}/%{name}/models/johnpye/grena/README.txt %{_libdir}/%{name}/models/johnpye/extpy/*.a4c %{_libdir}/%{name}/models/johnpye/extpy/*.py %{_libdir}/%{name}/models/johnpye/extpy/*.py[oc] %{_libdir}/%{name}/models/johnpye/extpy/libextpy_%{name}.so %{_libdir}/%{name}/models/johnpye/extfn/*.a4c %{_libdir}/%{name}/models/johnpye/extfn/*.py %{_libdir}/%{name}/models/johnpye/extfn/*.py[oc] %{_libdir}/%{name}/models/johnpye/extfn/libextfntest_%{name}.so %{_libdir}/%{name}/models/johnpye/datareader/*.a4c %{_libdir}/%{name}/models/johnpye/datareader/*.py %{_libdir}/%{name}/models/johnpye/datareader/*.py[oc] %{_libdir}/%{name}/models/johnpye/datareader/*.csv %{_libdir}/%{name}/models/johnpye/datareader/libdatareader_%{name}.so %{_libdir}/%{name}/models/johnpye/datareader/texttable-README.txt %{_libdir}/%{name}/models/johnpye/brent/libbrent_%{name}.so %{_libdir}/%{name}/models/johnpye/nrel/*.a4c %{_libdir}/%{name}/models/johnpye/nrel/libsunpos_nrel_%{name}.so %{_libdir}/%{name}/models/johnpye/*.py[oc] %{_libdir}/%{name}/models/johnpye/*.csv %{_libdir}/%{name}/models/johnpye/*.a4c %{_libdir}/%{name}/models/johnpye/*.py %{_libdir}/%{name}/models/sensitivity/*.so %{_libdir}/%{name}/solvers/*.so %{_libdir}/libascend.so.* %{gtksourceview_lang_file} %dir %{python_sitelib}/%{name} %{python_sitelib}/%{name}/_ascpy.so %{python_sitelib}/%{name}/*.py %{python_sitelib}/%{name}/*.py[oc] %{python_sitelib}/_fprops.so %{python_sitelib}/fprops.py %{python_sitelib}/fprops.py[oc] %dir %{_datadir}/%{name} %{_datadir}/%{name}/glade %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/%{name}-app.png %{_datadir}/icons/hicolor/64x64/%{name}.png %{_datadir}/icons/text-x-%{name}-model.svg %{_datadir}/mime/packages/%{name}.xml %files tcltk %{_bindir}/%{name}4 %{_libdir}/libascendtcl.so %{_datadir}/%{name}/tcltk %{_datadir}/applications/%{name}4.desktop %{_datadir}/icons/%{name}4-app.png %{_datadir}/icons/hicolor/64x64/%{name}4.png %files devel %{_bindir}/%{name}-config %dir %{_includedir}/%{name} %{_includedir}/%{name}/*/*.h %{_libdir}/%{name}/models/johnpye/datareader/*.[hc] %{_libdir}/%{name}/models/johnpye/datareader/parse/*.[hc] %{_libdir}/%{name}/models/johnpye/nrel/*.[hc] %{_libdir}/%{name}/models/johnpye/brent/*.c %{_libdir}/%{name}/models/johnpye/grena/*.[hc] %{_libdir}/%{name}/models/johnpye/extfn/*.c %{_libdir}/%{name}/models/johnpye/extpy/*.c %{_libdir}/%{name}/models/test/blackbox/*.c %{_libdir}/%{name}/models/sensitivity/*.c %{_libdir}/lib*.so %files doc %doc doc/book.pdf %changelog * Sun May 12 2013 Antonio Trande 0.9.8-5 - Removed xgraph as Requires * Wed Mar 13 2013 Antonio Trande 0.9.8-4 - doc sub-package changed to noarch * Tue Feb 05 2013 Antonio Trande 0.9.8-3 - Ipopt BuildRequires/Requires changed to coin-or-Ipopt - Rearranged .h/.c files in %%{_libdir}/%%{name} as devel files * Tue Feb 05 2013 Antonio Trande 0.9.8-2 - Fixed .desktop files entries for EPEL6 * Thu Jan 24 2013 Antonio Trande 0.9.8-1 - Fixed .desktop files entries for Fedora - Fixed execute permission of various file - Fixed non-executable-script warnings * Thu Jan 24 2013 Antonio Trande 0.9.8-0 - Initial package