| 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | export LC_ALL=C.UTF-8 |
| 4 | |
| 5 | SASS_OPTIONS := --load-path debian/missing-sources/bourbon/app/assets/stylesheets \ |
| 6 | --load-path debian/missing-sources/bourbon-neat/app/assets/stylesheets \ |
| 7 | --load-path /usr/share/sass/font-awesome \ |
| 8 | --load-path debian/missing-sources/wyrm/sass \ |
| 9 | --style compressed \ |
| 10 | --sourcemap=none |
| 11 | |
| 12 | COMMON_PATH = debian/sphinx-rtd-theme-common/usr/share/sphinx_rtd_theme |
| 13 | PY3_PATH = debian/python3-sphinx-rtd-theme/usr/lib/python3/dist-packages/sphinx_rtd_theme |
| 14 | |
| 15 | %: |
| 16 | dh $@ --buildsystem=pybuild |
| 17 | |
| 18 | override_dh_auto_build: |
| 19 | mkdir -p sphinx_rtd_theme/static/css |
| 20 | sass $(SASS_OPTIONS) src/sass/theme.sass sphinx_rtd_theme/static/css/theme.css |
| 21 | sass $(SASS_OPTIONS) src/sass/badge_only.sass sphinx_rtd_theme/static/css/badge_only.css |
| 22 | mkdir -p sphinx_rtd_theme/static/js |
| 23 | sed s/module.exports.ThemeNav/_ThemeNav/ src/theme.js > sphinx_rtd_theme/static/js/theme.js |
| 24 | mkdir -p sphinx_rtd_theme/static/fonts |
| 25 | cp /usr/share/fonts/truetype/lato/Lato-Bold.ttf sphinx_rtd_theme/static/fonts/ |
| 26 | cp /usr/share/fonts/truetype/lato/Lato-BoldItalic.ttf sphinx_rtd_theme/static/fonts/ |
| 27 | cp /usr/share/fonts/truetype/lato/Lato-Italic.ttf sphinx_rtd_theme/static/fonts/ |
| 28 | cp /usr/share/fonts/truetype/lato/Lato-Regular.ttf sphinx_rtd_theme/static/fonts/ |
| 29 | cp /usr/share/fonts/opentype/roboto/slab/RobotoSlab-Bold.otf sphinx_rtd_theme/static/fonts/ |
| 30 | cp /usr/share/fonts/opentype/roboto/slab/RobotoSlab-Regular.otf sphinx_rtd_theme/static/fonts/ |
| 31 | set -ex; cd sphinx_rtd_theme/static/fonts/; for ttf in *.ttf; do woff2_compress $$ttf; done |
| 32 | set -ex; cd sphinx_rtd_theme/static/fonts/; for otf in *.otf; do woff2_compress $$otf; done |
| 33 | rm -fv sphinx_rtd_theme/static/fonts/*.otf |
| 34 | python3 setup.py compile_catalog |
| 35 | dh_auto_build |
| 36 | |
| 37 | override_dh_link: |
| 38 | dh_link -p sphinx-rtd-theme-common |
| 39 | rm -rf $(PY3_PATH)/static |
| 40 | set -ex; for d in static/css static/fonts static/js; do \ |
| 41 | mkdir -p $(PY3_PATH)/$$d; \ |
| 42 | done |
| 43 | set -ex; for f in `cd $(COMMON_PATH) && find -type f -or -type l | sed "s,^\./,,"`; do \ |
| 44 | ln -sf /usr/share/sphinx_rtd_theme/$$f $(PY3_PATH)/$$f; \ |
| 45 | done |
| 46 | dh_link --remaining-packages # To make the created symlinks relative |