summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Olson <tachoknight@gmail.com>2019-04-01 10:01:53 -0500
committerRon Olson <tachoknight@gmail.com>2019-04-01 10:01:53 -0500
commit8294712d13db032edd6c7c83f016091b687582b9 (patch)
tree3fff17c1ddaaae916d3c8e3f947e246c798d1b62
parente6f6fffc9c7ea1b03f174aeb620ec531f309a260 (diff)
downloadswift-lang-8294712d13db032edd6c7c83f016091b687582b9.tar.gz
swift-lang-8294712d13db032edd6c7c83f016091b687582b9.tar.xz
swift-lang-8294712d13db032edd6c7c83f016091b687582b9.zip
Upgrading seems to work but warning about missing files
-rw-r--r--swift-lang.spec37
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