%define debug_package %{nil} Name: mavryk-node Version: 20.2rc3 Release: 1 Epoch: 1 Summary: Entry point for initializing, configuring and running a Mavryk node License: MIT BuildArch: x86_64 aarch64 Source0: mavryk-node-20.2rc3.tar.gz Source1: https://gitlab.com/mavryk-network/mavryk-protocol/tree/v20.2-rc3/ BuildRequires: make cmake m4 perl pkg-config wget unzip rsync gcc cargo opam git autoconf coreutils libev-devel gmp-devel hidapi-devel libffi-devel zlib-devel libpq-devel protobuf-compiler protobuf-devel sqlite-devel systemd systemd-rpm-macros Requires: libev-devel gmp-devel hidapi-devel libffi-devel zlib-devel libpq-devel protobuf-compiler protobuf-devel sqlite-devel, mavryk-sapling-params, curl %description Entry point for initializing, configuring and running a Mavryk node Maintainer: Mavryk Dynamics Cowbot %prep %setup -q %build %install make mavkit-node mkdir -p %{buildroot}/%{_bindir} install -m 0755 mavkit-node %{buildroot}/%{_bindir} ln -s %{_bindir}/mavkit-node %{buildroot}/%{_bindir}/mavryk-node install -m 0755 mavkit-node-mainnet %{buildroot}/%{_bindir}/ install -m 0755 mavkit-node-basenet %{buildroot}/%{_bindir}/ install -m 0755 mavkit-node-boreasnet %{buildroot}/%{_bindir}/ ln -s %{_bindir}/mavkit-node-mainnet %{buildroot}/%{_bindir}/mavryk-node-mainnet ln -s %{_bindir}/mavkit-node-basenet %{buildroot}/%{_bindir}/mavryk-node-basenet ln -s %{_bindir}/mavkit-node-boreasnet %{buildroot}/%{_bindir}/mavryk-node-boreasnet mkdir -p %{buildroot}/%{_unitdir} install -m 644 mavryk-node-mainnet.service %{buildroot}/%{_unitdir} install -m 644 mavryk-node-basenet.service %{buildroot}/%{_unitdir} install -m 644 mavryk-node-boreasnet.service %{buildroot}/%{_unitdir} install -m 644 mavryk-node-custom.service %{buildroot}/%{_unitdir} install -m 644 mavryk-node-custom@.service %{buildroot}/%{_unitdir} mkdir -p %{buildroot}/%{_sysconfdir}/default install -m 644 mavryk-node-mainnet.default %{buildroot}/%{_sysconfdir}/default/mavryk-node-mainnet install -m 644 mavryk-node-basenet.default %{buildroot}/%{_sysconfdir}/default/mavryk-node-basenet install -m 644 mavryk-node-boreasnet.default %{buildroot}/%{_sysconfdir}/default/mavryk-node-boreasnet install -m 644 mavryk-node-custom.default %{buildroot}/%{_sysconfdir}/default/mavryk-node-custom install -m 644 mavryk-node-custom@.default %{buildroot}/%{_sysconfdir}/default/mavryk-node-custom@ install -m 0755 mavryk-node-custom-poststop %{buildroot}/%{_bindir} install -m 0755 mavryk-node-start %{buildroot}/%{_bindir} install -m 0755 mavryk-node-prestart %{buildroot}/%{_bindir} %files %license LICENSE %{_bindir}/mavkit-node-mainnet %{_bindir}/mavryk-node-mainnet %{_bindir}/mavkit-node-basenet %{_bindir}/mavryk-node-basenet %{_bindir}/mavkit-node-boreasnet %{_bindir}/mavryk-node-boreasnet %{_bindir}/mavkit-node %{_bindir}/mavryk-node %{_bindir}/mavryk-node-custom-poststop %{_bindir}/mavryk-node-start %{_bindir}/mavryk-node-prestart %{_unitdir}/mavryk-node-mainnet.service %{_unitdir}/mavryk-node-basenet.service %{_unitdir}/mavryk-node-boreasnet.service %{_unitdir}/mavryk-node-custom.service %{_unitdir}/mavryk-node-custom@.service %{_sysconfdir}/default/mavryk-node-mainnet %{_sysconfdir}/default/mavryk-node-basenet %{_sysconfdir}/default/mavryk-node-boreasnet %{_sysconfdir}/default/mavryk-node-custom %{_sysconfdir}/default/mavryk-node-custom@ %post %systemd_post mavryk-node-mainnet.service %systemd_post mavryk-node-basenet.service %systemd_post mavryk-node-boreasnet.service %systemd_post mavryk-node-custom.service %systemd_post mavryk-node-custom@.service if [ -z $(getent passwd mavryk) ]; then useradd -r -s /bin/false -m -d /var/lib/mavryk mavryk chmod 0755 /var/lib/mavryk fi mkdir -p /var/lib/mavryk/node-mainnet [ ! -f /var/lib/mavryk/node-mainnet/config.json ] && mavkit-node config init --data-dir /var/lib/mavryk/node-mainnet --network mainnet chown -R mavryk:mavryk /var/lib/mavryk/node-mainnet mkdir -p /var/lib/mavryk/node-basenet [ ! -f /var/lib/mavryk/node-basenet/config.json ] && mavkit-node config init --data-dir /var/lib/mavryk/node-basenet --network basenet chown -R mavryk:mavryk /var/lib/mavryk/node-basenet mkdir -p /var/lib/mavryk/node-boreasnet [ ! -f /var/lib/mavryk/node-boreasnet/config.json ] && mavkit-node config init --data-dir /var/lib/mavryk/node-boreasnet --network https://testnets.mavryk.network/basenet chown -R mavryk:mavryk /var/lib/mavryk/node-boreasnet mkdir -p /var/lib/mavryk/node-custom %preun %systemd_preun mavryk-node-mainnet.service %systemd_preun mavryk-node-basenet.service %systemd_preun mavryk-node-boreasnet.service %systemd_preun mavryk-node-custom.service %systemd_preun mavryk-node-custom@.service %postun %systemd_postun_with_restart mavryk-node-mainnet.service %systemd_postun_with_restart mavryk-node-basenet.service %systemd_postun_with_restart mavryk-node-boreasnet.service %systemd_postun_with_restart mavryk-node-custom.service %systemd_postun_with_restart mavryk-node-custom@.service