%define debug_package %{nil} Name: tezos-node Version: 20.3 Release: 1 Epoch: 1 Summary: Entry point for initializing, configuring and running a Tezos node License: MIT BuildArch: x86_64 aarch64 Source0: tezos-node-20.3.tar.gz Source1: https://gitlab.com/tezos/tezos/tree/v20.3/ 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, tezos-sapling-params, curl, jq %description Entry point for initializing, configuring and running a Tezos node Maintainer: Serokell %prep %setup -q %build %install make octez-node mkdir -p %{buildroot}/%{_bindir} install -m 0755 octez-node %{buildroot}/%{_bindir} ln -s %{_bindir}/octez-node %{buildroot}/%{_bindir}/tezos-node install -m 0755 octez-node-mainnet %{buildroot}/%{_bindir}/ install -m 0755 octez-node-ghostnet %{buildroot}/%{_bindir}/ install -m 0755 octez-node-pariscnet %{buildroot}/%{_bindir}/ ln -s %{_bindir}/octez-node-mainnet %{buildroot}/%{_bindir}/tezos-node-mainnet ln -s %{_bindir}/octez-node-ghostnet %{buildroot}/%{_bindir}/tezos-node-ghostnet ln -s %{_bindir}/octez-node-pariscnet %{buildroot}/%{_bindir}/tezos-node-pariscnet mkdir -p %{buildroot}/%{_unitdir} install -m 644 tezos-node-mainnet.service %{buildroot}/%{_unitdir} install -m 644 tezos-node-ghostnet.service %{buildroot}/%{_unitdir} install -m 644 tezos-node-pariscnet.service %{buildroot}/%{_unitdir} install -m 644 tezos-node-custom.service %{buildroot}/%{_unitdir} install -m 644 tezos-node-custom@.service %{buildroot}/%{_unitdir} mkdir -p %{buildroot}/%{_sysconfdir}/default install -m 644 tezos-node-mainnet.default %{buildroot}/%{_sysconfdir}/default/tezos-node-mainnet install -m 644 tezos-node-ghostnet.default %{buildroot}/%{_sysconfdir}/default/tezos-node-ghostnet install -m 644 tezos-node-pariscnet.default %{buildroot}/%{_sysconfdir}/default/tezos-node-pariscnet install -m 644 tezos-node-custom.default %{buildroot}/%{_sysconfdir}/default/tezos-node-custom install -m 644 tezos-node-custom@.default %{buildroot}/%{_sysconfdir}/default/tezos-node-custom@ install -m 0755 tezos-node-custom-poststop %{buildroot}/%{_bindir} install -m 0755 tezos-node-prestart %{buildroot}/%{_bindir} install -m 0755 tezos-node-start %{buildroot}/%{_bindir} %files %license LICENSE %{_bindir}/octez-node-mainnet %{_bindir}/tezos-node-mainnet %{_bindir}/octez-node-ghostnet %{_bindir}/tezos-node-ghostnet %{_bindir}/octez-node-pariscnet %{_bindir}/tezos-node-pariscnet %{_bindir}/octez-node %{_bindir}/tezos-node %{_bindir}/tezos-node-custom-poststop %{_bindir}/tezos-node-prestart %{_bindir}/tezos-node-start %{_unitdir}/tezos-node-mainnet.service %{_unitdir}/tezos-node-ghostnet.service %{_unitdir}/tezos-node-pariscnet.service %{_unitdir}/tezos-node-custom.service %{_unitdir}/tezos-node-custom@.service %{_sysconfdir}/default/tezos-node-mainnet %{_sysconfdir}/default/tezos-node-ghostnet %{_sysconfdir}/default/tezos-node-pariscnet %{_sysconfdir}/default/tezos-node-custom %{_sysconfdir}/default/tezos-node-custom@ %post %systemd_post tezos-node-mainnet.service %systemd_post tezos-node-ghostnet.service %systemd_post tezos-node-pariscnet.service %systemd_post tezos-node-custom.service %systemd_post tezos-node-custom@.service if [ -z $(getent passwd tezos) ]; then useradd -r -s /bin/false -m -d /var/lib/tezos tezos chmod 0755 /var/lib/tezos fi curl -sSL https://teztnets.com/teztnets.json -o /var/lib/tezos/teztnets.json config="$(cat /var/lib/tezos/teztnets.json | jq .mainnet)" if [ "$config" != "null" ]; then mkdir -p /var/lib/tezos/node-mainnet [ ! -f /var/lib/tezos/node-mainnet/config.json ] && octez-node config init --data-dir /var/lib/tezos/node-mainnet --network mainnet chown -R tezos:tezos /var/lib/tezos/node-mainnet else echo "Network mainnet not found in teztnets.json" echo "Skipping node setup for mainnet..." fi config="$(cat /var/lib/tezos/teztnets.json | jq .ghostnet)" if [ "$config" != "null" ]; then mkdir -p /var/lib/tezos/node-ghostnet [ ! -f /var/lib/tezos/node-ghostnet/config.json ] && octez-node config init --data-dir /var/lib/tezos/node-ghostnet --network ghostnet chown -R tezos:tezos /var/lib/tezos/node-ghostnet else echo "Network ghostnet not found in teztnets.json" echo "Skipping node setup for ghostnet..." fi config="$(cat /var/lib/tezos/teztnets.json | jq .pariscnet)" if [ "$config" != "null" ]; then mkdir -p /var/lib/tezos/node-pariscnet [ ! -f /var/lib/tezos/node-pariscnet/config.json ] && octez-node config init --data-dir /var/lib/tezos/node-pariscnet --network https://teztnets.com/pariscnet chown -R tezos:tezos /var/lib/tezos/node-pariscnet else echo "Network pariscnet not found in teztnets.json" echo "Skipping node setup for pariscnet..." fi mkdir -p /var/lib/tezos/node-custom %preun %systemd_preun tezos-node-mainnet.service %systemd_preun tezos-node-ghostnet.service %systemd_preun tezos-node-pariscnet.service %systemd_preun tezos-node-custom.service %systemd_preun tezos-node-custom@.service %postun %systemd_postun_with_restart tezos-node-mainnet.service %systemd_postun_with_restart tezos-node-ghostnet.service %systemd_postun_with_restart tezos-node-pariscnet.service %systemd_postun_with_restart tezos-node-custom.service %systemd_postun_with_restart tezos-node-custom@.service