Skip to content

Instantly share code, notes, and snippets.

@VitToCode
Created June 11, 2013 21:27
Show Gist options
  • Save VitToCode/5760862 to your computer and use it in GitHub Desktop.
Save VitToCode/5760862 to your computer and use it in GitHub Desktop.
RPM spec for latest Octave (http://www.gnu.org/software/octave/‎) Octave >= 3.6.4
Summary: A high-level language, primarily intended for numerical computations
Name: octave
Version: 3.6.4
Release: 1.el6
#Epoch: 2
License: GPL
Group: Applications/Mathematics
URL: http://www.octave.org
Source0: ftp://ftp.gnu.org/gnu/octave/octave-%{version}.tar.bz2
Source1: octave.png
#Patch0: %{name}-3.4.2-curl_remove_include.patch
#Patch1: patch1.patch
#Patch2: patch2.patch
#Patch3: patch3.patch
BuildRequires: gcc-gfortran glibc-devel gnuplot gperf GraphicsMagick-c++-devel blas-devel bzip2-devel curl-devel fftw3-devel fltk-devel fontconfig-devel freetype-devel
BuildRequires: libgcc mesa-libGL-devel mesa-libGLU-devel qhull-devel glpk-devel qrupdate-devel arpack-devel libstdc++-devel hdf5-devel lapack-devel ncurses-devel
BuildRequires: pcre-devel readline-devel suitesparse-devel libX11-devel libXext-devel libXft-devel zlib-devel dejagnu bison desktop-file-utils flex
BuildRequires: cairo-devel pixman-devel
Requires: gnuplot
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
%description
GNU Octave is a high-level language, primarily intended for numerical computations.
It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab.
It may also be used as a batch-oriented language.
Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential-algebraic equations.
It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages.
%package devel
Summary: Development headers and files for Octave
Group: Development/Libraries
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description devel
GNU Octave is a high-level language, primarily intended for numerical computations.
It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab.
It may also be used as a batch-oriented language.
Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential-algebraic equations.
It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages.
This package contains static libraries and header files need for development.
%prep
%setup -q
#%patch0 -p1
#%patch1 -p1
#%patch2 -p1
#%patch3 -p1
%build
%configure \
--enable-shared=yes \
--enable-static=no
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
install -d ${RPM_BUILD_ROOT}%{_datadir}/pixmaps
install -D -m 644 %{SOURCE1} \
${RPM_BUILD_ROOT}%{_datadir}/pixmaps/%{name}.png
rm -rf ${RPM_BUILD_ROOT}%{_infodir}/dir
# Make library links
%__mkdir_p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d
/bin/echo "%{_libdir}/%{name}/%{version}" > ${RPM_BUILD_ROOT}/etc/ld.so.conf.d/octave-%{_arch}.conf
## Create directories for add-on packages
#HOST_TYPE=`${RPM_BUILD_ROOT}%{_bindir}/octave-config -p CANONICAL_HOST_TYPE`
#%__mkdir_p ${RPM_BUILD_ROOT}%{_libexecdir}/octave/site/oct/%{octave_api}/$HOST_TYPE
#%__mkdir_p ${RPM_BUILD_ROOT}%{_libexecdir}/octave/site/oct/$HOST_TYPE
#%__mkdir_p ${RPM_BUILD_ROOT}%{_datadir}/octave/packages
#/bin/touch ${RPM_BUILD_ROOT}%{_datadir}/octave/octave_packages
#%multiarch_includes ${RPM_BUILD_ROOT}%{_includedir}/octave-%{version}/octave/*.h
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
if [ -f %{_infodir}/%{name}.info* ]; then
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
%preun -p /sbin/ldconfig
if [ $1 = 0 ] ; then # last uninstall
if [ -f %{_infodir}/%{name}.info* ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
fi
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc COPYING ChangeLog README NEWS INSTALL
%{_datadir}/applications/www.octave.org-%{name}.desktop
%{_bindir}/%{name}
%{_bindir}/%{name}-%{version}
%dir %{_libdir}/%{name}/%{version}/oct
%{_libdir}/%{name}/%{version}/oct/*
%{_libdir}/%{name}/%{version}/lib*.so.*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/pixmaps/%{name}.png
%dir %{_libexecdir}/%{name}/%{version}
%{_libexecdir}/%{name}/%{version}/*
%{_infodir}/*.info.*
%{_infodir}/%{name}.info-*
%{_mandir}/man1/%{name}.*
%defattr(-,root,root,0755)
%config(noreplace) /etc/ld.so.conf.d/*
%files devel
%defattr(-,root,root)
%{_bindir}/mkoctfile
%{_bindir}/mkoctfile-%{version}
#%{_bindir}/%{name}-bug
#%{_bindir}/%{name}-bug-%{version}
%{_bindir}/%{name}-config
%{_bindir}/%{name}-config-%{version}
%dir %{_includedir}/%{name}-%{version}
%{_includedir}/%{name}-%{version}/*
#%{_libexecdir}/%{name}/ls-R
%{_libdir}/%{name}/%{version}/lib*.la
%{_libdir}/%{name}/%{version}/lib*.so
%{_mandir}/man1/mkoctfile.*
%{_mandir}/man1/%{name}-*
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment