File debian.rules of Package roundcubemail
#!/usr/bin/make -f
DH_VERBOSE=1
%:
dh $@
override_dh_auto_build:
echo $(CURDIR)
find debian/ -type f | sort
mkdir -p $(CURDIR)/debian/home/.composer/
echo '{}' > $(CURDIR)/debian/home/.composer/composer.json
patch -p1 < debian/patches/add-composer-autoloader.diff || :
if [ -x "$$(which composer.sh 2>/dev/null)" ]; then \
HOME=$(CURDIR)/debian/home/ composer.sh -vvv dumpautoload --optimize ; \
else \
HOME=$(CURDIR)/debian/home/ composer -vvv dumpautoload --optimize ; \
fi
sed -i -e "s|.baseDir . '/../../../share|'/usr/share|" $(CURDIR)/vendor/composer/autoload_psr4.php
sed -i -e "s|.baseDir . '/../../../share|'/usr/share|" $(CURDIR)/vendor/composer/autoload_namespaces.php
sed -i -e "s|.baseDir . '/../../../share|'/usr/share|" $(CURDIR)/vendor/composer/autoload_classmap.php
sed -i -e "s|__DIR__ . '/../..' . '/../../../share|'/usr/share|" $(CURDIR)/vendor/composer/autoload_static.php || true
rm -rvf temp/js_cache/ tests/
# Parse .less
lessc -x ./skins/elastic/styles/styles.less > ./skins/elastic/styles/styles.css
lessc -x ./skins/elastic/styles/print.less > ./skins/elastic/styles/print.css
lessc -x ./skins/elastic/styles/embed.less > ./skins/elastic/styles/embed.css
# Compress the CSS
for file in `find $(CURDIR)/ -type f -name "*.css" | grep -v /public_html/assets/`; do \
asset_loc=$$(dirname $$(echo $${file} | sed \
-e "s|$(CURDIR)/plugins/|$(CURDIR)/public_html/assets/plugins/|g" \
-e "s|$(CURDIR)/program/|$(CURDIR)/public_html/assets/program/|g" \
-e "s|$(CURDIR)/skins/|$(CURDIR)/public_html/assets/skins/|g") ; \
) ; \
mkdir -p $${asset_loc} ; \
echo "$${file} -> $${asset_loc}/$$(basename $${file})" ; \
cat $${file} | cssmin > $${asset_loc}/$$(basename $${file}) || \
cp -vf $${file} $${asset_loc}/$$(basename $${file}) ; \
done
# Compress the JS, but not the already minified
for file in `find $(CURDIR)/ -type f -name "*.js" ! -name "*.min.js" | grep -v /public_html/assets/`; do \
asset_loc=$$(dirname $$(echo $${file} | sed \
-e "s|$(CURDIR)/plugins/|$(CURDIR)/public_html/assets/plugins/|g" \
-e "s|$(CURDIR)/program/|$(CURDIR)/public_html/assets/program/|g" \
-e "s|$(CURDIR)/skins/|$(CURDIR)/public_html/assets/skins/|g") ; \
) ; \
mkdir -p $${asset_loc} ; \
echo "$${file} -> $${asset_loc}/$$(basename $${file})" ; \
uglifyjs $${file} > $${asset_loc}/$$(basename $${file}) || \
cp -vf $${file} $${asset_loc}/$$(basename $${file}) ; \
done
# The already minied JS can just be copied over to the assets location
for file in `find $(CURDIR)/ -type f -name "*.min.js" | grep -v /public_html/assets/`; do \
asset_loc=$$(dirname $$(echo $${file} | sed \
-e "s|$(CURDIR)/plugins/|$(CURDIR)/public_html/assets/plugins/|g" \
-e "s|$(CURDIR)/program/|$(CURDIR)/public_html/assets/program/|g" \
-e "s|$(CURDIR)/skins/|$(CURDIR)/public_html/assets/skins/|g") ; \
) ; \
mkdir -p $${asset_loc} ; \
cp -vf $${file} $${asset_loc}/$$(basename $${file}) ; \
done
# Other assets
for file in $$(find $(CURDIR)/plugins/ $(CURDIR)/program/ $(CURDIR)/skins/ -type f \
-name "*.eot" -o \
-name "*.gif" -o \
-name "*.ico" -o \
-name "*.jpg" -o \
-name "*.mp3" -o \
-name "dummy.pdf" -o \
-name "*.png" -o \
-name "*.svg" -o \
-name "*.swf" -o \
-name "*.tif" -o \
-name "*.tiff" -o \
-name "*.ttf" -o \
-name "*.wav" -o \
-name "*.webp" -o \
-name "*.woff" -o \
-name "*.woff2" \
); do \
asset_loc=$$(dirname $$(echo $${file} | sed \
-e "s|$(CURDIR)/plugins/|$(CURDIR)/public_html/assets/plugins/|g" \
-e "s|$(CURDIR)/program/|$(CURDIR)/public_html/assets/program/|g" \
-e "s|$(CURDIR)/skins/|$(CURDIR)/public_html/assets/skins/|g") ; \
) ; \
mkdir -p $${asset_loc} ; \
cp -avf $${file} $${asset_loc}/$$(basename $${file}); \
done
# The watermark.html is an asset, too
for skin in classic elastic larry; do \
if [ -f "$(CURDIR)/skins/$${skin}/watermark.html" ]; then \
cp -av $(CURDIR)/skins/$${skin}/watermark.html \
$(CURDIR)/public_html/assets/skins/$${skin}/watermark.html ; \
fi ; \
done
for plugin in `find $(CURDIR)/plugins/ -type d -mindepth 1 -maxdepth 1 -exec basename {} \;) | sort -u`; do \
pkgname=$$(echo $${plugin} | sed -e 's/_/-/g') ; \
if [ -f "$(CURDIR)/debian/roundcubemail-plugin-$${pkgname}.install" ]; then \
continue ; \
fi ; \
if [ -f "$(CURDIR)/plugins/$${plugin}/config.inc.php.dist" ]; then \
mv $(CURDIR)/plugins/$${plugin}/config.inc.php.dist $(CURDIR)/config/$${plugin}.inc.php ; \
echo "etc/roundcubemail/$${plugin}.inc.php usr/share/roundcubemail/plugins/$${plugin}/config.inc.php" >> debian/roundcubemail-plugin-$${pkgname}.links ; \
echo "config/$${plugin}.inc.php etc/roundcubemail/" >> debian/roundcubemail-plugin-$${pkgname}.install ; \
fi ; \
if [ -d "$(CURDIR)/public_html/assets/plugins/$${plugin}" ]; then \
echo "public_html/assets/plugins/$${plugin} usr/share/roundcubemail/public_html/assets/plugins" >> debian/roundcubemail-plugin-$${pkgname}.install ; \
fi ; \
echo "usr/share/roundcubemail/plugins/$${plugin}" >> debian/roundcubemail-plugin-$${pkgname}.dirs ; \
echo "plugins/$${plugin} usr/share/roundcubemail/plugins/" >> debian/roundcubemail-plugin-$${pkgname}.install ; \
if [ -d "$(CURDIR)/plugins/$${plugin}/lib/Roundcube" ]; then \
echo "usr/share/roundcubemail/plugins/$${plugin}/lib" >> debian/roundcubemail-plugin-$${pkgname}.dirs ; \
echo "plugins/$${plugin}/lib/Roundcube usr/share/roundcubemail/plugins/$${plugin}/lib/" >> debian/roundcubemail-plugin-$${pkgname}.install ; \
fi ; \
echo "" >> debian/control ; \
echo "Package: roundcubemail-plugin-$${pkgname}" >> debian/control ; \
echo "Architecture: all" >> debian/control ; \
echo "Depends: roundcubemail-core" >> debian/control ; \
echo "Breaks: roundcubemail (<< 1:1.2.4)" >> debian/control ; \
echo "Replaces: roundcubemail (<< 1:1.2.4)" >> debian/control ; \
echo "Description: $${plugin} plugin for Roundcube" >> debian/control ; \
echo "" >> debian/control ; \
sed -i -e "/Files:/ i\
roundcubemail-plugin-$${plugin} deb web extra" debian/control ; \
done
cp -v ../SOURCES/2017111400.sql SQL/mysql/
if [ -f "/etc/plesk-release" ]; then \
cp -v ../SOURCES/plesk.config.inc.php config/config.inc.php ; \
cp -v ../SOURCES/plesk.managesieve.inc.php config/managesieve.inc.php ; \
cp -v ../SOURCES/plesk.password.inc.php config/password.inc.php ; \
sed -i -e 's/www-data adm/roundcube_sysuser roundcube_sysgroup/g' debian/logrotate ; \
echo "misc:Depends:roundcubemail-skin-plesk" >> debian/roundcubemail-core.substvars ; \
else \
find config/ -type f | sort ; \
if [ -f "config/config.inc.php.sample" ]; then \
mv config/config.inc.php.sample config/config.inc.php ; \
fi ; \
echo "misc:Depends:roundcubemail-skin-chameleon | roundcubemail-skin-kolab | roundcubemail-skin-enterprise" >> debian/roundcubemail-core.substvars ; \
fi
override_dh_install:
if [ ! -f "/etc/plesk-release" ]; then \
mkdir -p $(CURDIR)/debian/roundcubemail-core/etc/apache2/sites-available ; \
install -pm 644 $(CURDIR)/debian/conf/roundcubemail.conf $(CURDIR)/debian/roundcubemail-core/etc/apache2/sites-available/roundcubemail.conf ; \
fi
dh_install
override_dh_compress:
dh_compress -Xsql