Skip to content

Commit

Permalink
Provide symlinks to go and gofmt
Browse files Browse the repository at this point in the history
Since we don't use update-alternatives, make gcc-go always provide
the symlinks. Checks that such binaries don't yet exist. This makes
it possible to have gcc-go and go installed at the same time.
This assumes that Go packages them as regular files, not symlinks.
  • Loading branch information
direc85 committed Oct 18, 2024
1 parent 6aaade1 commit 491ca0b
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cross-aarch64-gcc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,26 @@ if posix.access ("/sbin/ldconfig", "x") then
end
end

%post go
pushd %{_bindir}
if [ ! -f go ] ; then
ln -s go.gcc go
fi
if [ ! -f gofmt ] ; then
ln -s gofmt.gcc gofmt
fi
popd

%preun go
pushd %{_bindir}
if [ -L go ]; then
rm go
fi
if [ -L gofmt ]; then
rm gofmt
fi
popd

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig
Expand Down
20 changes: 20 additions & 0 deletions cross-armv7hl-gcc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,26 @@ if posix.access ("/sbin/ldconfig", "x") then
end
end

%post go
pushd %{_bindir}
if [ ! -f go ] ; then
ln -s go.gcc go
fi
if [ ! -f gofmt ] ; then
ln -s gofmt.gcc gofmt
fi
popd

%preun go
pushd %{_bindir}
if [ -L go ]; then
rm go
fi
if [ -L gofmt ]; then
rm gofmt
fi
popd

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig
Expand Down
20 changes: 20 additions & 0 deletions cross-i486-gcc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,26 @@ if posix.access ("/sbin/ldconfig", "x") then
end
end

%post go
pushd %{_bindir}
if [ ! -f go ] ; then
ln -s go.gcc go
fi
if [ ! -f gofmt ] ; then
ln -s gofmt.gcc gofmt
fi
popd

%preun go
pushd %{_bindir}
if [ -L go ]; then
rm go
fi
if [ -L gofmt ]; then
rm gofmt
fi
popd

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig
Expand Down
20 changes: 20 additions & 0 deletions cross-x86_64-gcc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,26 @@ if posix.access ("/sbin/ldconfig", "x") then
end
end

%post go
pushd %{_bindir}
if [ ! -f go ] ; then
ln -s go.gcc go
fi
if [ ! -f gofmt ] ; then
ln -s gofmt.gcc gofmt
fi
popd

%preun go
pushd %{_bindir}
if [ -L go ]; then
rm go
fi
if [ -L gofmt ]; then
rm gofmt
fi
popd

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig
Expand Down
20 changes: 20 additions & 0 deletions gcc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,26 @@ if posix.access ("/sbin/ldconfig", "x") then
end
end

%post go
pushd %{_bindir}
if [ ! -f go ] ; then
ln -s go.gcc go
fi
if [ ! -f gofmt ] ; then
ln -s gofmt.gcc gofmt
fi
popd

%preun go
pushd %{_bindir}
if [ -L go ]; then
rm go
fi
if [ -L gofmt ]; then
rm gofmt
fi
popd

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig
Expand Down

0 comments on commit 491ca0b

Please sign in to comment.