Install Arch packages with makepkg

I want to start quantifying how I spend my time at the computer, so I turned to to Rescuetime, which I have been using successfully on Ubuntu in the past. Unfortunately, the package in the AUR is about 6 months old and there have been several updates of Rescuetime since. Luckily, a few users had posted updated PKGBUILD files in the AUR comment section, which could be used to build the latest version of Rescuetime. After a few minutes of initial confusion, this turned out to be easy and well-documented in the Arch wiki:

# Maintainer: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: kaptoxic dragos240
 
pkgname=rescuetime
pkgver=2.9.10.1255
pkgrel=1
pkgdesc="Application time-tracking for Linux. Stable version"
arch=(i686 x86_64)
url=https://www.rescuetime.com
license=(GPL2)
depends=(qt4 xorg-xprop xprintidle)
conflicts=($pkgname-beta)
install=$pkgname.install
changelog=$pkgname.changelog
 
if [[ $CARCH == "x86_64" ]]
then
    _suffix=amd64
md5sums=('bd81f31fbb13a5b73ac5bf41bbf243f6')
else
    _suffix=i386
md5sums=('79ef7170b5e047712751fa769fd21465')
fi
 
source=($url/installers/rescuetime_current_$_suffix.deb)
 
package() {
    bsdtar -xf data.tar.gz
    install -Dm755 usr/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
    install -Dm755 usr/share/$pkgname/curl-ca-bundle.crt "$pkgdir"/usr/share/$pkgname/curl-ca-bundle.crt
}
  • If not there already, navigate to the same directory as the downloaded git files and use makepkg to build and install Rescuetime.
    • makepkg -s
      • Although -s is supposed to install dependencies, I had to get one from the AUR separately: aura -A xprintidle.
    • makepkg -ic
      • -i installs and -c cleans up files that are not needed anymore.

That’s it! Things are pretty convenient on Arch and its derivatives =)

PhD candidate in stem cell bioengineering

Developmental biology researcher and data science educator