Skip to content

Commit ce78d5d

Browse files
committed
install: adapt RPM spec to install fish config snippet
1 parent 899881b commit ce78d5d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

NEWS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Modules 5.X.Y (not yet released)
1515
* Install: distribute ``ChangeLog`` as a zipped file to reduce installation
1616
size. As a consequence, :command:`gzip` becomes a requirement when building
1717
Modules from git repository.
18+
* Install: adapt RPM spec file to install module initialization script for
19+
fish as configuration snippet for this shell.
1820

1921

2022
.. _5.3 release notes:

contrib/rpm/environment-modules.spec.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,20 @@ make install DESTDIR=%{buildroot}
119119
mkdir -p %{buildroot}%{_sysconfdir}/modulefiles
120120
mkdir -p %{buildroot}%{_datadir}/modulefiles
121121
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
122+
mkdir -p %{buildroot}%{_datadir}/fish/vendor_conf.d
122123
mkdir -p %{buildroot}%{_bindir}
123124
%if 0%{?fedora}
124125
# setup for alternatives
125126
touch %{buildroot}%{_sysconfdir}/profile.d/modules.{csh,sh}
127+
touch %{buildroot}%{_datadir}/fish/vendor_conf.d/modules.fish
126128
touch %{buildroot}%{_bindir}/modulecmd
127129
# remove modulecmd wrapper as it will be handled by alternatives
128130
rm -f %{buildroot}%{_datadir}/Modules/bin/modulecmd
129131
%else
130132
# install profile links
131133
ln -s %{_datadir}/Modules/init/profile.csh %{buildroot}%{_sysconfdir}/profile.d/modules.csh
132134
ln -s %{_datadir}/Modules/init/profile.sh %{buildroot}%{_sysconfdir}/profile.d/modules.sh
135+
ln -s %{_datadir}/Modules/init/fish %{buildroot}%{_datadir}/fish/vendor_conf.d/modules.fish
133136
# install modulecmd wrapper script
134137
mv %{buildroot}%{_datadir}/Modules/bin/modulecmd %{buildroot}%{_bindir}/
135138
%endif
@@ -156,6 +159,7 @@ make test QUICKTEST=1
156159
# Cleanup from pre-alternatives
157160
[ ! -L %{_sysconfdir}/profile.d/modules.sh ] && rm -f %{_sysconfdir}/profile.d/modules.sh
158161
[ ! -L %{_sysconfdir}/profile.d/modules.csh ] && rm -f %{_sysconfdir}/profile.d/modules.csh
162+
[ ! -L %{_datadir}/fish/vendor_conf.d/modules.fish ] && rm -f %{_datadir}/fish/vendor_conf.d/modules.fish
159163
[ ! -L %{_bindir}/modulecmd ] && rm -f %{_bindir}/modulecmd
160164

161165
# Migration from version 3.x to 4
@@ -166,6 +170,7 @@ fi
166170
%{_sbindir}/update-alternatives \
167171
--install %{_sysconfdir}/profile.d/modules.sh modules.sh %{_datadir}/Modules/init/profile.sh 40 \
168172
--slave %{_sysconfdir}/profile.d/modules.csh modules.csh %{_datadir}/Modules/init/profile.csh \
173+
--slave %{_datadir}/fish/vendor_conf.d/modules.fish modules.fish %{_datadir}/Modules/init/fish \
169174
--slave %{_bindir}/modulecmd modulecmd %{_datadir}/Modules/libexec/modulecmd.tcl
170175

171176
%postun
@@ -183,13 +188,16 @@ fi
183188
%endif
184189
%doc ChangeLog.gz README NEWS.txt MIGRATING.txt INSTALL.txt CONTRIBUTING.txt changes.txt
185190
%{_sysconfdir}/modulefiles
191+
%dir %{_datadir}/fish/vendor_conf.d
186192
%if 0%{?fedora}
187193
%ghost %{_sysconfdir}/profile.d/modules.csh
188194
%ghost %{_sysconfdir}/profile.d/modules.sh
195+
%ghost %{_datadir}/fish/vendor_conf.d/modules.fish
189196
%ghost %{_bindir}/modulecmd
190197
%else
191198
%{_sysconfdir}/profile.d/modules.csh
192199
%{_sysconfdir}/profile.d/modules.sh
200+
%{_datadir}/fish/vendor_conf.d/modules.fish
193201
%{_bindir}/modulecmd
194202
%endif
195203
%{_bindir}/envml
@@ -227,6 +235,10 @@ fi
227235

228236

229237
%changelog
238+
* Sat May 27 2023 Xavier Delaruelle <[email protected]> - 5.3.0-2
239+
- Install module initialization script for fish as configuration snippet for
240+
this shell via alternatives
241+
230242
* Sun May 14 2023 Xavier Delaruelle <[email protected]> - 5.3.0-1
231243
- Update to 5.3.0
232244
- Migrate to SPDX license format

0 commit comments

Comments
 (0)