From b79b1818c8748a7adcbd54a84a885fd622f6dc92 Mon Sep 17 00:00:00 2001 From: Christof Schulze Date: Sun, 10 May 2020 21:51:56 +0200 Subject: [PATCH] fixed 0%{?rhel} so spec-file check can be done for all packages also on Fedora, fixed some warings from rpmling, added CI tests --- .gitlab-ci.yml | 15 +++++++++++++++ ww8-el-release.spec | 26 ++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9950d81 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +image: centos:8 + + +before_script: + - dnf -y install rpmlint rpm-build + + +stages: + - Static Analysis + +rpmlint: + stage: Static Analysis + script: + - rpmlint --version + - rpmlint -i *.spec diff --git a/ww8-el-release.spec b/ww8-el-release.spec index 8b2dc22..63d34ea 100644 --- a/ww8-el-release.spec +++ b/ww8-el-release.spec @@ -8,18 +8,24 @@ # Name: ww8-release +%if 0%{?rhel} %if %{rhel} == 8 -Version: 8.0 +Version: 8.1 Release: 3%{?dist} %endif -%if %{rhel} == 7 -Version: 7.6 +%if 0%{rhel} == 7 +Version: 7.7 Release: 4%{?dist} %endif -%if %{rhel} == 6 +%if 0%{rhel} == 6 Version: 6.9 Release: 4%{?dist} %endif +%endif +%if 0%{?fedora} +Version: %{fedora} +Release: 1%{?dist} +%endif Summary: Configuration for ww8 repository @@ -33,12 +39,17 @@ Source0: ww8-el.repo BuildRoot: %{_tmppath}/%{name}-%{version} BuildArchitectures: noarch +%if 0%{?rhel} Requires: yum # Sadly system-release and redhat-release are not versionned Requires: redhat-release Requires: epel-release = %{rhel} # Ensure not installable on Fedora Conflicts: fedora-release +%endif +%if 0%{?fedora} +Requires: dnf +%endif %description This package contains dnf configuration for the "ww8" RPM Repository, @@ -56,9 +67,8 @@ echo empty build %install rm -rf $RPM_BUILD_ROOT %{__install} -Dp -m0644 %{SOURCE0} %{buildroot}%{_sysconfdir}/yum.repos.d/ww8-el.repo -#%{__install} -Dp -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-ww8 -# will be removed on update ww8-el7.repo -rm -f %{_sysconfdir}/yum.repos.d/rpm-ww8.repo +#%%{__install} -Dp -m0644 %%{SOURCE1} %%{buildroot}%%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-ww8 + %clean rm -rf $RPM_BUILD_ROOT @@ -66,7 +76,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %config %{_sysconfdir}/yum.repos.d/ww8-el.repo -#%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-ww8 +#%%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-ww8 %changelog * Fri Dec 13 2019 Christof Schulze - 8.0-3 -- GitLab