File sisiya-client.spec of Package sisiya-client

#    Copyright (C) Erdal Mutlu
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Name: sisiya-client
Summary: SisIYA client
Url: https://sisiya.de
%define install_dir /usr/share/%{name}
BuildArch: noarch
BuildRoot: %{_builddir}/%{name}-root
Version: 1.0.54
Release: 0
Source0: http://sourceforge.net/projects/sisiya/files/sisiya/%{version}/rpm/%{name}-%{version}.tar.gz
License: GPL-3.0+
Vendor: Erdal Mutlu
Group: System Environment/Daemons
#Packager: Erdal Mutlu <erdalmutlu@yahoo.com>
Requires: python3
%if 0%{?suse_version} > 1500
Requires: cron
%endif
AutoReqProv: no

####################################
# Always check if defined first!!!
####################################

# RedHat / CentOS / Scientific / Fedora systems
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?centos_ver} || 0%{?scientific_version} || 0%{?fedora}
%if 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700 || 0%{?centos_ver} >= 7 || 0%{?scientific_version} >= 700 || 0%{?fedora} >= 14
%define has_systemd 1
%endif
%endif

# openSUSE systems
%if 0%{?is_opensuse} && 0%{?suse_version} >= 1140
%define has_systemd 1
%endif

# SLE systems
%if !0%{?is_opensuse} && 0%{?sle_version} >= 120000
%define has_systemd 1
%endif

# SLE backports systems
%if 0%{?is_backports} && 0%{?sle_version} >= 120000
%define has_systemd 1
%endif

%if 0%{?has_systemd}
BuildRequires: systemd
Requires: systemd
%endif

%description 
The SisIYA client. This package is installed on every server that is going to be monitored by SisIYA.

%prep 
%setup -n %{name}-%{version}

%build

%install
make DESTDIR=%{buildroot} INSTALL_DIR=%{install_dir} DOC_DIR=%{_docdir} MAN_DIR=%{_mandir} SYSCONF_DIR=%{_sysconfdir} install 
%if 0%{?has_systemd}
make DESTDIR=%{buildroot} INSTALL_DIR=%{install_dir} DOC_DIR=%{_docdir} MAN_DIR=%{_mandir} SYSCONF_DIR=%{_sysconfdir} install_systemd_files 
%else
make DESTDIR=%{buildroot} INSTALL_DIR=%{install_dir} DOC_DIR=%{_docdir} MAN_DIR=%{_mandir} SYSCONF_DIR=%{_sysconfdir} install_crond_files 
%endif

# %if 0%{?has_systemd}
# mkdir -p %{buildroot}/usr/lib/systemd/system
# cp etc/systemd/* %{buildroot}/usr/lib/systemd/system/
# %else
# mkdir -p %{buildroot}/etc/cron.d
# cp etc/cron.d/* %{buildroot}/etc/cron.d/
# %endif

%files
%defattr(-,root,root)
%if 0%{?has_systemd}
/usr/lib/systemd/system/*
%else
# for openSUSE factory
%if 0%{?suse_version} > 1500
%dir %{_sysconfdir}/cron.d
%endif
%{_sysconfdir}/cron.d/*
%endif
%dir %{_sysconfdir}/sisiya-client
%config(noreplace) %{_sysconfdir}/sisiya-client/config.json
%dir %{install_dir}
%dir %{install_dir}/scripts
%dir %{install_dir}/scripts/local_checks
%dir %{install_dir}/scripts/remote_checks
%dir %{install_dir}/utils
%{install_dir}/scripts/local_checks/*
%{install_dir}/scripts/remote_checks/*
%{install_dir}/utils/*
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/*

%changelog
* Fri Nov 14 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.54
- Merge branch 'add_timeout_to_client' into 'develop'

* Fri Nov 14 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.53-1-g71b86e3
- Client scripts hangs

* Sun Oct 19 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.53
- Merge branch 'seperate_swap_and_ram_check' into 'develop'

* Sun Oct 19 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.52-1-g714658c
- Seperate client check for swap and ram

* Sun Sep 07 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.52
- Merge branch 'add_ldap_systemd_timer' into 'develop'

* Sun Sep 07 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.51-1-gcf2009a
- Add cron entry and systemd timer files for ldap check

* Sun Sep 07 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.51
- Merge branch 'add_remote_ldap_check' into 'develop'

* Sun Sep 07 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.50-1-g6917cad
- Add remote ldap check

* Mon Sep 01 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.50
- Merge branch 'extend_idrac' into 'develop'

* Mon Sep 01 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.49-1-g607287a
- Add amperage check for idrac

* Sun Aug 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.49
- Merge branch 'fix_idrac' into 'develop'

* Sun Aug 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.48-1-g8d96cd3
- fixed idrac check

* Sun Aug 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.48
- Merge branch 'add_snmp_idrac' into 'develop'

* Sun Aug 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.47-1-gc98ebc3
- Add snmp idrac

* Thu Jul 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.47
- Merge branch 'add_snmp_ups_check' into 'develop'

* Thu Jul 31 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.46-1-g727b580
- Add snmp ups check

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.46
- Merge branch 'adjust_rpm_deployment_via_osc' into 'develop'

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.45-1-gaf3a7be
- Fix rpm deployment from more the one gitlab runner

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.45
- Merge branch 'add_http_check' into 'develop'

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.44-1-gb57b8bf
- Add http check

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.44
- Merge branch 'add_switch_check' into 'develop'

* Tue Jul 29 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.43-1-gf10d216
- Add a system check for a snmp enabled device

* Thu Jul 24 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.43
- Merge branch 'add_ping_check' into 'develop'

* Thu Jul 24 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.42-1-ga816d0a
- Add ping check

* Wed Jul 23 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.42
- Merge branch 'testing_on_macos' into 'develop'

* Wed Jul 23 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.41-1-g0fe55cf
- Testing on macos

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.41
- Merge branch 'fix_updates' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.40-1-gd50767d
- Update check reports wrong number of packages to update

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.40
- Merge branch 'fix_ssl_check' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.39-1-g95c5055
- Fix ssl check when there is an issue connecting

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.39
- Merge branch 'add_multiple_entries_for_ssl_per_server' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.38-1-g9f2825d
- Change config structure for ssl to include multiple ssl certificates per system

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.38
- Merge branch 'add_ssl_remote_check' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.37-1-g0ab5c66
- Add remote check for ssl certificates expire dates

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.37
- Merge branch 'fix_dns_check' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.36-1-g3dd92cc
- Fix dns check

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.36
- Merge branch 'fix_remote_checks' into 'develop'

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 
- Fix rpm package build

* Tue Jul 22 2025 Erdal MUTLU <erdalmutlu@yahoo.com> - 1.0.35
- Merge branch 'add_remote_check_for_dns' into 'develop'
openSUSE Build Service is sponsored by