summaryrefslogtreecommitdiff
path: root/community/cgminer
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-11-15 01:46:35 -0800
committerroot <root@rshg054.dnsready.net>2012-11-15 01:46:35 -0800
commit2264379d37a6a00a3ecec1fd03c5dd4796078d49 (patch)
treec7d44781aab3d74058a981f8e9035eee06f8f5bc /community/cgminer
parent6fa5f08247aef1f757f376ef12bd4a6257c124f2 (diff)
Thu Nov 15 01:46:22 PST 2012
Diffstat (limited to 'community/cgminer')
-rw-r--r--community/cgminer/PKGBUILD56
-rw-r--r--community/cgminer/cgminer51
-rw-r--r--community/cgminer/cgminer.conf.d11
-rw-r--r--community/cgminer/cgminer.service8
4 files changed, 126 insertions, 0 deletions
diff --git a/community/cgminer/PKGBUILD b/community/cgminer/PKGBUILD
new file mode 100644
index 000000000..f1bcc82c3
--- /dev/null
+++ b/community/cgminer/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Felix Yan <felixonmars@gmail.com>
+# Contributor: monson <holymonson@gmail.com>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+# Contributor: David Manouchehri <david@davidmanouchehri.com>
+
+pkgname=cgminer
+pkgver=2.9.3
+_build=
+pkgrel=1
+pkgdesc="Multi-threaded multi-pool CPU and GPU miner for bitcoin, forked from cpuminer."
+url='http://forum.bitcoin.org/index.php?topic=28402.0'
+license=('GPL3')
+arch=('i686' 'x86_64')
+depends=('curl' 'libcl')
+makedepends=('opencl-headers')
+optdepends=('opencl-nvidia: OpenCL implementation for NVIDIA' \
+ 'intel-opencl-sdk: OpenCL implementation for Intel' \
+ 'amdstream: OpenCL implementation for AMD')
+source=("http://ck.kolivas.org/apps/cgminer/$pkgname-$pkgver.tar.bz2"
+ "$pkgname.conf.d"
+ "$pkgname"
+ "$pkgname.service")
+backup=("etc/conf.d/$pkgname" "etc/$pkgname.conf")
+
+[ $CARCH == 'x86_64' ] && makedepends+=('yasm')
+
+build() {
+ cd "$srcdir"
+ cd $pkgname-$pkgver${_build}
+
+ # Use in-tree jansson since it is not compatible with jansson 2.0
+ #sed -e 's/^AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)$/request_jansson=true/' -i configure.ac
+
+ # Here you may want to use custom CFLAGS
+ #export CFLAGS="-O2 -march=native -mtune=native -msse2"
+
+ ./configure --prefix=/usr --enable-cpumining
+
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver${_build}
+
+ make DESTDIR="$pkgdir" install
+
+ install -Dm755 "$srcdir"/$pkgname "$pkgdir"/etc/rc.d/$pkgname
+ install -Dm644 "$srcdir"/$pkgname.service "$pkgdir"/usr/lib/systemd/system/$pkgname.service
+ install -Dm644 "$srcdir"/$pkgname.conf.d "$pkgdir"/etc/conf.d/$pkgname
+ sed 's#/usr/local/bin#/usr/bin#g' example.conf > $pkgname.conf
+ install -Dm644 $pkgname.conf "$pkgdir"/etc/$pkgname.conf
+}
+md5sums=('f386036c72861f7b2c130de6ed990d33'
+ 'fe4a243fabe24608f5c05e40f0f118f6'
+ 'ee39698273671fee0e98d4af16014c36'
+ 'c2bb974adf92cc234fbf0136ebcb355d')
diff --git a/community/cgminer/cgminer b/community/cgminer/cgminer
new file mode 100644
index 000000000..9081e8e77
--- /dev/null
+++ b/community/cgminer/cgminer
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON=cgminer
+
+# stupid patch var
+export HOME=/root
+
+[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
+
+if [ -r $CGMINER_CONF ]; then
+ ARGS="--config $CGMINER_CONF $CGMINER_ARGS"
+else
+ ARGS="--url $CGMINER_PROTOCOL://$CGMINER_IP:$CGMINER_PORT --user $CGMINER_USER --pass $CGMINER_PASS $CGMINER_ARGS"
+fi
+
+PID=$(get_pid $DAEMON)
+
+case "$1" in
+ start)
+ stat_busy "Starting $DAEMON"
+ [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null &
+ if [ $? = 0 ]; then
+ add_daemon $DAEMON
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping $DAEMON"
+ [ -n "$PID" ] && kill $PID &>/dev/null
+ if [ $? = 0 ]; then
+ rm_daemon $DAEMON
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
diff --git a/community/cgminer/cgminer.conf.d b/community/cgminer/cgminer.conf.d
new file mode 100644
index 000000000..88ec535d6
--- /dev/null
+++ b/community/cgminer/cgminer.conf.d
@@ -0,0 +1,11 @@
+# Use JSON-format configuration. (recommended)
+CGMINER_CONF="/etc/cgminer.conf"
+
+# Uncommend this if you prefer simple command-line arguments.
+#CGMINER_CONF=""
+#CGMINER_PROTOCOL="http"
+#CGMINER_IP="127.0.0.1"
+#CGMINER_PORT="8332"
+#CGMINER_USER="username"
+#CGMINER_PASS="password"
+CGMINER_ARGS="--syslog"
diff --git a/community/cgminer/cgminer.service b/community/cgminer/cgminer.service
new file mode 100644
index 000000000..9d6595047
--- /dev/null
+++ b/community/cgminer/cgminer.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Multi-threaded multi-pool CPU and GPU miner for bitcoin
+
+[Service]
+ExecStart=/usr/bin/cgminer -T --config /etc/cgminer.conf
+
+[Install]
+WantedBy=multi-user.target