# -*- coding: ascii; tab-width: 4; x-counterpart: extutils-makemaker-pm.patch -*-
Info2: <<
Package: extutils-makemaker-pm%type_pkg[perl]
Version: 7.62
Revision: 2

Type: perl (5.16.2 5.18.2 5.18.4 5.28.2 5.30.2 5.30.3)
Distribution: <<
	(%type_pkg[perl] = 5162) 10.9,
	(%type_pkg[perl] = 5162) 10.10,
	(%type_pkg[perl] = 5162) 10.11,
	(%type_pkg[perl] = 5162) 10.12,
	(%type_pkg[perl] = 5162) 10.13
<<
Description: Perl module to create a module Makefile
License: Artistic
Maintainer: Daniel Johnson <daniel@daniel-johnson.org>
DescPackaging: <<
	Previously maintained by
	Christian Schaffner <chris01@users.sourceforge.net>
	
	Eliminated -bin splitoff and used update-alternatives to
	allow binaries to coexist.
<<
DescPort: <<
	Patch makefile generator to remove -L/usr/local/lib from early
	in LDDLFLAGS (don't have non-fink mask fink)
	
	It appears that Cwd::cwd can't get the cwd from within fink's build
	environment but Cwd::getcwd can. Patch MakeMaker.pm to use getcwd.
	
	On 10.15, Apple hardened system-perl to disallow loading from relative
	paths. So patch INST_ARCHLIB to be an absolute path. The relative path
	test "CHILD INST_ARCHLIB" is patched to use full paths.
<<

# Dependencies:
Depends: <<
	cpan-meta-pm%type_pkg[perl] (>= 2.150010-1),
	cpan-meta-requirements-pm (>= 2.121-1),
	cpan-meta-yaml-pm (>= 0.008-1),
	extutils-install-pm (>= 1.54-1),
	extutils-manifest-pm (>= 1.65-1),
	json-pp-pm (>= 2.27.200-1),
	perl%type_pkg[perl]-core,
	scalar-list-utils-pm%type_pkg[perl]
<<
BuildDepends: fink (>= 0.30.0)

Replaces: %{Ni}586-bin, %{Ni}588-bin
Provides: %N-bin

# Unpack Phase:
#Source: mirror:cpan:modules/by-module/ExtUtils/ExtUtils-MakeMaker-%v.tar.gz
Source: mirror:cpan:authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-%v.tar.gz
Source-Checksum: SHA256(5022ad857fd76bd3f6b16af099fe2324639d9932e08f21e891fb313d9cae1705)

PatchFile: %{ni}.patch
PatchFile-MD5: 4f00b40fb3b44fa11c0fb36bb509720c
PatchFile2: %{ni}-sdk.patch
PatchFile2-MD5: b528e11f18f145224a423088f730b7a4 
PatchScript: <<
	#!/bin/bash -ev
	/usr/bin/sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1
	darwin_vers=`uname -r | cut -d. -f1`
	darwin_vers_minor=`uname -r | cut -d. -f2`
	# only apply SDK fix for 10.14/10.15/11.0 (which hide system-headers) and their systemperl
	if [[ "$darwin_vers" -eq 18 && "$darwin_vers_minor" -le 5 && %type_num[perl] -eq 5182 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 18 && "$darwin_vers_minor" -ge 6 && %type_num[perl] -eq 5184 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 19 && %type_num[perl] -eq 5184 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 20 && "$darwin_vers_minor" -le 3 && %type_num[perl] -eq 5282 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 20 && "$darwin_vers_minor" -ge 4 && %type_num[perl] -eq 5302 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 21 && %type_num[perl] -eq 5303 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 22 && %type_num[perl] -eq 5303 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 23 && %type_num[perl] -eq 5303 ]]; then
	  patch -p1 < %{PatchFile2}
	fi
	if [[ "$darwin_vers" -eq 24 && %type_num[perl] -eq 5341 ]]; then
	  patch -p1 < %{PatchFile2}
	fi

	/usr/bin/sed -i '' "s/'\.\$perlflags\.'//" lib/ExtUtils/MM_Unix.pm
<<

CompileScript: <<
	#!/bin/bash -ev
	export BUILDING_AS_PACKAGE=1
	%{default_script}
<<

# Install Phase:
UpdatePOD: True
DocFiles: Changes README
InstallScript: <<
	%{default_script}
	mv %i/share/man %i/lib/perl5/%type_raw[perl]
	/bin/mv %i/bin/instmodsh %i/bin/instmodsh-pm%type_pkg[perl]
<<
InfoTest: <<
	TestScript: <<
		#!/bin/bash -ev
		export ARCHFLAGS=""
		%{default_script}
	<<
<<

PostInstScript: update-alternatives --install %p/bin/instmodsh instmodsh %p/bin/instmodsh-pm%type_pkg[perl] %type_pkg[perl]

PreRmScript: update-alternatives --remove instmodsh %p/bin/instmodsh-pm%type_pkg[perl]

# Additional Info:
Homepage: https://metacpan.org/dist/ExtUtils-MakeMaker/
<<