summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules46
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d8711be
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,46 @@
+#!/usr/bin/make -f
+
+export LC_ALL=C.UTF-8
+
+SASS_OPTIONS := --load-path debian/missing-sources/bourbon/app/assets/stylesheets \
+ --load-path debian/missing-sources/bourbon-neat/app/assets/stylesheets \
+ --load-path /usr/share/sass/font-awesome \
+ --load-path debian/missing-sources/wyrm/sass \
+ --style compressed \
+ --sourcemap=none
+
+COMMON_PATH = debian/sphinx-rtd-theme-common/usr/share/sphinx_rtd_theme
+PY3_PATH = debian/python3-sphinx-rtd-theme/usr/lib/python3/dist-packages/sphinx_rtd_theme
+
+%:
+ dh $@ --with python3 --buildsystem=pybuild
+
+override_dh_auto_build:
+ mkdir -p sphinx_rtd_theme/static/css
+ sass $(SASS_OPTIONS) src/sass/theme.sass sphinx_rtd_theme/static/css/theme.css
+ sass $(SASS_OPTIONS) src/sass/badge_only.sass sphinx_rtd_theme/static/css/badge_only.css
+ mkdir -p sphinx_rtd_theme/static/js
+ sed s/module.exports.ThemeNav/_ThemeNav/ src/theme.js > sphinx_rtd_theme/static/js/theme.js
+ mkdir -p sphinx_rtd_theme/static/fonts
+ cp /usr/share/fonts/truetype/lato/Lato-Bold.ttf sphinx_rtd_theme/static/fonts/
+ cp /usr/share/fonts/truetype/lato/Lato-BoldItalic.ttf sphinx_rtd_theme/static/fonts/
+ cp /usr/share/fonts/truetype/lato/Lato-Italic.ttf sphinx_rtd_theme/static/fonts/
+ cp /usr/share/fonts/truetype/lato/Lato-Regular.ttf sphinx_rtd_theme/static/fonts/
+ cp /usr/share/fonts/opentype/roboto/slab/RobotoSlab-Bold.otf sphinx_rtd_theme/static/fonts/
+ cp /usr/share/fonts/opentype/roboto/slab/RobotoSlab-Regular.otf sphinx_rtd_theme/static/fonts/
+ set -ex; cd sphinx_rtd_theme/static/fonts/; for ttf in *.ttf; do woff2_compress $$ttf; done
+ set -ex; cd sphinx_rtd_theme/static/fonts/; for otf in *.otf; do woff2_compress $$otf; done
+ rm -fv sphinx_rtd_theme/static/fonts/*.otf
+ python3 setup.py compile_catalog
+ dh_auto_build
+
+override_dh_link:
+ dh_link -p sphinx-rtd-theme-common
+ rm -rf $(PY3_PATH)/static
+ set -ex; for d in static/css static/fonts static/js; do \
+ mkdir -p $(PY3_PATH)/$$d; \
+ done
+ set -ex; for f in `cd $(COMMON_PATH) && find -type f -or -type l | sed "s,^\./,,"`; do \
+ ln -sf /usr/share/sphinx_rtd_theme/$$f $(PY3_PATH)/$$f; \
+ done
+ dh_link --remaining-packages # To make the created symlinks relative