%define debug_package %{nil} Name: tezos-node Version: 21.0 Release: 1 Epoch: 1 Summary: Entry point for initializing, configuring and running a Tezos node License: MIT BuildArch: x86_64 aarch64 Source0: tezos-node-21.0.tar.gz Source1: https://gitlab.com/tezos/tezos/tree/v21.0/ BuildRequires: make wget systemd systemd-rpm-macros Requires: , 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-quebecnet %{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-quebecnet %{buildroot}/%{_bindir}/tezos-node-quebecnet 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-quebecnet.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-quebecnet.default %{buildroot}/%{_sysconfdir}/default/tezos-node-quebecnet 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-start %{buildroot}/%{_bindir} install -m 0755 tezos-node-prestart %{buildroot}/%{_bindir} %files %license LICENSE %{_bindir}/octez-node-mainnet %{_bindir}/tezos-node-mainnet %{_bindir}/octez-node-ghostnet %{_bindir}/tezos-node-ghostnet %{_bindir}/octez-node-quebecnet %{_bindir}/tezos-node-quebecnet %{_bindir}/octez-node-pariscnet %{_bindir}/tezos-node-pariscnet %{_bindir}/octez-node %{_bindir}/tezos-node %{_bindir}/tezos-node-custom-poststop %{_bindir}/tezos-node-start %{_bindir}/tezos-node-prestart %{_unitdir}/tezos-node-mainnet.service %{_unitdir}/tezos-node-ghostnet.service %{_unitdir}/tezos-node-quebecnet.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-quebecnet %{_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-quebecnet.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 .quebecnet)" if [ "$config" != "null" ]; then mkdir -p /var/lib/tezos/node-quebecnet [ ! -f /var/lib/tezos/node-quebecnet/config.json ] && octez-node config init --data-dir /var/lib/tezos/node-quebecnet --network https://teztnets.com/quebecnet chown -R tezos:tezos /var/lib/tezos/node-quebecnet else echo "Network quebecnet not found in teztnets.json" echo "Skipping node setup for quebecnet..." 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-quebecnet.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-quebecnet.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