aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2025-08-26 16:07:00 -0500
committerSlack Coder <slackcoder@server.ky>2025-09-04 04:55:00 -0500
commitf7c9b27b590ed1527d913e6083fa3aa2b7ab3ca7 (patch)
tree55cf542918c3748231f006d7700d84c968c31d89
parent3f799ac48e925555c5a771558633675cf3819cdf (diff)
downloadslackbuilds-bitcoin.tar.xz
Add bitcoin: add rc.scriptbitcoin
-rw-r--r--bitcoin/README36
-rw-r--r--bitcoin/bitcoin.SlackBuild154
-rw-r--r--bitcoin/bitcoin.info10
-rw-r--r--bitcoin/doinst.sh30
-rw-r--r--bitcoin/file/bitcoin-qt.desktop10
-rw-r--r--bitcoin/file/bitcoind.conf.new59
-rw-r--r--bitcoin/file/rc.bitcoind.new95
-rw-r--r--bitcoin/slack-desc19
8 files changed, 413 insertions, 0 deletions
diff --git a/bitcoin/README b/bitcoin/README
new file mode 100644
index 0000000..0f38190
--- /dev/null
+++ b/bitcoin/README
@@ -0,0 +1,36 @@
+bitcoin (P2P electronic cash system)
+
+Bitcoin is a free open source peer-to-peer electronic cash system
+that is completely decentralized, without the need for a central
+server or trusted parties. Users hold the crypto keys to their
+own money and transact directly with each other, with the help
+of a P2P network to check for double-spending.
+
+Bitcoin Core connects to the Bitcoin peer-to-peer network to
+download and fully validate blocks and transactions.
+
+Please make sure to read the release notes first before upgrading:
+https://bitcoincore.org/en/releases/29.0/
+
+zeromq is an optional dependency (autodetected). To disable building the graphical components, set GUI=off when building.
+
+To run bitcoin as a system, add to /etc/rc.d/rc.local:
+
+ if [ -x /etc/rc.d/rc.bitcoind ]; then
+ /etc/rc.d/rc.bitcoind start
+ fi
+
+and to /etc/rc.d/rc.local_shutdown (creating it if needed):
+
+ if [ -x /etc/rc.d/rc.bitcoind ]; then
+ /etc/rc.d/rc.bitcoind stop
+ fi
+
+The script requires a 'bitcoin' user/group before running.
+
+ useradd bitcoin \
+ --system \
+ --comment 'bitcoin daemon' \
+ --shell /bin/false \
+ --user-group \
+ --home-dir /var/lib/bitcoin
diff --git a/bitcoin/bitcoin.SlackBuild b/bitcoin/bitcoin.SlackBuild
new file mode 100644
index 0000000..b7c997b
--- /dev/null
+++ b/bitcoin/bitcoin.SlackBuild
@@ -0,0 +1,154 @@
+#!/bin/bash
+
+# Slackware build script for bitcoin
+
+# Copyright 2012-2025 nomnombtc <nomnombtc@arcor.de>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=bitcoin
+VERSION=${VERSION:-29.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_slackcoder}
+PKGTYPE=${PKGTYPE:-tgz}
+GUI=${GUI:-yes}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+# allow disabling all the GUI apps
+if [ "$GUI" != "yes" ]; then
+ GUI=ON
+else
+ GUI=OFF
+fi
+
+# autodetect build time options
+if pkg-config --exists libzmq; then ZMQ=ON; else ZMQ=OFF; fi
+
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# cmake in 15.0 is slightly too old, needs cmake-opt.
+if [ $(cmake /V | awk 'NR==1{print $3}') == "3.21.4" ]; then
+ echo "export PATH for cmake-opt"
+ export PATH="/opt/cmake-opt/bin/:$PATH"
+fi
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib${LIBDIRSUFFIX} \
+ -DCMAKE_INSTALL_MANDIR=/usr/man \
+ -DBUILD_TESTS=OFF \
+ -DBUILD_GUI=$GUI \
+ -DBUILD_TX=ON \
+ -DBUILD_UTIL=ON \
+ -DBUILD_WALLET_TOOL=ON \
+ -DWITH_BDB=ON \
+ -DWITH_QRENCODE=ON \
+ -DWITH_ZMQ=$ZMQ \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install/strip DESTDIR=$PKG
+cd ..
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+install -D -g bitcoin -m 0640 $CWD/file/bitcoind.conf.new $PKG/etc/bitcoin/bitcoind.conf.new
+install -D -m 0644 $CWD/file/rc.bitcoind.new $PKG/etc/rc.d/rc.bitcoind.new
+
+mkdir -p $PKG/usr/share/{applications,pixmaps}
+install -m 0644 src/qt/res/icons/bitcoin.png $PKG/usr/share/pixmaps/
+install -m 0644 $CWD/file/bitcoin-qt.desktop $PKG/usr/share/applications/
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ COPYING doc/{bitcoin-conf,descriptors,files,i2p,{JSON-RPC,REST}-interface,\
+managing-wallets,multisig-tutorial,p2p-bad-ports,psbt,reduce-{memory,traffic},\
+release-notes,tor,zmq}.md share/rpcauth/rpcauth.py \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/var/lib/bitcoind
+chown bitcoin:bitcoin $PKG/var/lib/bitcoind
+chmod a=,u=rwX $PKG/var/lib/bitcoind
+
+mkdir -p $PKG/var/log/bitcoind
+chown bitcoin:bitcoin $PKG/var/log/bitcoind
+chmod a=rX,u=rwX $PKG/var/log/bitcoind
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/bitcoin/bitcoin.info b/bitcoin/bitcoin.info
new file mode 100644
index 0000000..d148721
--- /dev/null
+++ b/bitcoin/bitcoin.info
@@ -0,0 +1,10 @@
+PRGNAM="bitcoin"
+VERSION="29.0"
+HOMEPAGE="https://bitcoincore.org"
+DOWNLOAD="https://bitcoincore.org/bin/bitcoin-core-29.0/bitcoin-29.0.tar.gz"
+MD5SUM="2fc939451a3755f92906cf3e6ee11e32"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="cmake-opt"
+MAINTAINER="nomnombtc"
+EMAIL="nomnombtc@arcor.de"
diff --git a/bitcoin/doinst.sh b/bitcoin/doinst.sh
new file mode 100644
index 0000000..eb6b05f
--- /dev/null
+++ b/bitcoin/doinst.sh
@@ -0,0 +1,30 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications
+fi
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/bitcoin/bitcoind.conf.new
+preserve_perms etc/rc.d/rc.bitcoind.new
diff --git a/bitcoin/file/bitcoin-qt.desktop b/bitcoin/file/bitcoin-qt.desktop
new file mode 100644
index 0000000..858ab28
--- /dev/null
+++ b/bitcoin/file/bitcoin-qt.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Bitcoin-Core
+GenericName=Bitcoin QT-Client
+Comment=Bitcoin client to send and receive money
+Exec=/usr/bin/bitcoin-qt
+Icon=bitcoin
+StartupNotify=true
+Terminal=false
+Type=Application
+Categories=Network;P2P
diff --git a/bitcoin/file/bitcoind.conf.new b/bitcoin/file/bitcoind.conf.new
new file mode 100644
index 0000000..2189ba1
--- /dev/null
+++ b/bitcoin/file/bitcoind.conf.new
@@ -0,0 +1,59 @@
+# Data directory
+datadir=/var/lib/bitcoind
+
+# <category> are: addrman, bench, blockstorage, cmpctblock, coindb,
+# Output debug and trace logging (default: -nodebug, supplying <category>
+# any other categories are ignored. Other valid values for
+# estimatefee, http, i2p, ipc, leveldb, libevent, mempool,
+# is optional). If <category> is not supplied or if <category> is 1
+# mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan,
+# or "all", output all debug logging. If <category> is 0 or "none",
+# output multiple categories.
+# selectcoins, tor, txpackages, txreconciliation, validation,
+# walletdb, zmq. This option can be specified multiple times to
+debug=none
+
+# Specify location of debug log file. Relative paths will be prefixed by a
+# net-specific datadir location.
+debuglogfile=/var/log/bitcoind/bitcoind.log
+
+# pid file to track the running process. Relative paths will be prefixed by a
+# net-specific datadir location.
+pid=/run/bitcoind/bitcoind.pid
+
+# '1' tells Bitcoin to accept JSON-RPC commands so that your fullnode can be run as a server
+server=1
+
+# Accept connections from outside.
+# listen=1
+
+# Reduce storage requirements by enabling pruning (deleting) of old
+# blocks. This allows the pruneblockchain RPC to be called to
+# delete specific blocks and enables automatic pruning of old
+# blocks if a target size in MiB is provided. This mode is
+# incompatible with -txindex. Warning: Reverting this setting
+# requires re-downloading the entire blockchain. (default: 0 =
+# disable pruning blocks, 1 = allow manual pruning via RPC, >=550 =
+# automatically prune block files to stay under the specified
+# target size in MiB)
+# prune=550
+
+# Automatically create Tor onion service.
+# listenonion=1
+
+# How many seconds Bitcoin will wait for a complete RPC HTTP request
+# after the HTTP connection is established.
+rpctimeout=30
+
+# By default, only RPC connections from localhost are allowed. Specify
+# as many rpcallowip= settings as you like to allow connections from
+# other hosts (and you may use * as a wildcard character):
+#rpcallowip=10.1.1.*
+#rpcallowip=192.168.1.*
+
+# Bind to given address to listen for JSON-RPC connections. Do not expose the
+# RPC server to untrusted networks such as the public internet! This option is
+# ignored unless -rpcallowip is also passed. Port is optional and overrides
+# -rpcport. Use [host]:port notation for IPv6. This option can be specified
+# multiple times (default: 127.0.0.1 and ::1 i.e., localhost)
+# rpcbind=localhost:8332
diff --git a/bitcoin/file/rc.bitcoind.new b/bitcoin/file/rc.bitcoind.new
new file mode 100644
index 0000000..288f39e
--- /dev/null
+++ b/bitcoin/file/rc.bitcoind.new
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+# Time to wait for Bitcoin to gracefully stop.
+TIMEOUT=${TIMEOUT:-5000}
+
+create_bitcoind_run_dir() {
+ if [ ! -d /run/bitcoind/ ]; then
+ mkdir -p /run/bitcoind
+ chown bitcoin:bitcoin /run/bitcoind
+ fi
+}
+
+bitcoind_start() {
+ create_bitcoind_run_dir
+
+ echo -n "Starting Bitcoin daemon: "
+
+ local pid=""
+ if [ -f /run/bitcoind/bitcoind.pid ] && ! pid=$(</run/bitcoind/bitcoind.pid); then
+ return
+ fi
+
+ if [ ! -z "$pid" ] && /bin/kill -0 "$pid" >/dev/null; then
+ echo "already running"
+
+ return
+ fi
+
+ if ! daemon \
+ --user bitcoin:bitcoin \
+ -- \
+ bitcoind \
+ -conf=/etc/bitcoin/bitcoind.conf \
+ -daemon=0; then
+ echo "failed"
+ else
+ echo "ok"
+ fi
+}
+
+bitcoind_status() {
+ create_bitcoind_run_dir
+
+ echo -n "Bitcoin daemon: "
+
+ local pid=""
+ if [ -f /run/bitcoind/bitcoind.pid ] && ! pid=$(</run/bitcoind/bitcoind.pid); then
+ return
+ fi
+
+ if [ ! -z "$pid" ] && /bin/kill -0 "$pid" 2>/dev/null; then
+ echo "running"
+ else
+ echo "not running"
+ fi
+}
+
+bitcoind_stop() {
+ create_bitcoind_run_dir
+
+ echo -n "Stopping Bitcoin daemon: "
+
+ local pid=""
+ if [ -f /run/bitcoind/bitcoind.pid ] && ! pid=$(</run/bitcoind/bitcoind.pid); then
+ return
+ fi
+
+ if [ -z "$pid" ] || ! /bin/kill -0 "$pid" 2>/dev/null; then
+ echo "not running"
+
+ return
+ fi
+
+ if /bin/kill --timeout "${TIMEOUT}" TERM "$pid"; then
+ echo "stopped"
+ else
+ /bin/kill KILL "$pid"
+ echo "killed"
+ fi
+}
+
+case "$1" in
+start)
+ bitcoind_start
+ ;;
+status)
+ bitcoind_status
+ ;;
+stop)
+ bitcoind_stop
+ ;;
+*)
+ echo "Usage: $0 {start|status|stop}"
+ exit 1
+esac
diff --git a/bitcoin/slack-desc b/bitcoin/slack-desc
new file mode 100644
index 0000000..64e49a1
--- /dev/null
+++ b/bitcoin/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+bitcoin: bitcoin (P2P electronic cash system)
+bitcoin:
+bitcoin: Bitcoin is a free open source peer-to-peer electronic cash system
+bitcoin: that is completely decentralized, without the need for a central
+bitcoin: server or trusted parties. Users hold the crypto keys to their
+bitcoin: own money and transact directly with each other, with the help
+bitcoin: of a P2P network to check for double-spending.
+bitcoin:
+bitcoin: Project Website: https://bitcoincore.org
+bitcoin:
+bitcoin: