# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id: Portfile 147864 2016-04-19 05:23:35Z easieste@macports.org $ PortSystem 1.0 name bitcoin categories finance crypto version 0.12.1 revision 3 platforms darwin license MIT maintainers easieste yopmail.com:sami.laine openmaintainer description server daemon and client user interface for a peer-to-peer digital currency long_description Bitcoin is a peer-to-peer digital currency. By peer-to-peer, \ we mean that there is no central authority to issue \ new Bitcoins or keep track of transactions. Instead, these \ tasks are managed collectively by the Bitcoin protocol \ operating through the nodes of the network. homepage https://bitcoin.org/ master_sites ${homepage}bin/bitcoin-core-${version}/ checksums rmd160 95d5c0b79969d28d23b3330bb2fb5d4c94fe8919 \ sha256 08fc3b6c05c39fb975bba1f6dd49992df46511790ce8dc67398208af9565e199 patchfiles patch-issue7845.diff depends_build port:pkgconfig \ port:autoconf \ port:automake \ port:libtool depends_lib port:boost \ path:lib/libssl.dylib:openssl \ port:db48 \ port:libevent \ port:miniupnpc \ port:protobuf-cpp \ port:zmq use_parallel_build yes configure.args --disable-ccache \ --disable-silent-rules configure.args-append --with-daemon=no configure.args-append --with-gui=no configure.args-append --enable-wallet=no build.target all test.run yes test.target check default_variants +daemon +wallet set bitcoin_user "bitcoin" set bitcoin_group "${bitcoin_user}" set bitcoin_real_name "Bitcoin Core" add_users ${bitcoin_user} group=${bitcoin_group} realname="${bitcoin_real_name}" set daemon_path "${prefix}/bin/bitcoind" set daemon_working_dir "${prefix}/var/run/bitcoind/" set daemon_conf_file "${prefix}/etc/bitcoin/bitcoin.conf" set daemon_data_dir "${prefix}/var/lib/bitcoind/" set daemon_pid_file "${prefix}/var/run/bitcoind/bitcoind.pid" set gui_app_name "Bitcoin-Qt.app" set gui_app_path "${applications_dir}/${gui_app_name}" set gui_conf_dir "\$HOME/Library/Application Support/Bitcoin/" set gui_conf_file "${gui_conf_dir}bitcoin.conf" set gui_data_dir "${gui_conf_dir}" set gui_pid_file "${gui_conf_dir}bitcoin.pid" set launchd_label "org.macports.${name}" set launchd_plist_path "${prefix}/etc/LaunchDaemons/${launchd_label}/${launchd_label}.plist" set launchd_plist_symlink_path "/Library/LaunchDaemons/${launchd_label}.plist" variant daemon description {Build and install the daemon} { configure.args-replace --with-daemon=no --with-daemon=yes } variant gui description {Build the Qt5 GUI} { configure.args-replace --with-gui=no --with-gui=qt5 depends_lib-append port:qt5 port:qrencode configure.args-append --with-qrencode build.target-replace all appbundle } variant wallet description {Build with support for wallet} { configure.args-replace --enable-wallet=no --enable-wallet=yes } post-destroot { set config_args "-conf=\"${daemon_conf_file}\" -datadir=\"${daemon_data_dir}\" -pid=\"${daemon_pid_file}\"" if {[variant_isset daemon]} { if { [tbool startupitem.install] } { # Install launchd plist for daemon xinstall -d [file dirname "${destroot}/${launchd_plist_path}"] xinstall -m 644 "${filespath}/bitcoind.launchd.plist" "${destroot}/${launchd_plist_path}" reinplace -E " s|@@label@@|${launchd_label}|g; s|@@user_name@@|${bitcoin_user}|g; s|@@group_name@@|${bitcoin_group}|g; s|@@program@@|\"${daemon_path}\" ${config_args}|g; s|@@working_dir@@|${daemon_working_dir}|g; " \ "${destroot}/${launchd_plist_path}" } } if {[variant_isset gui]} { # Install GUI app copy "${worksrcpath}/${gui_app_name}" "${destroot}/${gui_app_path}" } } post-activate { if {[variant_isset daemon]} { xinstall -d [file dirname "${daemon_conf_file}"] xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} "${daemon_data_dir}" xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} [file dirname "${daemon_pid_file}"] file mkdir -p [file dirname "${launchd_plist_symlink_path}"] ln -sf "${launchd_plist_path}" "${launchd_plist_symlink_path}" } } pre-deactivate { if {[variant_isset daemon]} { file delete "${launchd_plist_symlink_path}" } } notes " 1. A launch daemon entry has been created for ${name}. It is disabled by default. To enable and load the daemon: cmd$ sudo launchctl load -w \"${launchd_plist_symlink_path}\" 2. Start the daemon manually in the background: cmd$ ${daemon_path} -daemon 3. Symlink the GUI configuration into your home directory: cmd$ ln -s \"${gui_data_dir}\" ~/.bitcoin 4. View the configuration: # Daemon: cmd$ less \"${daemon_conf_file}\" # GUI: cmd$ less \"${gui_conf_file}\" 5. View the log: # Daemon: cmd$ tail -F \"${daemon_data_dir}debug.log\" # GUI: cmd$ tail -F \"${gui_data_dir}debug.log\" 6. Edit \"${daemon_data_dir}\" and \"${gui_conf_file}\" to include the RPC credentials. See https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#running for more information. " livecheck.type regex livecheck.url ${homepage}bin/ livecheck.regex ${name}-core-(\[0-9.\]+)/