diff --git a/data/var/www/plinth/custom/static/theme b/data/var/www/plinth/custom/static/theme deleted file mode 120000 index 932f05ef2..000000000 --- a/data/var/www/plinth/custom/static/theme +++ /dev/null @@ -1 +0,0 @@ -themes/default/ \ No newline at end of file diff --git a/data/var/www/plinth/custom/static/themes/default/icons/.gitignore b/data/var/www/plinth/custom/static/themes/default/icons/.gitignore deleted file mode 100644 index 76bedaeab..000000000 --- a/data/var/www/plinth/custom/static/themes/default/icons/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore - diff --git a/plinth/__main__.py b/plinth/__main__.py index a633d0054..9531aafa3 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -115,16 +115,21 @@ def setup_server(): custom_static_dir = cfg.custom_static_dir custom_static_url = '/plinth/custom/static' - config = { - '/': { - 'tools.staticdir.root': custom_static_dir, - 'tools.staticdir.on': True, - 'tools.staticdir.dir': '.' + if os.path.exists(custom_static_dir): + config = { + '/': { + 'tools.staticdir.root': custom_static_dir, + 'tools.staticdir.on': True, + 'tools.staticdir.dir': '.' + } } - } - cherrypy.tree.mount(None, custom_static_url, config) - logger.debug('Serving custom static directory %s on %s', custom_static_dir, - custom_static_url) + cherrypy.tree.mount(None, custom_static_url, config) + logger.debug('Serving custom static directory %s on %s', + custom_static_dir, custom_static_url) + else: + logger.debug( + 'Not serving custom static directory %s on %s, ' + 'directory does not exist', custom_static_dir, custom_static_url) js_dir = '/usr/share/javascript' js_url = '/javascript' diff --git a/setup.py b/setup.py index 0c557008c..fa5b0c7b3 100755 --- a/setup.py +++ b/setup.py @@ -228,54 +228,48 @@ setuptools.setup( 'locale/*/LC_MESSAGES/*.[pm]o' ] }, - data_files=[ - ('/usr/lib/firewalld/services/', - glob.glob('data/usr/lib/firewalld/services/*.xml')), - ('/etc/apache2/conf-available', - glob.glob('data/etc/apache2/conf-available/*.conf')), - ('/etc/apache2/sites-available', - glob.glob('data/etc/apache2/sites-available/*.conf')), - ('/etc/apache2/includes', - glob.glob('data/etc/apache2/includes/*.conf')), - ('/etc/apt/apt.conf.d', - glob.glob('data/etc/apt/apt.conf.d/60unattended-upgrades')), - ('/etc/avahi/services/', - glob.glob('data/etc/avahi/services/*.service')), - ('/etc/ikiwiki', glob.glob('data/etc/ikiwiki/*.setup')), - ('/etc/NetworkManager/dispatcher.d/', - ['data/etc/NetworkManager/dispatcher.d/10-freedombox-batman']), - ('/etc/sudoers.d', ['data/etc/sudoers.d/plinth']), - ('/lib/systemd/system', - glob.glob('data/lib/systemd/system/*.service')), - ('/etc/mediawiki', glob.glob('data/etc/mediawiki/*.php')), - ('/usr/share/plinth/actions', glob.glob(os.path.join('actions', '*'))), - ('/usr/share/polkit-1/rules.d', - ['data/usr/share/polkit-1/rules.d/50-plinth.rules']), - ('/usr/share/man/man1', ['doc/plinth.1']), - ('/etc/plinth', [ - 'data/etc/plinth/plinth.config', - 'data/etc/plinth/custom-shortcuts.json' - ]), - ('/usr/share/augeas/lenses', - glob.glob('data/usr/share/augeas/lenses/*.aug')), - ('/usr/share/augeas/lenses/tests', - glob.glob('data/usr/share/augeas/lenses/tests/test_*.aug')), - ('/usr/share/pam-configs/', - glob.glob('data/usr/share/pam-configs/*-freedombox')), - ('/etc/plinth/modules-enabled', - glob.glob(os.path.join('data/etc/plinth/modules-enabled', '*'))), - ('/var/lib/polkit-1/localauthority/10-vendor.d', [ - 'data/var/lib/polkit-1/localauthority/10-vendor.d/' - 'org.freedombox.NetworkManager.pkla' - ]), - ( - '/var/www/plinth/custom/static/theme/icons/', - [ - 'data/var/www/plinth/custom/static/themes/default/icons/.gitignore', - # TODO Cannot be copied since a symlink is not a regular file - # 'data/var/www/plinth/custom/static/theme', - ]), - ], + data_files=[('/usr/lib/firewalld/services/', + glob.glob('data/usr/lib/firewalld/services/*.xml')), + ('/etc/apache2/conf-available', + glob.glob('data/etc/apache2/conf-available/*.conf')), + ('/etc/apache2/sites-available', + glob.glob('data/etc/apache2/sites-available/*.conf')), + ('/etc/apache2/includes', + glob.glob('data/etc/apache2/includes/*.conf')), + ('/etc/apt/apt.conf.d', + glob.glob('data/etc/apt/apt.conf.d/60unattended-upgrades')), + ('/etc/avahi/services/', + glob.glob('data/etc/avahi/services/*.service')), + ('/etc/ikiwiki', glob.glob('data/etc/ikiwiki/*.setup')), + ('/etc/NetworkManager/dispatcher.d/', [ + 'data/etc/NetworkManager/dispatcher.d/10-freedombox-batman' + ]), ('/etc/sudoers.d', [ + 'data/etc/sudoers.d/plinth' + ]), ('/lib/systemd/system', + glob.glob('data/lib/systemd/system/*.service')), + ('/etc/mediawiki', glob.glob('data/etc/mediawiki/*.php')), + ('/usr/share/plinth/actions', + glob.glob(os.path.join( + 'actions', '*'))), ('/usr/share/polkit-1/rules.d', [ + 'data/usr/share/polkit-1/rules.d/50-plinth.rules' + ]), ('/usr/share/man/man1', [ + 'doc/plinth.1' + ]), ('/etc/plinth', [ + 'data/etc/plinth/plinth.config', + 'data/etc/plinth/custom-shortcuts.json' + ]), ('/usr/share/augeas/lenses', + glob.glob('data/usr/share/augeas/lenses/*.aug')), + ('/usr/share/augeas/lenses/tests', + glob.glob('data/usr/share/augeas/lenses/tests/test_*.aug')), + ('/usr/share/pam-configs/', + glob.glob('data/usr/share/pam-configs/*-freedombox')), + ('/etc/plinth/modules-enabled', + glob.glob( + os.path.join('data/etc/plinth/modules-enabled', '*'))), + ('/var/lib/polkit-1/localauthority/10-vendor.d', [ + 'data/var/lib/polkit-1/localauthority/10-vendor.d/' + 'org.freedombox.NetworkManager.pkla' + ])], cmdclass={ 'install': CustomInstall, 'build': CustomBuild,