File perl-macros.spec of Package perl-macros

# spec file for package perl-macros
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           perl-macros
Summary:        Perl macros for rpm build
License:        GPL-2.0+
Group:          Development/Libraries/Perl
Version:        1.0
Release:        0
Source0:        macros.perl
Source1:        README
Patch0:         %{name}_rhel.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       perl_gen_filelist
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version} || 0%{?scientificlinux_version}
Requires:       perl(ExtUtils::MakeMaker)
Requires:       perl(Test::More)
%if 0%{?fedora}
Requires:       perl-devel
Requires:       perl

This package provides perl rpm macros.
You need it for building perl modules

                Christian Wittmer <>

%{__cp} %{S:0} .
%{__cp} %{S:1} .
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
%patch0 -p0


%if 0%{?suse_version}
%if %suse_version < 1140
# most evil hack ever - rpm does not sort the macros, so we need to rename the old one
cp %{_sysconfdir}/rpm/macros.suse-perl %{_sysconfdir}/rpm/macros.perl

# make sure it overwrites macros.perl if sorted alphabetically
%{__install} -D -m644 macros.perl ${RPM_BUILD_ROOT}%{_sysconfdir}/rpm/macros.suse-perl

%{__rm} -rf $RPM_BUILD_ROOT