>From d40a6a8da7e5af993a04fe09bd376a978bd4c099 Mon Sep 17 00:00:00 2001
From: Jiri Tomasek <jtomasek@redhat.com>
Date: Wed, 4 Jul 2012 16:15:51 +0200
Subject: [PATCH 12/12] Changes to spec.in

Stylesheet compilation is done in src and the compiled files are then copied. This ensures proper asset urls in compiled stylesheets.
The converge-ui symlinks are not created during build, they are copied from src instead.
---
 aeolus-conductor.spec.in |   26 ++++++++++++++------------
 src/config/compass.rb    |    3 ++-
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index 092414b..c731e9c 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -242,6 +242,7 @@ key="features/upload_files"
 opts="spec"
 png="public/images \
      public/images/icons \
+     public/images/embed \
      public/stylesheets/images \
      public/stylesheets/jquery.ui-1.8.1/images \
      vendor/converge-ui/images \
@@ -254,10 +255,10 @@ rb="app/models app/controllers app/controllers/api app/helpers app/services app/
     spec/aeolus/event spec/aeolus/ext lib/aeolus lib/aeolus/event lib/aeolus/ext \
     vendor/converge-ui/rails/helpers"
 rhtml="app/views/layouts"
-svg="public/images public/images/icons public/fonts vendor/converge-ui/fonts"
-ttf="public/fonts vendor/converge-ui/fonts"
-eot="public/fonts vendor/converge-ui/fonts"
-woff="public/fonts vendor/converge-ui/fonts"
+svg="public/images public/images/icons vendor/converge-ui/fonts"
+ttf="vendor/converge-ui/fonts"
+eot="vendor/converge-ui/fonts"
+woff="vendor/converge-ui/fonts"
 txt="public"
 yml="config config/locales config/locales/defaults config/locales/overrides
      config/locales/role_definitions config/locales/classnames config/locales/will_paginate \
@@ -276,9 +277,17 @@ for filetype in builder css eot feature gif haml mustache html ico jpg js json k
 done
 %{__rm} %{buildroot}%{app_root}/config/initializers/secret_token.rb
 
+#copy the converge-ui symlinks
+%{__cp} -P ./src/app/helpers/converge-ui %{buildroot}%{app_root}/app/helpers
+%{__cp} -P ./src/app/views/layouts/converge-ui %{buildroot}%{app_root}/app/views/layouts
+%{__cp} -P ./src/public/fonts %{buildroot}%{app_root}/public
+%{__cp} -P ./src/public/images/converge-ui %{buildroot}%{app_root}/public/images
+%{__cp} -P ./src/public/javascripts/converge-ui %{buildroot}%{app_root}/public/javascripts
+
 # precompile stylesheets
 %{__mkdir} %{buildroot}%{app_root}/public/stylesheets/compiled
-compass compile --sass-dir ./src/app/stylesheets --css-dir %{buildroot}%{app_root}/public/stylesheets/compiled
+compass compile --sass-dir ./src/app/stylesheets --css-dir ./src/public/stylesheets/compiled
+%{__cp} ./src/public/stylesheets/compiled/* %{buildroot}%{app_root}/public/stylesheets/compiled
 
 # misc files
 %{__cp} src/Rakefile %{buildroot}%{app_root}
@@ -355,13 +364,6 @@ popd 2>&1 > /dev/null
 %{__ln_s} -f %{app_root}/config/settings.yml %{_sysconfdir}/%{name}
 %{__ln_s} -f %{app_root}/config/oauth.json %{_sysconfdir}/%{name}
 
-#create converge-ui symlinks
-%{__ln_s} -f %{app_root}/vendor/converge-ui/rails/layouts %{app_root}/app/views/layouts/converge-ui
-%{__ln_s} -f %{app_root}/vendor/converge-ui/fonts %{app_root}/public/fonts
-%{__ln_s} -f %{app_root}/vendor/converge-ui/images %{app_root}/public/images/converge-ui
-%{__ln_s} -f %{app_root}/vendor/converge-ui/rails/helpers %{app_root}/app/helpers/converge-ui
-%{__ln_s} -f %{app_root}/vendor/converge-ui/javascripts %{app_root}/public/javascripts/converge-ui
-
 %postun
 # kind of a weird construct.  There are two cases where postun gets called;
 # during the removal of a package and during the cleanup after an upgrade.
diff --git a/src/config/compass.rb b/src/config/compass.rb
index a08ef16..2fa29fa 100644
--- a/src/config/compass.rb
+++ b/src/config/compass.rb
@@ -7,13 +7,14 @@ project_path = Compass::AppIntegration::Rails.root
 http_path = "/"
 css_dir = "public/stylesheets/compiled"
 sass_dir = "app/stylesheets"
+images_dir = "public/images"
 environment = Compass::AppIntegration::Rails.env
 
 # You can select your preferred output style here (can be overridden via the command line):
 # output_style = :expanded or :nested or :compact or :compressed
 
 # To enable relative paths to assets via compass helper functions. Uncomment:
-# relative_assets = true
+relative_assets = true
 
 # To disable debugging comments that display the original location of your selectors. Uncomment:
 # line_comments = false
-- 
1.7.7.6

