# Upstream is a git repository with no release tarballs and no CPAN presence. # Its last commit is 2011-03-21; the newest tag (mni_perllib_v1_00) predates it, # and MNI.pm has carried $MNI::VERSION = '0.08' throughout. Package the tip of # master, the same way bicpl and minc-tools are packaged here. %global commit 075ae53e2427b57d5511bacba2d93b56b8212e02 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20110321 Name: perl-MNI Version: 0.08 Release: 1.%{date}git%{shortcommit}%{?dist} Summary: MNI Perl library for driving neuroimaging pipelines # README and every module header: "This is free software, and may be # distributed under the same terms as Perl itself." License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://github.com/aces/mni-perllib Source0: %{url}/archive/%{commit}/mni-perllib-%{shortcommit}.tar.gz BuildArch: noarch BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Carp) BuildRequires: perl(Cwd) BuildRequires: perl(Exporter) BuildRequires: perl(File::Basename) BuildRequires: perl(Getopt::Tabular) BuildRequires: perl(POSIX) BuildRequires: perl(Test::More) # script(1), to give the test suite a pseudo-terminal -- see %%check. BuildRequires: util-linux-script BuildRequires: perl(Sys::Hostname) # t/mincutil.t drives mincinfo; MNI::MincUtilities needs it at runtime too. BuildRequires: minc-tools BuildRequires: perl(strict) BuildRequires: perl(vars) BuildRequires: perl(warnings) # MNI::MincUtilities and MNI::Tag shell out to the MINC command line tools. Requires: minc-tools %description The MNI Perl Library is a collection of modules written at the McConnell Brain Imaging Centre for programs that mainly run other programs: option handling and self-announcing startup (MNI::Startup), subprocess control with logging and error handling (MNI::Spawn), file and path utilities, MINC volume queries (MNI::MincUtilities) and tag file reading and writing (MNI::Tag, MNI::TagSet). It underpins the Perl drivers of the MNI neuroimaging tools, including N3/nu_correct, mni_autoreg and the CIVET pipeline. %prep %autosetup -n mni-perllib-%{commit} # Makefile.PL asks for the model data directory on stdin and loops until it # gets an answer, which would hang the build. Bake in the FHS location instead # and drop the prompt; MNI::DataDir still honours $MNI_DATAPATH at runtime, and # the directory is only a search default, so nothing here has to own it. sed -i \ -e "s|'/usr/local/bic/share/mni-models'|'%{_datadir}/mni-models'|" \ -e '/^query_subs;$/d' \ Makefile.PL grep -q "%{_datadir}/mni-models" Makefile.PL ! grep -q '^query_subs;$' Makefile.PL %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %make_build %install %make_install # MakeMaker drops the manual's POD source into the module directory. It is # already shipped as %%doc and as man3/mni_perllib.3pm, so drop the third copy # rather than install documentation under %%{perl_vendorlib}. rm %{buildroot}%{perl_vendorlib}/mni_perllib.pod # MakeMaker copies the whole module directory, CVS leftovers included. rm %{buildroot}%{perl_vendorlib}/MNI/.cvsignore %{_fixperms} %{buildroot}/* %check # t/startup.t and t/spawn.t fork a child, redirect it through FIFOs and read to # EOF. If the child dies before it writes (a missing module is enough), the # parent blocks on the FIFO forever -- observed here as an indefinite hang, not # a failure, which would sit on a COPR builder until the build timeout. Bound # it: a hang then fails the build in ten minutes instead of hours. # t/startup.t's self_announce test redirects stdout to /dev/tty, which a build # root does not have, so the forked child dies and the test fails (1 of 26). # Running the suite under script(1) gives it a pseudo-terminal and all 26 pass, # which is better than deselecting the file and losing the other 25. timeout 600 script -qec "make test" /dev/null %files %license README %doc ChangeLog NEWS mni_perllib.pod %{perl_vendorlib}/MNI.pm %{perl_vendorlib}/MNI/ # AutoSplit output for MNI::FileUtilities, generated at build time. %{perl_vendorlib}/auto/MNI/ %{_mandir}/man3/*.3* %changelog * Tue Sep 22 2026 Morgan Hough - 0.08-1.20110321git075ae53 - Initial package, from the tip of upstream master. First of the CIVET/MNI tier 1 components (docs/civet-licensing.md); N3 and the CIVET drivers need it.