%undefine _disable_source_fetch Name: stellar-core-unstable Version: master Release: %(date +"%Y%m%d")%{?dist} Summary: Stellar-core is the backbone of the Stellar network. It maintains a local copy of the ledger, communicating and staying in sync with other instances of stellar-core on the network. License: ASL 2.0 URL: https://github.com/philipmather/stellar-core/ Source0: https://github.com/philipmather/stellar-core/archive/%{version}.tar.gz Autoreq: 0 BuildRequires: systemd git make glibc-headers libtool bison flex autoconf automake parallel pandoc %{_bindir}/pkg-config clang gcc %{_bindir}/ps %{?fedora:BuildRequires: postgresql-server postgresql-libs postgresql-devel} %{?rhel:BuildRequires: rh-postgresql10 rh-postgresql10-postgresql-libs rh-postgresql10-postgresql-devel} %{?fedora:Requires: postgresql-server postgresql-libs} %{?rhel:Requires: rh-postgresql10 rh-postgresql10-postgresql-libs} %description Stellar-core is a replicated state machine that maintains a local copy of a cryptographic ledger and processes transactions against it, in consensus with a set of peers. It implements the Stellar Consensus Protocol, a federated consensus protocol. It is written in C++14 and runs on Linux, OSX and Windows. Learn more by reading the overview document. %prep %autosetup -n %{name}-%{version} -S git rmdir lib/asio && git submodule add https://github.com/chriskohlhoff/asio.git lib/asio rmdir lib/cereal && git submodule add https://github.com/USCiLab/cereal lib/cereal rmdir lib/libmedida && git submodule add https://github.com/stellar/medida.git lib/libmedida rmdir lib/libsodium && git submodule add https://github.com/stellar/libsodium.git lib/libsodium rmdir lib/xdrpp && git submodule add https://github.com/xdrpp/xdrpp.git lib/xdrpp %build %if 0%{?el7} source /opt/rh/devtoolset-7/enable source /opt/rh/llvm-toolset-7/enable source /opt/rh/rh-postgresql10/enable export CC=clang-5.0 export CXX=clang++ %define __global_cxxflags -std=c++14 %endif ./autogen.sh # As per https://bugzilla.redhat.com/show_bug.cgi?id=1099282 I need to filter flags before configure other CLANG borks on stack-protector-strong and stack-clash-protection # ENHANCE: when clang => 3.8 it understands -fstack-protector-strong, global define clang version then conditional #CXXFLAGS="$( # rpm --eval '%{__global_cxxflags}' | # sed 's/-fstack-protector-strong//;s/-fstack-clash-protection//' # )" \ CXXFLAGS=" -std=c++14" \ CFLAGS="$( rpm --eval '%{__global_cflags}' | sed 's/-fstack-protector-strong//;s/-fstack-clash-protection//' )" \ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=%{_libdir} --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info %make_build %check # Skip make check as we're unstable %install rm -rf $RPM_BUILD_ROOT %make_install %{__mkdir} -p %{buildroot}%{_unitdir} %{__install} -m644 Builds/copr/stellar-core.service %{buildroot}%{_unitdir}/stellar-core.service %post [ ! -d /var/log/stellar/core ] %make_install%make_install mkdir -p /var/log/stellar/core || true %systemd_post stellar-core.service %preun %systemd_preun stellar-core.service %postun %systemd_postun_with_restart stellar-core.service %files %license LICENSE-APACHE.txt %doc docs/stellar-core.1 %doc /usr/share/doc/stellar-core/admin.md %doc /usr/share/doc/stellar-core/commands.md %doc /usr/share/doc/stellar-core/stellar-core_example.cfg %doc /usr/share/doc/stellar-core/stellar-core_standalone.cfg %doc /usr/share/doc/stellar-core/stellar-core_testnet.cfg %{_mandir}/man1/stellar-core.1.gz %{_unitdir}/stellar-core.service %{_bindir}/stellar-core %changelog * Sun Aug 18 2019 Cloud User -