[asciidoc] fix broken and remove dangling symlinks

Nils Philippsen nphilipp at fedoraproject.org
Mon Feb 10 17:16:44 UTC 2014


commit 1312ded0ff105c61680efa63e09f15478ba2df82
Author: Nils Philippsen <nils at redhat.com>
Date:   Mon Feb 10 18:10:43 2014 +0100

    fix broken and remove dangling symlinks

 asciidoc.spec |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/asciidoc.spec b/asciidoc.spec
index 162d712..5608d07 100644
--- a/asciidoc.spec
+++ b/asciidoc.spec
@@ -4,7 +4,7 @@
 Summary: Text based document generation
 Name: asciidoc
 Version: 8.6.8
-Release: 4%{?dist}
+Release: 5%{?dist}
 # The python code does not specify a version.
 # The javascript example code is GPLv2+.
 License: GPL+ and GPLv2+
@@ -24,6 +24,7 @@ BuildRequires: lilypond
 BuildRequires: source-highlight
 BuildRequires: texlive-dvipng-bin
 BuildRequires: vim-filesystem
+BuildRequires: symlinks
 
 
 Requires: python >= 2.4
@@ -93,11 +94,13 @@ install -dm 755 %{buildroot}%{_datadir}/asciidoc/
 for d in dblatex docbook-xsl images javascripts stylesheets; do
     mv -v %{buildroot}%{_sysconfdir}/asciidoc/$d \
           %{buildroot}%{_datadir}/asciidoc/
-    ln -s %{_datadir}/%{name}/$d %{buildroot}%{_sysconfdir}/%{name}/
+    # absolute symlink into buildroot is intentional, see below
+    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_sysconfdir}/%{name}/
 
     # let's symlink stuff for documentation as well so we don't duplicate things
     rm -rf %{buildroot}%{_docdir}/%{name}/$d
-    ln -s %{_datadir}/%{name}/$d %{buildroot}%{_docdir}/%{name}/
+    # absolute symlink into buildroot is intentional, see below
+    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_docdir}/%{name}/
 done
 
 # Python API
@@ -113,6 +116,10 @@ for file in $(cd vim; find * -type f); do
     install -m 0644 vim/$file %{buildroot}%{vimdir}/$file
 done
 
+# Absolute symlinks were used above to be able to detect dangling ones. Make
+# them relative now (sane for being installed) and remove dangling symlinks.
+symlinks -cdr %{buildroot}
+
 %check
 export PATH="../:$PATH"
 cd tests
@@ -157,8 +164,9 @@ python testasciidoc.py run
 
 
 %changelog
-* Mon Feb 10 2014 Nils Philippsen <nils at redhat.com> - 8.6.8-4
+* Mon Feb 10 2014 Nils Philippsen <nils at redhat.com> - 8.6.8-5
 - explicitly use system copy of Python 2.x
+- fix broken and remove dangling symlinks
 
 * Tue Dec 03 2013 Stanislav Ochotnicky <sochotnicky at redhat.com> - 8.6.8-3
 - Fix duplicate documentation files (#1001234)


More information about the scm-commits mailing list