diff options
author | Gustavo Alvarez | 2016-04-27 17:57:45 +0200 |
---|---|---|
committer | Gustavo Alvarez | 2016-04-27 17:57:45 +0200 |
commit | de6f00d011835f004af2a76abe2fb07d12288b01 (patch) | |
tree | 5f26e217e2fa9e86f0b6778d8ce77cdae0e66db7 | |
download | aur-de6f00d011835f004af2a76abe2fb07d12288b01.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 43 | ||||
-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | PKGBUILD | 115 | ||||
-rw-r--r-- | adchpp-hg.install | 32 | ||||
-rw-r--r-- | adchpp.service | 11 | ||||
-rw-r--r-- | adchpp.sh | 7 | ||||
-rw-r--r-- | adchpp.sysuser | 2 | ||||
-rw-r--r-- | adchpp.tmpfile | 1 |
8 files changed, 221 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2badca9a5e40 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,43 @@ +# Generated by mksrcinfo v8 +# Wed Apr 27 15:57:45 UTC 2016 +pkgbase = adchpp-hg + pkgdesc = ADCH++ is a hub software for the ADC network. (Mercurial Version) + pkgver = 2.12.1.725.c290861e08cd + pkgrel = 1 + url = http://adchpp.sourceforge.net + install = adchpp-hg.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = mercurial + makedepends = scons + makedepends = swig + makedepends = asciidoc + depends = ruby + depends = python2 + depends = boost-libs + provides = adchpp + conflicts = adchpp + backup = etc/adchpp/Script.xml + backup = etc/adchpp/adchpp.xml + source = adchpp::hg+http://hg.code.sf.net/p/adchpp/code + source = adchpp.sh + source = adchpp.service + source = adchpp.tmpfile + source = adchpp.sysuser + source = http://data.gpo.zugaina.org/klondike/net-p2p/adchpp/files/adchpp-2.8.0-fix_config_paths.patch + source = http://data.gpo.zugaina.org/klondike/net-p2p/adchpp/files/adchpp-2.11.0-fix_cflags.patch + source = https://dl.dropboxusercontent.com/u/6596386/adchpp-2.9.0-fix_store_files_in_config_dir_access.guard_plugin.patch + source = https://dl.dropboxusercontent.com/u/6596386/adchpp-2.9.0-fix_log_path.patch + sha1sums = SKIP + sha1sums = d903e8241dec8e6c96b741f52a43a75894471cf7 + sha1sums = b834071b7bd39effcdc6bdeaa61f3e877757583b + sha1sums = d8c98ccc13ffda1c68bd1d356f51ae99dd1a5ba2 + sha1sums = 7f270a8803871e6b25b9ed15d60ba765df9e3741 + sha1sums = e2e396e0542df153a312c0b43275a321511d0209 + sha1sums = 04c2bba95ab80d56a0e56fa9cd3f0b2edce88e23 + sha1sums = c201970be161b01d30a4c6761235f47aad9fec4e + sha1sums = 1e40351b4be6441979229d63210b43817c9819bf + +pkgname = adchpp-hg + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..286dab4ababc --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +* +!.gitignore +!.SRCINFO +!PKGBUILD +!adchpp-hg.install +!adchpp.service +!adchpp.sysuser +!adchpp.tmpfile +!adchpp.sh + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..83c12bd557b3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,115 @@ +# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com> + +pkgname=adchpp-hg +pkgver=2.12.1.725.c290861e08cd +pkgrel=1 +pkgdesc="ADCH++ is a hub software for the ADC network. (Mercurial Version)" +url='http://adchpp.sourceforge.net' +arch=('i686' 'x86_64') +license=('GPL') +depends=('ruby' + 'python2' + 'boost-libs' + ) #'lua51' 'lua51-filesystem' 'lua51-socket' +makedepends=('mercurial' + 'scons' + 'swig' + 'asciidoc' + ) +provides=('adchpp') +conflicts=('adchpp') +backup=('etc/adchpp/Script.xml' + 'etc/adchpp/adchpp.xml' + ) +source=("adchpp::hg+http://hg.code.sf.net/p/adchpp/code" + 'adchpp.sh' + 'adchpp.service' + 'adchpp.tmpfile' + 'adchpp.sysuser' + 'http://data.gpo.zugaina.org/klondike/net-p2p/adchpp/files/adchpp-2.8.0-fix_config_paths.patch' + 'http://data.gpo.zugaina.org/klondike/net-p2p/adchpp/files/adchpp-2.11.0-fix_cflags.patch' + 'https://dl.dropboxusercontent.com/u/6596386/adchpp-2.9.0-fix_store_files_in_config_dir_access.guard_plugin.patch' + 'https://dl.dropboxusercontent.com/u/6596386/adchpp-2.9.0-fix_log_path.patch' + ) +sha1sums=('SKIP' + 'd903e8241dec8e6c96b741f52a43a75894471cf7' + 'b834071b7bd39effcdc6bdeaa61f3e877757583b' + 'd8c98ccc13ffda1c68bd1d356f51ae99dd1a5ba2' + '7f270a8803871e6b25b9ed15d60ba765df9e3741' + 'e2e396e0542df153a312c0b43275a321511d0209' + '04c2bba95ab80d56a0e56fa9cd3f0b2edce88e23' + 'c201970be161b01d30a4c6761235f47aad9fec4e' + '1e40351b4be6441979229d63210b43817c9819bf' + ) +install=adchpp-hg.install + +[ "$CARCH" = "i686" ] && _arch="x86" +[ "$CARCH" = "x86_64" ] && _arch="x64" + +pkgver() { + cd adchpp + _ver="$(cat ${srcdir}/adchpp/adchpp/version.cpp | grep VERSIONSTRING | grep -o "[[:digit:]]*" | paste -sd'.')" + echo "${_ver}.$(hg log -r -1 --template '{rev}.{node|short}\n')" +} + +prepare() { + cd adchpp + + # Use python2 + rm -rf "${srcdir}/python" + mkdir "${srcdir}/python" + ln -s /usr/bin/python2 "${srcdir}/python/python" + export PATH="${srcdir}"/python:$PATH + + # Patch + patch -p1 -i "${srcdir}/adchpp-2.8.0-fix_config_paths.patch" + patch -p1 -i "${srcdir}/adchpp-2.11.0-fix_cflags.patch" + patch -p0 -i "${srcdir}/adchpp-2.9.0-fix_store_files_in_config_dir_access.guard_plugin.patch" + patch -p0 -i "${srcdir}/adchpp-2.9.0-fix_log_path.patch" + sed -e "s|%%ADCHPPLIB%%|/usr/lib/adchpp|g" \ + -e "s|%%ADCHPPSHARE%%|/usr/share/adchpp|g" \ + -e "s|%%ADCHPPETC%%|/etc/adchpp|g" \ + -e "s|%%ADCHPPLOG%%|/var/log/adchpp|g" \ + -i etc/adchpp.xml -i etc/Script.xml -i rbutil/adchpp.rb -i pyutil/adchpp.py + + # Ugly patch: set path for volatile files created by lua scripts + sed -e "/luadchpp.)/a-- set path of volatile files\nlocal varfilepath = \"/var/lib/adchpp/\"\n" \ + -e 's|adchpp.Util_getCfgPath()|varfilepath|g' \ + -i plugins/Script/examples/*lua + + # Dos2Unix + find -type f -exec perl -pi -e 's/\r\n?/\n/g' "{}" \; + + # Silence build warnings + sed 's|_BSD_SOURCE|_DEFAULT_SOURCE|g' -i SConstruct +} + +build() { + cd adchpp + scons -j"$(nproc)" mode=release docs=yes ssl=yes langs=all tools=default systemboost=yes ruby=ruby arch="${_arch}" #systemlua=yes lua=lua5.1 +} + +package() { + cd adchpp + + install -Dm755 ../adchpp.sh "${pkgdir}/usr/bin/adchpp" + install -Dm755 "build/release-default-${_arch}/bin/adchppd" "${pkgdir}/usr/lib/adchpp/adchpp" + + (cd "build/release-default-${_arch}/bin"; for i in $(find . -maxdepth 1 -type f -name "*.so"); do install -Dm755 "${i}" "${pkgdir}/usr/lib/adchpp/${i}"; done) + + install -Dm755 linux/generate_certs.sh "${pkgdir}/usr/share/adchpp/generate_certs.sh" + + install -d "${pkgdir}/etc/adchpp/certs/trusted" + + install -Dm644 etc/adchpp.xml "${pkgdir}/etc/adchpp/adchpp.xml" + install -Dm644 etc/Script.xml "${pkgdir}/etc/adchpp/Script.xml" + + (cd plugins/Script/examples ; for i in $(find . -type f); do install -Dm644 "${i}" "${pkgdir}/usr/share/adchpp/scripts/${i}"; done) + for i in $(find pyutil rbutil -type f); do install -Dm644 "${i}" "${pkgdir}/usr/share/adchpp/${i}"; done + + (cd build/docs; for i in $(find . -type f); do install -Dm644 "${i}" "${pkgdir}/usr/share/doc/adchpp/${i}"; done) + + install -Dm644 ../adchpp.service "${pkgdir}/usr/lib/systemd/system/adchpp.service" + install -Dm644 ../adchpp.tmpfile "${pkgdir}/usr/lib/tmpfiles.d/adchpp.conf" + install -Dm644 ../adchpp.sysuser "${pkgdir}/usr/lib/sysusers.d/adchpp.conf" +} diff --git a/adchpp-hg.install b/adchpp-hg.install new file mode 100644 index 000000000000..b6b32fd9fb87 --- /dev/null +++ b/adchpp-hg.install @@ -0,0 +1,32 @@ +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +yellow="${bold}$(tput setaf 3)" +blue="${bold}$(tput setaf 4)" +green="${bold}$(tput setaf 2)" + +post_install() { + post_upgrade $1 +} + +post_upgrade() { + systemd-sysusers adchpp.conf + systemd-tmpfiles --create adchpp.conf + + install -dm744 -o adchpp -g adchpp /var/log/adchpp + install -dm744 -o adchpp -g adchpp /var/lib/adchpp +} + +post_remove() { + paths=(/etc/adchpp /var/lib/adchpp /var/log/adchpp) + + first=true + for path in ${paths[@]}; do + if [ -d $path ]; then + if $first; then + first=false + printf "${green}==>${all_off} ${bold}Leftover Paths:${all_off}\n" + fi + printf "${blue} -> ${all_off} ${bold}$path${all_off}\n" + fi + done +} diff --git a/adchpp.service b/adchpp.service new file mode 100644 index 000000000000..1111cae99758 --- /dev/null +++ b/adchpp.service @@ -0,0 +1,11 @@ +[Unit] +Description=ADCH++ - Advanced DirectConnect Hub +After=network.target + +[Service] +User=adchpp +ExecStart=/usr/bin/adchpp +ExecStop=/bin/kill -s SIGINT -q 5 $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/adchpp.sh b/adchpp.sh new file mode 100644 index 000000000000..90f5f02270e8 --- /dev/null +++ b/adchpp.sh @@ -0,0 +1,7 @@ +#!/bin/sh +if [ -z "$LD_LIBRARY_PATH" ] ; then + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/adchpp" +else + export LD_LIBRARY_PATH="/usr/lib/adchpp" +fi +exec /usr/lib/adchpp/adchpp -p /run/adchpp/adchpp.pid "$@" diff --git a/adchpp.sysuser b/adchpp.sysuser new file mode 100644 index 000000000000..b8417e0f7da8 --- /dev/null +++ b/adchpp.sysuser @@ -0,0 +1,2 @@ +g adchpp - - - +u adchpp - "ADCHpp Hub" /var/lib/adchpp diff --git a/adchpp.tmpfile b/adchpp.tmpfile new file mode 100644 index 000000000000..bb81beff9734 --- /dev/null +++ b/adchpp.tmpfile @@ -0,0 +1 @@ +d /run/adchpp 0755 adchpp adchpp |