[Pkg-javascript-commits] [rainloop] 02/38: Set up a proper Debian package build system.
Daniel Ring
techwolf-guest at moszumanska.debian.org
Fri Dec 15 06:03:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
techwolf-guest pushed a commit to branch master
in repository rainloop.
commit 5f61b51c7acececaaf9321dca12756a0f5ef8055
Author: Techwolf <dring at g33kworld.net>
Date: Sun Apr 30 22:23:34 2017 -0700
Set up a proper Debian package build system.
---
.gitignore | 3 +-
debian/changelog | 5 +
debian/clean | 3 +
debian/compat | 1 +
debian/conf/application.ini | 347 ++++++++++++++++++++++++++++++
debian/control | 29 +++
debian/copyright | 28 +++
debian/patches/series | 1 +
debian/patches/set-custom-data-path.patch | 12 ++
debian/rainloop.dirs | 5 +
debian/rainloop.docs | 3 +
debian/rainloop.install | 4 +
debian/rainloop.links | 2 +
debian/rainloop.postinst | 24 +++
debian/rules | 13 ++
debian/source/format | 1 +
debian/source/local-options | 2 +
debian/source/options | 1 +
debian/watch | 3 +
makedeb.sh | 69 ------
20 files changed, 486 insertions(+), 70 deletions(-)
diff --git a/.gitignore b/.gitignore
index 51a9006..16cce3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
/.idea
/.vscode
+/.pc
/api.php
/error.log
/nbproject
@@ -22,4 +23,4 @@
.DS_Store
/tests/fix.php
/MULTIPLY
-/include.php
\ No newline at end of file
+/include.php
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..da1a9d1
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+rainloop (1.11.0.205-1) UNRELEASED; urgency=low
+
+ * Initial release (Closes: #861581)
+
+ -- Daniel Ring <dring at wolfishly.me> Sun, 30 Apr 2017 03:19:32 -0700
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..03b6ef1
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,3 @@
+build/dist/
+rainloop/v/0.0.0/app/localization/moment/*
+rainloop/v/0.0.0/static/
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/conf/application.ini b/debian/conf/application.ini
new file mode 100644
index 0000000..4d45e5d
--- /dev/null
+++ b/debian/conf/application.ini
@@ -0,0 +1,347 @@
+; RainLoop Webmail configuration file
+
+[webmail]
+; Text displayed as page title
+title = "RainLoop Webmail"
+
+; Text displayed on startup
+loading_description = "RainLoop"
+
+; Theme used by default
+theme = "Default"
+
+; Allow theme selection on settings screen
+allow_themes = On
+allow_user_background = Off
+
+; Language used by default
+language = "en"
+
+; Admin Panel interface language
+language_admin = "en"
+
+; Allow language selection on settings screen
+allow_languages_on_settings = On
+allow_additional_accounts = On
+allow_additional_identities = On
+
+; Number of messages displayed on page by default
+messages_per_page = 20
+
+; File size limit (MB) for file upload on compose screen
+; 0 for unlimited.
+attachment_size_limit = 25
+
+[interface]
+show_attachment_thumbnail = On
+use_native_scrollbars = Off
+
+[branding]
+login_logo = ""
+login_background = ""
+login_desc = ""
+login_css = ""
+login_powered = On
+user_css = ""
+user_logo = ""
+user_logo_title = ""
+user_logo_message = ""
+user_iframe_message = ""
+welcome_page_url = ""
+welcome_page_display = "none"
+
+[contacts]
+; Enable contacts
+enable = Off
+allow_sharing = On
+allow_sync = Off
+sync_interval = 20
+type = "sqlite"
+pdo_dsn = "mysql:host=127.0.0.1;port=3306;dbname=rainloop"
+pdo_user = "root"
+pdo_password = ""
+suggestions_limit = 30
+
+[security]
+; Enable CSRF protection (http://en.wikipedia.org/wiki/Cross-site_request_forgery)
+csrf_protection = On
+custom_server_signature = "RainLoop"
+x_frame_options_header = ""
+openpgp = Off
+
+; Login and password for web admin panel
+admin_login = "admin"
+admin_password = "12345"
+
+; Access settings
+allow_admin_panel = Off
+allow_two_factor_auth = Off
+force_two_factor_auth = Off
+admin_panel_host = ""
+admin_panel_key = "admin"
+content_security_policy = ""
+core_install_access_domain = ""
+
+[ssl]
+; Require verification of SSL certificate used.
+verify_certificate = Off
+
+; Allow self-signed certificates. Requires verify_certificate.
+allow_self_signed = On
+
+; Location of Certificate Authority file on local filesystem (/etc/ssl/certs/ca-certificates.crt)
+cafile = ""
+
+; capath must be a correctly hashed certificate directory. (/etc/ssl/certs/)
+capath = ""
+
+[capa]
+folders = On
+composer = On
+contacts = On
+settings = On
+quota = On
+help = On
+reload = On
+search = On
+search_adv = On
+filters = On
+x-templates = Off
+dangerous_actions = On
+message_actions = On
+messagelist_actions = On
+attachments_actions = On
+
+[login]
+default_domain = "localhost"
+
+; Allow language selection on webmail login screen
+allow_languages_on_login = Off
+determine_user_language = On
+determine_user_domain = Off
+welcome_page = Off
+glass_style = On
+hide_submit_button = On
+active_backgroud = On
+forgot_password_link_url = ""
+registration_link_url = ""
+
+; This option allows webmail to remember the logged in user
+; once they closed the browser window.
+;
+; Values:
+; "DefaultOff" - can be used, disabled by default;
+; "DefaultOn" - can be used, enabled by default;
+; "Unused" - cannot be used
+sign_me_auto = "DefaultOff"
+
+[plugins]
+; Enable plugin support
+enable = Off
+
+; List of enabled plugins
+enabled_list = ""
+
+[defaults]
+; Editor mode used by default (Plain, Html, HtmlForced or PlainForced)
+view_editor_type = "Html"
+
+; layout: 0 - no preview, 1 - side preview, 2 - bottom preview
+view_layout = 1
+view_use_checkboxes = On
+autologout = 30
+show_images = Off
+contacts_autosave = On
+mail_use_threads = Off
+mail_reply_same_folder = Off
+
+[logs]
+; Enable logging
+enable = Off
+
+; Logs entire request only if error occured (php requred)
+write_on_error_only = Off
+
+; Logs entire request only if php error occured
+write_on_php_error_only = Off
+
+; Logs entire request only if request timeout (in seconds) occured.
+write_on_timeout_only = 0
+
+; Required for development purposes only.
+; Disabling this option is not recommended.
+hide_passwords = On
+time_offset = "0"
+session_filter = ""
+
+; Log filename.
+; For security reasons, some characters are removed from filename.
+; Allows for pattern-based folder creation (see examples below).
+;
+; Patterns:
+; {date:Y-m-d} - Replaced by pattern-based date
+; Detailed info: http://www.php.net/manual/en/function.date.php
+; {user:email} - Replaced by user's email address
+; If user is not logged in, value is set to "unknown"
+; {user:login} - Replaced by user's login (the user part of an email)
+; If user is not logged in, value is set to "unknown"
+; {user:domain} - Replaced by user's domain name (the domain part of an email)
+; If user is not logged in, value is set to "unknown"
+; {user:uid} - Replaced by user's UID regardless of account currently used
+;
+; {user:ip}
+; {request:ip} - Replaced by user's IP address
+;
+; Others:
+; {imap:login} {imap:host} {imap:port}
+; {smtp:login} {smtp:host} {smtp:port}
+;
+; Examples:
+; filename = "log-{date:Y-m-d}.txt"
+; filename = "{date:Y-m-d}/{user:domain}/{user:email}_{user:uid}.log"
+; filename = "{user:email}-{date:Y-m-d}.txt"
+filename = "log-{date:Y-m-d}.txt"
+
+; Enable auth logging in a separate file (for fail2ban)
+auth_logging = Off
+auth_logging_filename = "fail2ban/auth-{date:Y-m-d}.txt"
+auth_logging_format = "[{date:Y-m-d H:i:s}] Auth failed: ip={request:ip} user={imap:login} host={imap:host} port={imap:port}"
+
+[debug]
+; Special option required for development purposes
+enable = Off
+
+[social]
+; Google
+google_enable = Off
+google_enable_auth = Off
+google_enable_auth_fast = Off
+google_enable_drive = Off
+google_enable_preview = Off
+google_client_id = ""
+google_client_secret = ""
+google_api_key = ""
+
+; Facebook
+fb_enable = Off
+fb_app_id = ""
+fb_app_secret = ""
+
+; Twitter
+twitter_enable = Off
+twitter_consumer_key = ""
+twitter_consumer_secret = ""
+
+; Dropbox
+dropbox_enable = Off
+dropbox_api_key = ""
+
+[cache]
+; The section controls caching of the entire application.
+;
+; Enables caching in the system
+enable = On
+
+; Additional caching key. If changed, cache is purged
+index = "v1"
+
+; Can be: files, APC, memcache, redis (beta)
+fast_cache_driver = "files"
+
+; Additional caching key. If changed, fast cache is purged
+fast_cache_index = "v1"
+
+; Browser-level cache. If enabled, caching is maintainted without using files
+http = On
+
+; Caching message UIDs when searching and sorting (threading)
+server_uids = On
+
+[labs]
+; Experimental settings. Handle with care.
+;
+allow_mobile_version = On
+ignore_folders_subscription = Off
+check_new_password_strength = On
+update_channel = "stable"
+allow_gravatar = On
+allow_prefetch = On
+allow_smart_html_links = On
+cache_system_data = On
+date_from_headers = Off
+autocreate_system_folders = On
+allow_message_append = Off
+disable_iconv_if_mbstring_supported = Off
+login_fault_delay = 1
+log_ajax_response_write_limit = 300
+allow_html_editor_source_button = Off
+allow_html_editor_biti_buttons = Off
+allow_ctrl_enter_on_compose = Off
+try_to_detect_hidden_images = Off
+hide_dangerous_actions = Off
+use_app_debug_js = Off
+use_app_debug_css = Off
+use_imap_sort = On
+use_imap_force_selection = Off
+use_imap_list_subscribe = On
+use_imap_thread = On
+use_imap_move = Off
+use_imap_expunge_all_on_delete = Off
+imap_forwarded_flag = "$Forwarded"
+imap_read_receipt_flag = "$ReadReceipt"
+imap_body_text_limit = 555000
+imap_message_list_fast_simple_search = On
+imap_message_list_count_limit_trigger = 0
+imap_message_list_date_filter = 0
+imap_message_list_permanent_filter = ""
+imap_message_all_headers = Off
+imap_large_thread_limit = 50
+imap_folder_list_limit = 200
+imap_show_login_alert = On
+imap_use_auth_plain = On
+imap_use_auth_cram_md5 = Off
+smtp_show_server_errors = Off
+smtp_use_auth_plain = On
+smtp_use_auth_cram_md5 = Off
+sieve_allow_raw_script = Off
+sieve_utf8_folder_name = On
+imap_timeout = 300
+smtp_timeout = 60
+sieve_timeout = 10
+domain_list_limit = 99
+mail_func_clear_headers = On
+mail_func_additional_parameters = Off
+;favicon_url = "/favicon.png"
+favicon_status = On
+folders_spec_limit = 50
+owncloud_save_folder = "Attachments"
+owncloud_suggestions = On
+curl_proxy = ""
+curl_proxy_auth = ""
+in_iframe = Off
+force_https = Off
+custom_login_link = ""
+custom_logout_link = ""
+allow_external_login = Off
+allow_external_sso = Off
+external_sso_key = ""
+http_client_ip_check_proxy = Off
+fast_cache_memcache_host = "127.0.0.1"
+fast_cache_memcache_port = 11211
+fast_cache_redis_host = "127.0.0.1"
+fast_cache_redis_port = 6379
+use_local_proxy_for_external_images = Off
+detect_image_exif_orientation = On
+cookie_default_path = ""
+cookie_default_secure = Off
+replace_env_in_configuration = ""
+startup_url = ""
+nice_social_redirect = On
+strict_html_parser = Off
+allow_cmd = Off
+dev_email = ""
+dev_password = ""
+
+[version]
+current = "1.10.5.192"
+saved = "Sat, 07 Jan 2017 07:54:38 +0000"
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6fdccda
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,29 @@
+Source: rainloop
+Section: web
+Priority: optional
+Maintainer: Daniel Ring <dring at wolfishly.me>
+Build-Depends:
+ debhelper (>=9),
+ nodejs,
+ npm (>=3)
+Standards-Version: 3.9.8
+Homepage: https://rainloop.net/
+#Vcs-Git: git://anonscm.debian.org/collab-maint/rainloop.git
+#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/rainloop.git
+
+Package: rainloop
+Architecture: all
+Depends: ${misc:Depends},
+ php5-fpm (>= 5.4) | libapache2-mod-php5 (>= 5.4),
+ php5-curl,
+ php5-json
+Suggests: php5-sqlite | php5-mysql | php5-pgsql
+Description: Simple, modern & fast web-based email client
+ Rainloop is a PHP-based MUA with a modern interface and no database
+ requirements.
+ .
+ It supports IMAP and SMTP protocols (including SSL), Sieve scripts, multiple
+ accounts and identities, an admin panel for configuration, and integration
+ with a variety of commonly-used services. Plugins can be installed to further
+ extend functionality. Emails are not stored locally, but are accessed through
+ IMAP.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..8f926f9
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,28 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: rainloop
+Source: <https://github.com/rainloop/rainloop-webmail>
+
+Files: *
+Copyright: 2012-2017 Timur Usenko <support at rainloop.net>
+License: AGPL-3
+ Released under the GNU Affero General Public License, version 3.
+ See https://www.gnu.org/licenses/agpl.html for terms.
+
+Files: debian/*
+Copyright: 2017 Daniel Ring <dring at wolfishly.me>
+License: GPL-2+
+ This package 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 of the License, or
+ (at your option) any later version.
+ .
+ This package 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 <https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4c4b011
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+set-custom-data-path.patch
diff --git a/debian/patches/set-custom-data-path.patch b/debian/patches/set-custom-data-path.patch
new file mode 100644
index 0000000..952fd6e
--- /dev/null
+++ b/debian/patches/set-custom-data-path.patch
@@ -0,0 +1,12 @@
+Set path for runtime data storage outside of static file directory.
+--- a/rainloop/v/0.0.0/include.php
++++ b/rainloop/v/0.0.0/include.php
+@@ -47,7 +47,7 @@
+ define('APP_REPOSITORY_PATH', 'http://repository.rainloop.net/v1/');
+ define('APP_REPO_CORE_FILE', 'http://repository.rainloop.net/v2/core.{{channel}}.json');
+
+- $sCustomDataPath = '';
++ $sCustomDataPath = '/var/lib/rainloop';
+ $sCustomConfiguration = '';
+
+ if (file_exists(APP_INDEX_ROOT_PATH.'include.php'))
diff --git a/debian/rainloop.dirs b/debian/rainloop.dirs
new file mode 100644
index 0000000..002c4ec
--- /dev/null
+++ b/debian/rainloop.dirs
@@ -0,0 +1,5 @@
+usr/share/rainloop
+var/lib/rainloop
+var/lib/rainloop/_data_/_default_
+etc/rainloop
+etc/rainloop/domains
diff --git a/debian/rainloop.docs b/debian/rainloop.docs
new file mode 100644
index 0000000..c8c2e5b
--- /dev/null
+++ b/debian/rainloop.docs
@@ -0,0 +1,3 @@
+CODE_OF_CONDUCT.md
+CONTRIBUTING.md
+README.md
diff --git a/debian/rainloop.install b/debian/rainloop.install
new file mode 100644
index 0000000..c003341
--- /dev/null
+++ b/debian/rainloop.install
@@ -0,0 +1,4 @@
+build/dist/releases/webmail/*/src/rainloop /usr/share/rainloop
+build/dist/releases/webmail/*/src/index.php /usr/share/rainloop
+build/dist/releases/webmail/*/src/data/* /var/lib/rainloop
+debian/conf/application.ini /etc/rainloop
diff --git a/debian/rainloop.links b/debian/rainloop.links
new file mode 100644
index 0000000..7db3d90
--- /dev/null
+++ b/debian/rainloop.links
@@ -0,0 +1,2 @@
+etc/rainloop/ var/lib/rainloop/_data_/_default_/configs
+etc/rainloop/domains/ var/lib/rainloop/_data_/_default_/domains
diff --git a/debian/rainloop.postinst b/debian/rainloop.postinst
new file mode 100644
index 0000000..b4c6341
--- /dev/null
+++ b/debian/rainloop.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ configure)
+ if [ -d /var/lib/rainloop ]; then
+ if [ $(id -u www-data 2>&1 >/dev/null) ]; then
+ chown -R www-data:www-data /var/lib/rainloop
+ fi;
+ fi;
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..adecb90
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+# Output every command that modifies files on the build system
+export DH_VERBOSE = 1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ npm install --save-dev
+
+override_dh_auto_build:
+ node_modules/gulp/bin/gulp.js rainloop:start
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..9cdfca9
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1,2 @@
+unapply-patches
+abort-on-upstream-changes
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..b753adf
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+extend-diff-ignore = "\.git|node_modules"
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..de47703
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=4
+opts=filenamemangle=s/.+\/v(.+)\.tar\.gz/rainloop-$1\.tar\.gz/ \
+ https://github.com/rainloop/rainloop-webmail/tags .*/archive/v(.+)\.tar\.gz
diff --git a/makedeb.sh b/makedeb.sh
deleted file mode 100755
index 7e576bb..0000000
--- a/makedeb.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#Build RainLoop Webmail Debian Package
-PACKAGEVERSION="0";
-
-#Build rainloop
-gulp build;
-cd build/dist/releases/webmail;
-cd $(ls -t); #Most recent build folder
-
-#Working directory
-mkdir rainloop-deb-build;
-cd rainloop-deb-build;
-
-#Prepare zip file
-unzip ../rainloop-community-latest.zip;
-find . -type d -exec chmod 755 {} \;
-find . -type f -exec chmod 644 {} \;
-
-#Set up package directory
-VERSION=$(cat data/VERSION);
-DIR="rainloop_$VERSION-$PACKAGEVERSION";
-mkdir -m 0755 -p $DIR;
-mkdir -m 0755 -p $DIR/usr;
-mkdir -m 0755 -p $DIR/usr/share;
-mkdir -m 0755 -p $DIR/usr/share/rainloop;
-mkdir -m 0755 -p $DIR/var;
-mkdir -m 0755 -p $DIR/var/lib;
-
-#Move files into package directory
-mv rainloop $DIR/usr/share/rainloop/rainloop;
-mv index.php $DIR/usr/share/rainloop/index.php;
-mv data $DIR/var/lib/rainloop;
-
-#Update settings for Debian package
-sed -i "s/\$sCustomDataPath = '';/\$sCustomDataPath = '\/var\/lib\/rainloop';/" $DIR/usr/share/rainloop/rainloop/v/$VERSION/include.php
-
-#Set up Debian packaging tools
-cd $DIR;
-mkdir -m 0755 DEBIAN;
-
-#Create Debian packging control file
-cat >> DEBIAN/control <<-EOF
- Package: rainloop
- Version: $VERSION
- Section: web
- Priority: optional
- Architecture: all
- Depends: php5-fpm (>= 5.4), php5-curl, php5-json
- Maintainer: Rainloop <support at rainloop.net>
- Installed-Size: 20330
- Description: Rainloop Webmail
- A modern PHP webmail client.
-EOF
-
-#Create Debian packaging post-install script
-cat >> DEBIAN/postinst <<-EOF
- #!/bin/sh
- chown -R www-data:www-data /var/lib/rainloop
-EOF
-chmod +x DEBIAN/postinst;
-
-#Build Debian package
-cd ..;
-fakeroot dpkg-deb -b $DIR;
-
-#Clean up
-mv $DIR.deb ..;
-cd ..;
-rm -rf rainloop-deb-build;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/rainloop.git
More information about the Pkg-javascript-commits
mailing list