Align spec syntax with upstream spec file

This commit is contained in:
Xavier Delaruelle 2021-02-15 22:31:54 +01:00
parent 78632968ec
commit f9ed9e7315

View File

@ -10,12 +10,26 @@ License: GPLv2+
URL: http://modules.sourceforge.net/ URL: http://modules.sourceforge.net/
Source0: http://downloads.sourceforge.net/modules/modules-%{version}.tar.bz2 Source0: http://downloads.sourceforge.net/modules/modules-%{version}.tar.bz2
BuildRequires: gcc BuildRequires: dejagnu
BuildRequires: tcl-devel, tclx-devel, libX11-devel
BuildRequires: dejagnu, sed, procps, hostname, man, less
BuildRequires: make BuildRequires: make
Requires: tcl, sed, procps, man, less BuildRequires: sed
BuildRequires: less
BuildRequires: hostname
BuildRequires: procps
BuildRequires: man
# specific requirements to build compat version and extension library
BuildRequires: gcc
BuildRequires: tcl-devel
# specific requirements to build compat version
BuildRequires: libX11-devel
BuildRequires: tclx-devel
Requires: tcl
Requires: sed
Requires: less
Requires: vim-filesystem Requires: vim-filesystem
Requires: procps
Requires: man
Requires(post): coreutils
Requires(post): %{_sbindir}/update-alternatives Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives
Provides: environment(modules) Provides: environment(modules)
@ -76,6 +90,7 @@ This package provides Environment Modules compatibility version (3.2).
--with-initconf-in=etcdir \ --with-initconf-in=etcdir \
--with-modulepath=%{_datadir}/Modules/modulefiles:%{_sysconfdir}/modulefiles:%{_datadir}/modulefiles \ --with-modulepath=%{_datadir}/Modules/modulefiles:%{_sysconfdir}/modulefiles:%{_datadir}/modulefiles \
--with-quarantine-vars='LD_LIBRARY_PATH LD_PRELOAD' --with-quarantine-vars='LD_LIBRARY_PATH LD_PRELOAD'
%make_build %make_build
@ -87,7 +102,7 @@ mkdir -p %{buildroot}%{_datadir}/modulefiles
mkdir -p %{buildroot}%{_sysconfdir}/profile.d mkdir -p %{buildroot}%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_bindir}
# Set up for alternatives. # setup for alternatives
touch %{buildroot}%{_sysconfdir}/profile.d/modules.{csh,sh} touch %{buildroot}%{_sysconfdir}/profile.d/modules.{csh,sh}
touch %{buildroot}%{_bindir}/modulecmd touch %{buildroot}%{_bindir}/modulecmd
# remove modulecmd wrapper as it will be handled by alternatives # remove modulecmd wrapper as it will be handled by alternatives
@ -95,10 +110,10 @@ rm -f %{buildroot}%{_datadir}/Modules/bin/modulecmd
mv %{buildroot}%{_mandir}/man1/module{,-c}.1 mv %{buildroot}%{_mandir}/man1/module{,-c}.1
mv %{buildroot}%{_mandir}/man4/modulefile{,-c}.4 mv %{buildroot}%{_mandir}/man4/modulefile{,-c}.4
# Major utilities go to regular bin dir. # major utilities go to regular bin dir
mv %{buildroot}%{_datadir}/Modules/bin/envml %{buildroot}%{_bindir}/ mv %{buildroot}%{_datadir}/Modules/bin/envml %{buildroot}%{_bindir}/
# Rename compat docs to find them in files section. # rename compat docs to find them in files section
mv compat/ChangeLog ChangeLog-compat mv compat/ChangeLog ChangeLog-compat
mv compat/NEWS NEWS-compat mv compat/NEWS NEWS-compat
@ -111,11 +126,14 @@ rm -f %{buildroot}%{_docdir}/%{name}/{COPYING.GPLv2,ChangeLog-compat,INSTALL{,-w
cp -p script/createmodule.sh %{buildroot}%{_datadir}/Modules/bin cp -p script/createmodule.sh %{buildroot}%{_datadir}/Modules/bin
# install the rpm config file
install -Dpm 644 contrib/rpm/macros.%{name} %{buildroot}/%{macrosdir}/macros.%{name} install -Dpm 644 contrib/rpm/macros.%{name} %{buildroot}/%{macrosdir}/macros.%{name}
%check %check
make test make test
%post %post
# Cleanup from pre-alternatives # Cleanup from pre-alternatives
[ ! -L %{_mandir}/man1/module.1.gz ] && rm -f %{_mandir}/man1/module.1.gz [ ! -L %{_mandir}/man1/module.1.gz ] && rm -f %{_mandir}/man1/module.1.gz