From 6804f07e9286e9f1c14bb97f03d0cfb3eda72d48 Mon Sep 17 00:00:00 2001 From: fbt Date: Thu, 21 Jan 2016 15:58:28 +0300 Subject: [PATCH] init --- PKGBUILD | 67 ++++++++++++++++++++++++++++++++++++++++++ anope-services.install | 23 +++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 PKGBUILD create mode 100644 anope-services.install diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..e9616c1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: Jack L. Frost + +#pkgbase= +pkgname=anope-services +pkgver=2.0.2 +pkgrel=1 +pkgdesc='A set of IRC Services designed for flexibility and ease of use' +url='http://anope.org' +arch=( 'x86_64' 'i686' ) +license=( 'GPL' ) +makedepends=( 'cmake' ) +install=anope-services.install + +source=( + "https://github.com/anope/anope/releases/download/${pkgver}/anope-${pkgver}-source.tar.gz" + 'anope-services.install' +) + +build() { + cd "anope-${pkgver}-source" + + # Non-interactive config + cat <<- EOF > config.cache + INSTDIR="$srcdir/anope-services" + RUNGROUP="anope" + UMASK=077 + DEBUG="no" + USE_RUN_CC_PL="no" + USE_PCH="no" + EXTRA_INCLUDE_DIRS="" + EXTRA_LIB_DIRS="" + EXTRA_CONFIG_ARGS="" + EOF + + ./Config -nointro -quick + + cd build + make + make install +} + +package() { + cd "${srcdir}/anope-services" + + # Create directories + install -Dd "${pkgdir}"{/var/log,/var/lib,/etc,/usr/lib}/${pkgname} + install -Dd "${pkgdir}/var/lib/${pkgname}/runtime" + install -Dd "${pkgdir}/usr/bin" + install -Dd "${pkgdir}/usr/lib/${pkgname}"/{modules,locale} + + # Copy files + + # Executable files + install -Dm755 bin/{anopesmtp,services} "${pkgdir}/usr/bin" + + # Configuration files + install -Dm644 conf/*.conf "${pkgdir}/etc/${pkgname}" + + # Loadable modules + install -Dm644 lib/modules/* "${pkgdir}/usr/lib/${pkgname}/modules" + + cp -r data/* "${pkgdir}/var/lib/${pkgname}" + cp -r locale/* "${pkgdir}/usr/lib/${pkgname}/locale" +} + +# vim: noet +sha1sums=('ae365d90edbc4cecbfa64cc79f39dca2db0e851c') diff --git a/anope-services.install b/anope-services.install new file mode 100644 index 0000000..b2c7c49 --- /dev/null +++ b/anope-services.install @@ -0,0 +1,23 @@ +post_install() { + if ! getent group anope &>/dev/null; then + groupadd -r anope + fi + + if ! getent passwd anope &>/dev/null; then + useradd -r -g anope -d /var/lib/anope -s /bin/false -c anope anope + fi + + echo "Example config is in /etc/anope/example.conf." + echo "Copy it to /etc/anope/services.conf and modify it." +} + +post_remove() { + if getent passwd anope &>/dev/null; then + userdel anope + fi + + if getent group anope &>/dev/null; then + groupdel anope + fi +} +