#!/bin/bash

source debian/vars.sh

install -D -m 644 $SOURCE0 $buildroot$_cpanel_customizations_includes/cpanel_jupiter_cp_analytics.html.tt
install -D -m 644 $SOURCE1 $buildroot$_webmail_customizations_includes/cp_analytics_webmail.html.tt
install -D -m 644 $SOURCE2 $buildroot$_whm_customizations_includes/cp_analytics_whm.html.tt
install -D -m 644 $SOURCE3 $buildroot$_whm_customizations_includes/slideout.js
install -D -m 644 $SOURCE22 $buildroot$_cpanel_customizations_ui_analytics/mixpanelSetup.js
install -d -m 751 $buildroot$_cpanel_libraries_dir
install -d -m 751 $buildroot$_webmail_libraries_dir
install -d -m 751 $buildroot$_whm_libraries_dir
ln -sf $_cpanel_customizations_ui_analytics $buildroot$_cpanel_libraries_dir/$_ui_analytics_dir
ln -sf $_cpanel_customizations_ui_analytics $buildroot$_webmail_libraries_dir/$_ui_analytics_dir
ln -sf $_cpanel_customizations_ui_analytics $buildroot$_whm_libraries_dir/$_ui_analytics_dir
install -D -m 644 $SOURCE4 $buildroot$_cpanel_perl_includes/Cpanel/UpdateGatherer/Gatherer.pm
install -D -m 644 $SOURCE5 $buildroot$_gatherer_modules/Locales.pm
install -D -m 644 $SOURCE6 $buildroot$_gatherer_modules/WordPress.pm
install -D -m 644 $SOURCE7 $buildroot$_gatherer_modules/AddonFeatures.pm
install -D -m 644 $SOURCE8 $buildroot$_gatherer_modules/Customizations.pm
install -D -m 644 $SOURCE9 $buildroot$_gatherer_modules/VirtualUsers.pm
install -D -m 700 $SOURCE10 $buildroot$_cpanel_scripts/gather_update_log_stats
install -D -m 700 $SOURCE11 $buildroot$_cpanel_scripts/gather_update_logs_setupcrontab
install -D -m 644 $SOURCE12 $buildroot$_cpanel_perl_includes/Cpanel/UpdateGatherer/LogReader.pm
install -D -m 644 $SOURCE13 $buildroot$_gatherer_modules/Repos.pm
install -D -m 644 $SOURCE19 $buildroot$_gatherer_modules/Mailman.pm
install -D -m 644 $SOURCE20 $buildroot$_cpanel_perl_includes/Cpanel/UpdateGatherer/Std.pm
install -D -m 644 $SOURCE21 $buildroot$_gatherer_modules/LiveEngine.pm
install -D -m 644 $SOURCE24 $buildroot$_gatherer_modules/Plugins.pm
install -D -m 644 $SOURCE25 $buildroot$_gatherer_modules/SpamAssassin.pm
install -D -m 644 $SOURCE26 $buildroot$_gatherer_modules/MalwareDetection.pm
install -D -m 644 $SOURCE27 $buildroot$_gatherer_modules/EximMainlog.pm
install -D -m 644 $SOURCE33 $buildroot$_gatherer_modules/Elevate.pm
install -D -m 644 $SOURCE34 $buildroot$_gatherer_modules/EmailStats.pm
install -D -m 644 $SOURCE35 $buildroot$_gatherer_modules/Certificates.pm
install -d -m 751 $buildroot$_cron_daily
install -D -m 644 $SOURCE16 $buildroot/$_analytics_utils/snapshot_plugin.pre
install -D -m 644 $SOURCE17 $buildroot/$_analytics_utils/snapshot_plugin.post
install -D -m 644 $SOURCE18 $buildroot/$_snapshot_prep_d/analytics.json
# Template Plugin
install -D -m 644  $SOURCE23 $buildroot$_cpanel_base/Cpanel/Template/Plugin/Analytics.pm
# Roundcube mixpanel_analytics plugin
install -D -m 644 $SOURCE28 $buildroot$_roundcube_inc_dir/999-analytics.inc.php
install -d -m 755 $buildroot$_roundcube_plugins_dir/mixpanel_analytics
install -D -m 644 $SOURCE29 $buildroot$_roundcube_plugins_dir/mixpanel_analytics/LICENSE
install -D -m 644 $SOURCE30 $buildroot$_roundcube_plugins_dir/mixpanel_analytics/composer.json
install -D -m 644 $SOURCE31 $buildroot$_roundcube_plugins_dir/mixpanel_analytics/mixpanel_analytics.php
install -D -m 644 $SOURCE32 $buildroot$_roundcube_plugins_dir/mixpanel_analytics/mixpanel_analytics_include.js
tree $buildroot
