96 lines
3.0 KiB
Bash
96 lines
3.0 KiB
Bash
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
# you also find the URL of a binary repository.
|
|
|
|
_reponame=repoindex
|
|
pkgname=(repoindex{,-header,-web,-gui})
|
|
_name=${pkgname%-git}
|
|
pkgver=0.2.1
|
|
pkgrel=1
|
|
arch=('i686' 'x86_64')
|
|
pkgdesc='Repository browser for Arch Linux'
|
|
license=('GPL')
|
|
depends=('qt5-base' 'qt5-websockets' 'karchive' 'pacman' 'c++utilities')
|
|
makedepends=('cmake' 'git' 'yuicompressor' 'qtutilities')
|
|
backup=("etc/${_reponame}.conf")
|
|
provides=("${_name}")
|
|
conflicts=("${_name}")
|
|
url="https://github.com/Martchus/${_reponame}"
|
|
options=(emptydirs)
|
|
source=("${_reponame}::git://github.com/Martchus/${_reponame}.git")
|
|
sha256sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd "${srcdir}/${pkgname}"
|
|
echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"
|
|
make
|
|
}
|
|
|
|
package_repoindex() {
|
|
pkgdesc="Repository browser for Arch Linux (provides server binary, git version)."
|
|
depends=('qt5-base' 'qt5-websockets' 'karchive' 'c++utilities')
|
|
optdepends=('repoindex-header: header files')
|
|
optdepends=('repoindex-web: file for web UI')
|
|
optdepends=('repoindex-gui: application showing the web UI')
|
|
|
|
# install files
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
make DESTDIR="${pkgdir}" install-binary install-service install-config install-bash-completion
|
|
|
|
# make directories for cache and data
|
|
mkdir -p "$pkgdir/var/cache/$_reponame"
|
|
chown http:http "$pkgdir/var/cache/$_reponame"
|
|
mkdir -p "$pkgdir/var/lib/$_reponame/sync"
|
|
chown http:http "$pkgdir/var/lib/$_reponame/"{,sync}
|
|
mkdir -p "$pkgdir/etc"
|
|
cp "$pkgdir/usr/share/$_reponame/skel/repoindex.conf.js" "$pkgdir/etc/repoindex.conf"
|
|
}
|
|
|
|
package_repoindex-header() {
|
|
arch=('any')
|
|
pkgdesc="Repository browser for Arch Linux (provides header files, git version)"
|
|
depends=('repoindex')
|
|
backup=()
|
|
|
|
# must call cmake again to adjust install prefix
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"
|
|
|
|
# install files
|
|
make DESTDIR="${pkgdir}" install-header
|
|
}
|
|
|
|
package_repoindex-web() {
|
|
arch=('any')
|
|
pkgdesc="Repository browser for Arch Linux (provides assets for web interface, git version)"
|
|
depends=('repoindex')
|
|
backup=()
|
|
|
|
# must call cmake again to adjust install prefix
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"
|
|
|
|
# install files
|
|
make DESTDIR="${pkgdir}" install-web
|
|
}
|
|
|
|
package_repoindex-gui() {
|
|
pkgdesc="Repository browser for Arch Linux (provides an desktop app showing the web UI, git version)"
|
|
depends=('repoindex-web' 'qt5-webengine')
|
|
install=${_reponame}.install
|
|
backup=()
|
|
|
|
# must call cmake again to adjust install prefix
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"
|
|
|
|
# install files
|
|
make DESTDIR="${pkgdir}" install-binary-gui install-desktop
|
|
}
|