diff --git a/Server/assets/site.less b/Server/assets/site.less new file mode 120000 index 000000000..dc1dc0cde --- /dev/null +++ b/Server/assets/site.less @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/Server/assets/style.less b/Server/assets/style.less index 59c1ea375..38d92a179 100644 --- a/Server/assets/style.less +++ b/Server/assets/style.less @@ -135,3 +135,8 @@ input.tt-hint { @import "reserve-workflow.less"; @import "job-matrix.less"; @import "system.less"; + +// Site-specific styles. The beaker-server package creates site.less as +// a symlink to /dev/null if it doesn't exist. Admins can overwrite the symlink +// to point at their own custom LESS instead. +@import "site.less"; diff --git a/Server/bkr/server/assets.py b/Server/bkr/server/assets.py index 8f5fb868d..fee0ef45a 100644 --- a/Server/bkr/server/assets.py +++ b/Server/bkr/server/assets.py @@ -108,6 +108,8 @@ def list_asset_sources(source_dir): for bundle in env: for path in get_all_bundle_files(bundle, env): paths.append(os.path.relpath(path, source_dir)) + # site.less should be skipped because it's a symlink + paths.remove('site.less') # font-awesome is currently not managed by webassets because webassets # breaks on non-UTF8 input files paths.extend([ diff --git a/beaker.spec b/beaker.spec index 95bcfecff..e79f6a37f 100644 --- a/beaker.spec +++ b/beaker.spec @@ -352,6 +352,10 @@ chown root:root %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || : chmod go-w %{_localstatedir}/log/%{name}/*.log >/dev/null 2>&1 || : # Restart rsyslog so that it notices the config which we ship /sbin/service rsyslog condrestart >/dev/null 2>&1 || : +# Create symlink for site.less (this is ghosted so that other packages can overwrite it) +if [ ! -f %{_datadir}/bkr/server/assets/site.less ] ; then + ln -s /dev/null %{_datadir}/bkr/server/assets/site.less || : +fi %endif %if %{with labcontroller} @@ -469,6 +473,7 @@ rm -rf %{_var}/lib/beaker/osversion_data %attr(-,apache,root) %dir %{_datadir}/bkr %attr(-,apache,root) %{_datadir}/bkr/beaker-server.wsgi %attr(-,apache,root) %{_datadir}/bkr/server +%ghost %attr(0777,root,root) %{_datadir}/bkr/server/assets/site.less %attr(0660,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/server.cfg %dir %{_localstatedir}/log/%{name} %dir %{_localstatedir}/cache/%{name}