#!/bin/bash

pacman -Sy
pacman -S --noconfirm --overwrite=/usr/lib/* glibc gcc-libs openssl-1.1
ldconfig
pacman -S --noconfirm apache mariadb-clients php php-gd php-memcache
ls -l /usr/lib/libcrypto.so*
pacman -S --needed --noconfirm sudo # Install sudo
useradd builduser -m # Create the builduser
passwd -d builduser # Delete the buildusers password
printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers # Allow the builduser passwordless sudo
sudo -u builduser bash -c 'cd /tmp && git clone https://aur.archlinux.org/ocrmypdf ocrmypdf && cd ocrmypdf && makepkg -si --noconfirm' # Clone and build a package
