diff options
Diffstat (limited to 'swift-lang.spec')
-rw-r--r-- | swift-lang.spec | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/swift-lang.spec b/swift-lang.spec index 13fb594..7f8a450 100644 --- a/swift-lang.spec +++ b/swift-lang.spec @@ -210,11 +210,41 @@ mkdir -p %{buildroot}%{_mandir}/man1 install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1 +# This is necessary because in Swift 4 the directories +# under clang were actual directories. In 5 Apple added +# an additional layer of indirection, to the compiler +# version, with the previous directories relocated there. +# Apparently there is an issue with rpm being able to +# replace directories with something else (in this case, +# symlinks), thus making this pre-installation step +# necessary when upgrading from 4.x to 5. +%pretrans -p <lua> +path = "/usr/lib/swift/clang" +subdirs = {"include", "lib", "share"} +st = posix.stat(path) +if st and st.type == "directory" then + for _, dir in ipairs(subdirs) do + fullDir = path .. "/" .. dir + status = os.rename(fullDir, fullDir .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end + end +end + + %files %license swift/LICENSE.txt %{_bindir}/swift* %{_mandir}/man1/* -#/usr/lib/swift/ +%ghost /usr/lib/swift/clang/include.rpmmoved +%ghost /usr/lib/swift/clang/lib.rpmmoved +%ghost /usr/lib/swift/clang/share.rpmmoved /usr/lib/swift-lldb/ /usr/lib/swift/Block/ /usr/lib/swift/CoreFoundation/ @@ -230,7 +260,6 @@ install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/m %files runtime -#/usr/lib/swift/ /usr/lib/swift/linux/libBlocksRuntime.so /usr/lib/swift/linux/libdispatch.so /usr/lib/swift/linux/libFoundation.so @@ -242,9 +271,9 @@ install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/m /usr/lib/swift/linux/libswiftSwiftOnoneSupport.so /usr/lib/swift/linux/libXCTest.so %ifarch aarch64 -/usr/lib/swift/linux/aarch64/* +/usr/lib/swift/linux/aarch64/ %else -/usr/lib/swift/linux/x86_64/* +/usr/lib/swift/linux/x86_64/ %endif %{_sysconfdir}/ld.so.conf.d/swift-lang-runtime.conf |