makedeb


simh-git 4.0b1+3088+g5ded4f2c-1


The Computer History Simulation Project

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for simh-git.

# Maintainer: John Ruschmeyer <jruschme@gmail.com>
# Contributor: Alexander Jacocks <alexander@redhat.com>
# Contributor: R. van Elst <https://raymii.org>

pkgname="simh-git"
pkgver=4.0b1+3088+g5ded4f2c
pkgrel=1
pkgdesc="The Computer History Simulation Project"
arch=('i386' 'amd64')
url="http://simh.trailing-edge.com/"
license=('MIT')
depends=('libpcap0.8' 'unzip' 'libsdl2-2.0-0' 'fonts-dejavu' 'zlib1g' 'libpng16-16')
makedepends=('unoconv' 'libpcap-dev' 'libsdl2-dev' 'zlib1g-dev' 'libpng-dev')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=('git+https://github.com/simh/simh.git')
sha512sums=('SKIP')

pkgver() {
  cd "../${pkgname%-*}"
  git fetch --unshallow || git fetch --all
  git describe --long --tags | sed 's/v//; s/-Beta-/b/; s/-/+/g'
}

build() {
  cd "${pkgname%-*}"
  { test "$(nproc)" -gt 1 && make -j"$(nproc)" ;} || make
}

package() {
  echo "Entering directory $srcdir/simh/BIN."
  install -d "$pkgdir/usr/bin"
  cd "$srcdir/simh/BIN"
  for i in *; do
    { test -d "$i" && echo "Skipping directory $i." ;} || install "$i" "$pkgdir/usr/bin/simh-$i"
  done
  cd "$srcdir/simh/BIN/buildtools"
  echo "Entering directory $srcdir/simh/BIN/buildtools."
  for i in *; do
    { test -d "$i" && echo "Skipping directory $i." ;} || install "$i" "$pkgdir/usr/bin/simh-$i"
  done

  for dir in VAX swtp6800/swtp6800 3B2; do
    echo "Entering directory $srcdir/simh/$dir."
    cd "$srcdir/simh/$dir"
    find . -type f -name "*.bin" -exec install -D -t "$pkgdir/usr/lib/$pkgname" {} \;
    find . -type f -name "*.exe" -exec install -D -t "$pkgdir/usr/lib/$pkgname" {} \;
  done

  echo "Entering directory $srcdir/simh/doc."
  cd "$srcdir/simh/doc"
  unoconv -d document --format=html *.doc
  unoconv -d document --format=txt *.doc
  # install -D -t "$pkgdir/usr/share/doc/$pkgname" *.doc
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.html
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.pdf
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.txt

  echo "Entering directory $srcdir/simh."
  cd "$srcdir/simh"
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.md
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.txt
}