#!/bin/bash
# Check if script is being run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)"
exit 1
fi
# Update package lists
echo "Updating package lists..."
apt-get update
# Install dependencies
echo "Installing dependencies..."
apt-get install -y \
build-essential \
libncurses5-dev \
libncursesw5-dev \
libutf8proc-dev \
libperl-dev \
libgcrypt20-dev \
libotr5-dev \
cmake \
meson \
ninja-build \
wget \
libglib2.0
# Download Irssi 1.4.5
IRSSI_VERSION="1.4.5"
IRSSI_TAR="irssi-$IRSSI_VERSION.tar.gz"
IRSSI_URL="https://github.com/irssi/irssi/releases/download/$IRSSI_VERSION/$IRSSI_TAR"
echo "Downloading Irssi version $IRSSI_VERSION..."
wget $IRSSI_URL -O /tmp/$IRSSI_TAR
# Extract the tarball
echo "Extracting the tarball..."
tar xzf /tmp/$IRSSI_TAR -C /tmp
# Navigate to Irssi source directory
cd /tmp/irssi-$IRSSI_VERSION
# Configure Irssi using meson
echo "Configuring Irssi..."
meson setup Build
# Build Irssi
echo "Building Irssi..."
ninja -C Build
# Install Irssi
echo "Installing Irssi..."
ninja -C Build install
# Clean up downloaded files
echo "Cleaning up..."
rm /tmp/$IRSSI_TAR
rm -rf /tmp/irssi-$IRSSI_VERSION
# Verify installation
echo "Verifying Irssi installation..."
if command -v irssi >/dev/null 2>&1; then
echo "Irssi $IRSSI_VERSION installed successfully!"
else
echo "Irssi installation failed."
exit 1
fi
exit 0