debian swirl logo

Back to the packages list ciderwebmail

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2012, Jonas Smedegaard 
# Description: Main Debian packaging script for CiderWebmail
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/perl-makemaker.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = ciderwebmail

# suppress optional build-dependencies
CDBS_BUILD_DEPENDS_rules_upstream-tarball = 
CDBS_BUILD_DEPENDS_rules_utils_copyright-check = 

DEB_UPSTREAM_PACKAGE = CiderWebmail
# TODO: Use this and drop hints below when source again released there
#DEB_UPSTREAM_URL = http://ciderwebmail.org/downloads
DEB_UPSTREAM_URL = https://github.com/$(DEB_UPSTREAM_PACKAGE)/$(DEB_UPSTREAM_PACKAGE)/tarball
# TODO: when tagged upstream change to v$(DEB_UPSTREAM_TARBALL_VERSION)
DEB_UPSTREAM_TARBALL_BASENAME = master
DEB_UPSTREAM_TARBALL_DELIMITER = 
DEB_UPSTREAM_TARBALL_EXTENSION = 
DEB_UPSTREAM_RECEIVED_EXTENSION = tar.gz
DEB_UPSTREAM_WGET_OPTS += --no-check-certificate
DEB_UPSTREAM_TARBALL_MD5 = 86fd4c8601e98e48b9fc48035d01d004

# Needed by upstream build and (always) at runtime
#  * recent libcatalyst-modules-perl needed for versioned dependency on
#    Catalyst::Action::RenderView
perl-deps = parent moose catalyst-authentication-credential-http yaml
perl-deps += yaml-libyaml catalyst-view-petal petal-utils
perl-deps += datetime datetime-format-mail mime-tools try-tiny
perl-deps += email-simple email-sender email-valid email-address
perl-deps += regexp-common-email-address regexp-common text-iconv
perl-deps += text-autoformat io-socket-ssl clone html-scrubber html-tidy
perl-deps += uri locale-maketext-gettext list-moreutils data-ical
perl-deps += datetime-format-iso8601 crypt-util crypt-cbc crypt-rijndael
perl-deps += crypt-random-source mime-base64-urlsafe dbd-sqlite3
deps = $(patsubst %,$(comma) lib%-perl,$(perl-deps))
deps += , libmoosex-role-withoverloading-perl (>= 0.09)
deps += , libcatalyst-perl (>= 5.80030), libcatalyst-modules-perl (>= 43)
deps += , libparse-recdescent-perl (>= 1.967009)
deps += , libmail-imapclient-perl (>= 3.31)
CDBS_BUILD_DEPENDS += , $(deps), $(deps-test)
CDBS_DEPENDS_$(pkg) = $(deps)

# Needed by upstream testsuite (undeclared in Makefile.PL)
deps-test = libtest-xpath-perl

# Needed for upstream build
CDBS_BUILD_DEPENDS += , libmodule-install-perl

# Needed (often/seldom) at runtime
CDBS_RECOMMENDS_$(pkg) = http-icons, libjs-mootools
CDBS_RECOMMENDS_$(pkg) += , default-mta | mail-transport-agent
CDBS_SUGGESTS_$(pkg) = libfcgi-perl, libfcgi-procmanager-perl
CDBS_SUGGESTS_$(pkg) += , dovecot | imap-server, imapproxy

# silence graphics files (in addition to defaults)
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(root/static/(images/.*|favicon\.ico)|debian/(changelog|copyright(|_hints|_newhints)))$

DEB_DH_INSTALL_ARGS_$(pkg) = root/* usr/share/$(pkg)/root/
DEB_INSTALL_EXAMPLES_$(pkg) = ciderwebmail.yml script/update_schema.sh debian/uwsgi

# Avoid virtually empty TODO file
DEB_INSTALL_DOCS_ALL := $(filter-out TODO,$(DEB_INSTALL_DOCS_ALL))

# Install config files
binary-install/$(pkg)::
		mkdir -p $(cdbs_curdestdir)etc/$(pkg)
		touch $(cdbs_curdestdir)etc/$(pkg)/custom.css
		cp -f -t $(cdbs_curdestdir)etc/$(pkg) debian/etc/*

# Install binaries in project-specific dir and drop their manpages
binary-post-install/$(pkg)::
		mkdir -p $(cdbs_curdestdir)usr/share/$(pkg)/bin
		mv $(cdbs_curdestdir)usr/bin/* $(cdbs_curdestdir)usr/share/$(pkg)/bin/
		rm -rf $(cdbs_curdestdir)usr/share/man/man1

# Replace config and separately shipped parts with symlinks
binary-post-install/$(pkg)::
		rm -f $(cdbs_curdestdir)usr/share/$(pkg)/root/static/scripts/mootools-core.js
		ln -sT ../../../../javascript/mootools/mootools-core.min.js $(cdbs_curdestdir)usr/share/$(pkg)/root/static/scripts/mootools-core.js
		rm -rf $(cdbs_curdestdir)usr/share/$(pkg)/root/static/images/mimeicons
		ln -sT ../../../../images/http-icons/ $(cdbs_curdestdir)usr/share/$(pkg)/root/static/images/mimeicons
		rm -rf $(cdbs_curdestdir)usr/share/$(pkg)/root/static/css/custom.css
		ln -sT /etc/ciderwebmail/custom.css $(cdbs_curdestdir)usr/share/$(pkg)/root/static/css/custom.css

# Drop unneeded noise
binary-post-install/$(pkg)::
		find $(cdbs_curdestdir)usr/share/$(pkg) -name '*.mo' -delete

Builds:

ciderwebmail
imap webmail service