mirror of
https://github.com/Syping/dtranslatebot.git
synced 2024-11-22 22:00:24 +01:00
fix el7 and el9 build errors in RPM SPEC file
This commit is contained in:
parent
382f029c3b
commit
9380dd14ea
1 changed files with 29 additions and 15 deletions
|
@ -1,5 +1,10 @@
|
||||||
%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
|
%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
|
||||||
%global dtb_cmake_args -DCMAKE_BUILD_TYPE=Release -DWITH_DPP_STATIC_BUNDLE=TRUE -DWITH_SYSTEMD=TRUE
|
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
||||||
|
%global cmake %{?cmake3}
|
||||||
|
%global cmake_build %{?cmake3_build}
|
||||||
|
%global cmake_install %{?cmake3_install}
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: dtranslatebot
|
Name: dtranslatebot
|
||||||
Version: 0.2.0
|
Version: 0.2.0
|
||||||
|
@ -7,21 +12,30 @@ Release: 1%{?dist}
|
||||||
Summary: Discord Translation Bot
|
Summary: Discord Translation Bot
|
||||||
License: BSD-2-Clause
|
License: BSD-2-Clause
|
||||||
URL: https://github.com/Syping/%{name}
|
URL: https://github.com/Syping/%{name}
|
||||||
Source0: %{name}_%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
Source1: %{name}.json
|
Source1: %{name}.json
|
||||||
Source2: %{name}.service
|
Source2: %{name}.service
|
||||||
Source3: %{name}.sysusersd
|
Source3: %{name}.sysusersd
|
||||||
|
|
||||||
BuildRequires: cmake >= 3.16
|
BuildRequires: make
|
||||||
BuildRequires: perl
|
BuildRequires: perl
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 9
|
BuildRequires: perl-IPC-Cmd
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
||||||
|
BuildRequires: cmake3 >= 3.16
|
||||||
|
BuildRequires: devtoolset-9-annobin
|
||||||
|
BuildRequires: devtoolset-9-gcc-c++
|
||||||
|
%else
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} == 8
|
||||||
|
BuildRequires: cmake >= 3.16
|
||||||
BuildRequires: gcc-toolset-9-annobin
|
BuildRequires: gcc-toolset-9-annobin
|
||||||
BuildRequires: gcc-toolset-9-gcc-c++
|
BuildRequires: gcc-toolset-9-gcc-c++
|
||||||
%else
|
%else
|
||||||
|
BuildRequires: cmake >= 3.16
|
||||||
BuildRequires: annobin
|
BuildRequires: annobin
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?rhel}
|
%endif
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} < 9
|
||||||
BuildRequires: epel-rpm-macros-systemd
|
BuildRequires: epel-rpm-macros-systemd
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
|
@ -35,22 +49,22 @@ dtranslatebot is a Discord Bot which translate incoming Discord messages to Disc
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 9
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
||||||
|
source /opt/rh/devtoolset-9/enable
|
||||||
|
%else
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} == 8
|
||||||
source /opt/rh/gcc-toolset-9/enable
|
source /opt/rh/gcc-toolset-9/enable
|
||||||
%endif
|
%endif
|
||||||
%cmake %{?dtb_cmake_args}
|
|
||||||
%if 0%{?cmake_build:1}
|
|
||||||
%cmake_build
|
|
||||||
%else
|
|
||||||
%make_build
|
|
||||||
%endif
|
%endif
|
||||||
|
%cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DPERL_EXECUTABLE=%{_bindir}/perl \
|
||||||
|
-DWITH_DPP_STATIC_BUNDLE=TRUE \
|
||||||
|
-DWITH_SYSTEMD=TRUE
|
||||||
|
%cmake_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if 0%{?cmake_install:1}
|
|
||||||
%cmake_install
|
%cmake_install
|
||||||
%else
|
|
||||||
%make_install
|
|
||||||
%endif
|
|
||||||
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
|
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
|
||||||
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.json
|
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.json
|
||||||
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
||||||
|
|
Loading…
Reference in a new issue