\section{Installing Debian/Ubuntu Packages}
\label{s:installation:debian}
Binary packages are available for current Debian/Ubuntu based Linux
distributions. These can be installed through the use of standard system package
management utilities, such as Apt, if administrative access is
available.

\begin{enumerate}
	\item Create a configuration file \texttt{/etc/apt/sources.list.d/nektar.list} containing the appropriate line from the following table.
    
	{\small
	\begin{tabular}{p{2.7cm} p{11cm}}
	\toprule
	\textbf{Distribution} & \textbf{Repository} \\
	\midrule
    \textbf{Debian 9.0} \newline (stretch) &
        \texttt{deb http://www.nektar.info/debian-stretch stretch contrib} \\
    \textbf{Debian 10.0} \newline (buster) &
        \texttt{deb http://www.nektar.info/debian-buster buster contrib} \\
    \textbf{Debian 11.0} \newline (testing/bullseye) &
        \texttt{deb http://www.nektar.info/debian-bullseye bullseye contrib} \\
    \textbf{Debian} \newline (unstable) &
        \texttt{deb http://www.nektar.info/debian-unstable unstable contrib} \\
    \midrule
	\textbf{Ubuntu 16.04} \newline (xenial xerus) & 
        \texttt{deb http://www.nektar.info/ubuntu-xenial xenial contrib}\\
	\textbf{Ubuntu 18.04} \newline (bionic beaver) & 
        \texttt{deb http://www.nektar.info/ubuntu-bionic bionic contrib}\\
	\textbf{Ubuntu 20.04} \newline (focal fossa) & 
        \texttt{deb http://www.nektar.info/ubuntu-focal focal contrib}\\
	\bottomrule
	\end{tabular}
	}
    \item Update the main package list \texttt{/etc/apt/sources.list} to include the non-free component, by appending (if not already present) the word \texttt{non-free} after \texttt{main}.
    \item Install the Nektar++ repository GPG key:
    \begin{lstlisting}[style=BashInputStyle]
    wget -qO- https://www.nektar.info/nektar-apt.gpg | sudo apt-key add -
    \end{lstlisting}
	\item Update the package lists
	\begin{lstlisting}[style=BashInputStyle]
	apt update
	\end{lstlisting}
	\item Install specific Nektar++ packages as required, or install the complete suite with:
	\begin{lstlisting}[style=BashInputStyle]
	apt install nektar++
	\end{lstlisting}
	Any additional dependencies required by Nektar++ will be automatically installed.
	
	% Hacky way to get an lstlisting to an argument of a macro
    \newsavebox\installationDebTip
    \begin{lrbox}{\installationDebTip}\begin{minipage}{0.8\linewidth}
    \begin{lstlisting}[style=BashInputStyle]
    apt search nektar++
    \end{lstlisting}
    \end{minipage}
    \end{lrbox}
	
	\begin{tipbox}
	Nektar++ is split into multiple packages for the different components of the
	software. A list of available Nektar++ packages can be found using:
	\noindent\usebox\installationDebTip
	\end{tipbox}
\end{enumerate}


\section{Installing CentOS/Fedora Packages}
\label{s:installation:redhat}
\begin{enumerate}
\item Add a file \inlsh{nektar.repo} to the directory \inlsh{/etc/yum.repos.d/} with the following contents
\begin{lstlisting}[style=BashInputStyle]
[Nektar]
name=nektar
baseurl=<baseurl>
\end{lstlisting}
substituting \inlsh{<baseurl>} for the appropriate line from the table below.

{\small
\begin{center}
\begin{tabular}{ll}
\toprule
Distribution & \inlsh{<baseurl>} \\
\midrule
CentOS & 
\texttt{http://www.nektar.info/centos/\$releasever/\$basearch}\\
Fedora & 
\texttt{http://www.nektar.info/fedora/\$releasever/\$basearch}\\
\bottomrule
\end{tabular}
\end{center}
}

\begin{notebox}
The \inltt{\$releasever} and \inltt{\$basearch} variables are automatically replaced by Yum with the OS version and architecture of your system.
\end{notebox}

\item Download and install the GPG key used to sign the packages:
\begin{lstlisting}[style=BashInputStyle]
wget https://www.nektar.info/nektar-yum.gpg
sudo rpm --import nektar-yum.gpg
\end{lstlisting}

\item Now install the Nektar++ packages as required. For example,
\begin{lstlisting}[style=BashInputStyle]
yum install nektar++-openmpi-incnavierstokes-solver
\end{lstlisting}
Any additional dependencies required by Nektar++ will be automatically installed.

% Hacky way to get an lstlisting to an argument of a macro
\newsavebox\installationRpmTip
\begin{lrbox}{\installationRpmTip}\begin{minipage}{0.8\linewidth}
        \begin{lstlisting}[style=BashInputStyle]
        yum search nektar++
        \end{lstlisting}
    \end{minipage}
\end{lrbox}

\begin{tipbox}
    Nektar++ is split into multiple packages for the different components of the
    software. A list of available Nektar++ packages can be found using:
    \noindent\usebox\installationRpmTip
\end{tipbox}

\end{enumerate}
% \section{Installing OSX Packages}
% \label{s:installation:osx}
