1
0
forked from pool/roundcubemail
roundcubemail/roundcubemail.spec

361 lines
14 KiB
RPMSpec
Raw Normal View History

#
# spec file for package roundcubemail
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Accepting request 644894 from home:lrupp:branches:server:php:applications - Upgrade to version 1.3.8: * Fix PHP warnings on dummy QUOTA responses in Courier-IMAP 4.17.1 (#6374) * Fix so fallback from BINARY to BODY FETCH is used also on [PARSE] errors in dovecot 2.3 (#6383) * Enigma: Fix deleting keys with authentication subkeys (#6381) * Fix invalid regular expressions that throw warnings on PHP 7.3 (#6398) * Fix so Classic skin splitter does not escape out of window (#6397) * Fix XSS issue in handling invalid style tag content (#6410) * Fix compatibility with MySQL 8 - error on 'system' table use * Managesieve: Fix bug where show_real_foldernames setting wasn't respected (#6422) * New_user_identity: Fix %fu/%u vars substitution in user specific LDAP params (#6419) * Fix support for "allow-from " in x_frame_options config option (#6449) * Fix bug where valid content between HTML comments could have been skipped in some cases (#6464) * Fix multiple VCard field search (#6466) * Fix session issue on long running requests (#6470) - add files with .log entry to logrotate config - enhance apache configuration by: + disable mbstring function overload (http://bugs.php.net/bug.php?id=30766) + do not allow to see README*, INSTALL, LICENSE or CHANGELOG files + set additional headers: ++ Content-Security-Policy: ask browsers to not set the referrer ++ Cache-Control: ask not to cache the content ++ Strict-Transport-Security: set HSTS rules for SSL traffic ++ X-XSS-Protection: configure built in reflective XSS protection - adjust README.openSUSE: + db.inc.php is not used any longer + flush privileges after creating/changing users in mysql - use %%license macro on newer distributions OBS-URL: https://build.opensuse.org/request/show/644894 OBS-URL: https://build.opensuse.org/package/show/server:php:applications/roundcubemail?expand=0&rev=121
2018-10-26 16:42:37 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define roundcubepath %{apache_serverroot}/%{name}
%define roundcubeconfigpath %{_sysconfdir}/%{name}
%define php_name %(php -r "print 'php' . PHP_MAJOR_VERSION;")
Name: roundcubemail
Version: 1.4.11
Release: 0
Summary: A browser-based multilingual IMAP client
License: GPL-3.0-or-later AND GPL-2.0-only AND BSD-3-Clause
Group: Productivity/Networking/Email/Clients
URL: https://www.roundcube.net/
Source0: https://github.com/roundcube/%{name}/releases/download/%{version}/%{name}-%{version}-complete.tar.gz
Source1: %{name}-rpmlintrc
Source2: %{name}-httpd.conf
Source3: %{name}-httpd.inc
Source4: README.openSUSE
Source5: %{name}.logrotate
Source6: https://roundcube.net/download/pubkey.asc#/%{name}.keyring
Source7: https://github.com/roundcube/%{name}/releases/download/%{version}/%{name}-%{version}-complete.tar.gz.asc
Source8: robots.txt
# PATCH-FIX-OPENSUSE roundcubemail-config_dir.patch -- use the general config directory /etc
Patch0: %{name}-config_dir.patch
BuildRequires: apache-rpm-macros
BuildRequires: apache2
BuildRequires: php-cli
Requires: %{php_name}-dom
Requires: %{php_name}-exif
Requires: %{php_name}-gettext
Requires: %{php_name}-iconv
Requires: %{php_name}-json
Requires: %{php_name}-mbstring
Requires: %{php_name}-openssl
Requires: apache2-mod_%{php_name}
## Requires: for upstream dep package
Requires: %{php_name}-sockets
Requires: php-pear-Auth_SASL >= 1.0.6
Requires: php-pear-MDB2_Driver_mysqli
Requires: php-pear-Mail_Mime >= 1.10.0
Requires: php-pear-Net_IDNA2 >= 0.1.1
Requires: php-pear-Net_LDAP2
Requires: php-pear-Net_SMTP >= 1.8.1
Requires: php-pear-Net_Sieve >= 1.4.3
Requires: php-pear-Net_Socket >= 1.0.12
Requires: (%{php_name}-mysql or %{php_name}-pgsql)
Recommends: logrotate
Recommends: %{php_name}-fileinfo
Recommends: %{php_name}-intl
Recommends: %{php_name}-imagick
Recommends: php-pear-Crypt_GPG >= 1.6.3
Recommends: %{php_name}-zip
Suggests: %{php_name}-mysql
Conflicts: roundcube-framework
Provides: roundcube_framework = %{version}
BuildArch: noarch
%if 0%{?suse_version} >= 1100
BuildRequires: fdupes
%endif
%description
Roundcube Webmail is a browser-based multilingual IMAP client with an
application-like user interface. It provides MIME support, address
book, folder manipulation, message searching and spell checking.
Roundcube Webmail is written in PHP and requires a MySQL database.
The user interface is skinnable using XHTML and CSS 2.
%prep
- Update to 1.1.0 New features: - Allow searching across multiple folders - Improved support for screen readers and assistive technology using WCAG 2.0 andWAI ARIA standards - Update to TinyMCE 4.1 to support images in HTML signatures (copy & paste) - Added namespace filter and folder searching in folder manager - New config option to disable UI elements/actions - Stronger password encryption using OpenSSL - Support for the IMAP SPECIAL-USE extension - Support for Oracle as database backend - Manage 3rd party libs with Composer - Secure URLs [1] (disabled by default) Changelog: Make SMTP error log more verbose - include server response and error code Fix download options menu (added by zipdownload plugin) in classic skin (#1490228) Fix blocked.gif image usage with assets_dir set Fix bug where max_group_members was ignored when adding a new contact (#1490214) Hide MDN and DSN options in compose if disabled by admin (#1490221) Fix checks based on window.ActiveXObject in IE > 10 Fix XSS issue in style attribute handling (#1490227) Fix bug where Drafts list wasn't updated on draft-save action in new window (#1490225) Fix so "set as default" option is hidden if identities_level > 1 (#1490226) Fix bug where search was reset after returning from compose visited for reply Fix javascript error in "IE 8.0/Tablet PC" browser (#1490210) Fix bug where Reply-To address was ignored on reply to messages sent by self (#1490233) Fix bug where empty fieldmap config entries caused empty results of ldap search (#1490229) Fix bug where drafts list wasn't refreshed after draft message was sent from another window (#1490238) Fix keyboard navigation and css in datepicker widget across many Firefox versions Fix false warning when opening attached text/plain files (#1490241) OBS-URL: https://build.opensuse.org/package/show/server:php:applications/roundcubemail?expand=0&rev=91
2015-02-11 19:30:48 +01:00
%setup -q
%patch0 -p1
cp %{SOURCE4} .
# remove cruft from source archive:
# .arcconfig => file for phabricator.uri
# .gitignore => git config file
# .php_cs.dist => PhpCsFixer
# .scrutinizer.yml => PHP mess detector
# .travis.yml => Travis CI descriptions
for file in .arcconfig .gitignore .php_cs.dist .scrutinizer.yml .travis.yml ; do
find . -name "$file" -delete
done
# remove php documentor script
rm vendor/pear/net_smtp/phpdoc.sh
# remove 0-byte files
find . -size 0 -delete
# no need to check .htaccess each time, the apache config takes care of the restrictions
find . -name ".htaccess" -delete
# remove travis files
find vendor/ -name ".travis.yml" -delete
# remove obscure sub-directory
#rm -rf roundcubemail-git composer.json.rej
# remove mssql scripts (not needed on openSUSE)
rm -rf \
SQL/mssql/ \
SQL/mssql.*.sql
# remove shebang from chpass-wrapper
sed -i '1d' plugins/password/helpers/chpass-wrapper.py
# remove INSTALL doc
rm INSTALL
# fix interpreter for shell scripts
sed -i 's|/usr/bin/env php|%{_bindir}/php|' \
bin/*.sh \
vendor/pear/crypt_gpg/scripts/crypt-gpg-pinentry \
vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh \
plugins/enigma/bin/import_keys.sh
%build
%install
# install roundcubemail.logrotate
install -d -m 0755 %{buildroot}/%{_sysconfdir}/logrotate.d
install %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
# extract roundcube-framework
install -d -m 0755 %{buildroot}/%{_datadir}/%{php_name}
mv program/lib/Roundcube %{buildroot}%{_datadir}/%{php_name}/Roundcube
# install roundcubemail
install -d -m 0755 %{buildroot}/%{roundcubepath}
cp -a * %{buildroot}%{roundcubepath}/
cp %{SOURCE8} %{buildroot}%{roundcubepath}/
ln -s %{roundcubepath}/installer %{buildroot}/%{roundcubepath}/public_html/installer
# install config
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp config/* %{buildroot}%{roundcubeconfigpath}/
install %{buildroot}/%{roundcubeconfigpath}/config.inc.php.sample %{buildroot}/%{roundcubeconfigpath}/config.inc.php
rm -rf %{buildroot}/%{roundcubepath}/config
ln -s %{roundcubeconfigpath} %{buildroot}/%{roundcubepath}/config
# logs + temp go into /var/
rm -rf %{buildroot}/%{roundcubepath}/logs \
%{buildroot}%{roundcubepath}/temp
install -d %{buildroot}/%{_localstatedir}/log/%{name} \
%{buildroot}%{_localstatedir}/lib/%{name}
ln -s %{_localstatedir}/log/%{name}/ %{buildroot}/%{roundcubepath}/logs
ln -s %{_localstatedir}/lib/%{name}/ %{buildroot}/%{roundcubepath}/temp
# move some plugin configs to /etc/roundcubemail
for PLUGIN in acl managesieve password; do
if [ -f %{buildroot}/%{roundcubepath}/plugins/$PLUGIN/config.inc.php.dist ]; then
mv %{buildroot}%{roundcubepath}/plugins/$PLUGIN/config.inc.php.dist %{buildroot}%{roundcubeconfigpath}/$PLUGIN.inc.php
ln -s %{roundcubeconfigpath}/$PLUGIN.inc.php %{buildroot}/%{roundcubepath}/plugins/$PLUGIN/config.inc.php
fi
done
# skins have some configurable files in their directories
mkdir -p %{buildroot}%{roundcubeconfigpath}/skins/elastic/styles
for file in _styles.less _variables.less ; do
mv %{buildroot}%{roundcubepath}/skins/elastic/styles/$file %{buildroot}%{roundcubeconfigpath}/skins/elastic/styles/
ln -s %{roundcubeconfigpath}/skins/elastic/styles/$file %{buildroot}%{roundcubepath}/skins/elastic/styles/
done
# install httpd.conf file and adapt the configuration
install -D -m0644 %{SOURCE3} %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.inc
# fix paths in http config
sed -e "s#__ROUNDCUBEPATH__#%{roundcubepath}#g" \
-e "s,@apache_sysconfdir@,%{apache_sysconfdir},g" \
-e "s,@name@,%{name},g" \
%{SOURCE2} > %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf
# install docs
install -d -m 0755 %{buildroot}/%{_defaultdocdir}/%{name}
%if 0%{?suse_version} >= 1500
TXT="CHANGELOG UPGRADING README.md README.openSUSE SQL"
rm %{buildroot}%{roundcubepath}/LICENSE
%else
TXT="CHANGELOG UPGRADING README.md README.openSUSE SQL LICENSE"
%endif
for i in $TXT; do
mv -v %{buildroot}%{roundcubepath}/$i %{buildroot}%{_defaultdocdir}/%{name}/
done
# move Readme files to docdir
for file in LICENSE README README.rst *.md ; do
for i in $(find %{buildroot}%{roundcubepath}/vendor -type f -name "$file"); do
BASEDIR=$(echo "$i" | sed -e "s|%{buildroot}%{roundcubepath}/vendor||g")
BASEDIR=$(dirname "$BASEDIR")
mkdir -p "%{buildroot}%{_defaultdocdir}/%{name}/$BASEDIR"
mv "$i" "%{buildroot}%{_defaultdocdir}/%{name}/$BASEDIR"
done
done
# create a link for SQL
ln -s %{_defaultdocdir}/%{name}/SQL %{buildroot}/%{roundcubepath}/SQL
# Make ghost files
mkdir %{buildroot}%{roundcubepath}/migrated
mkdir %{buildroot}%{roundcubepath}/migration
# fdupes
%if 0%{?suse_version} >= 1100
%fdupes %{buildroot}%{roundcubepath}
%fdupes %{buildroot}%{_defaultdocdir}/%{name}
%endif
%pre
# backup logs, temp and config for migration
if [ ! -h %{roundcubepath}/logs ] && [ -d %{roundcubepath}/logs ]; then
mkdir -p %{roundcubepath}/migration
mv %{roundcubepath}/logs %{roundcubepath}/migration/.
fi
if [ ! -h %{roundcubepath}/temp ] && [ -d %{roundcubepath}/temp ]; then
mkdir -p %{roundcubepath}/migration
mv %{roundcubepath}/temp %{roundcubepath}/migration/.
fi
if [ ! -h %{roundcubepath}/SQL ] && [ -d %{roundcubepath}/SQL ]; then
mkdir -p %{roundcubepath}/migration
mv %{roundcubepath}/SQL %{roundcubepath}/migration/.
fi
for PLUGIN in acl managesieve password; do
if [ ! -h %{roundcubepath}/plugins/$PLUGIN/config.inc.php ] && [ -f %{roundcubepath}/plugins/$PLUGIN/config.inc.php ]; then
mv %{roundcubepath}/plugins/$PLUGIN/config.inc.php %{roundcubepath}/migration/$PLUGIN.inc.php
fi
done
%post
# replace default des string in config file for better security
makedesstr() {
local chars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
local max=${#chars}
for i in $(seq 1 24); do
echo "$chars" | dd bs=1 skip=$(($(od -An -d -N2 /dev/urandom) % $max)) count=1 2>/dev/null
done
echo
}
sed -i "s/rcmail-\!24ByteDESkey\*Str/`makedesstr`/" %{roundcubeconfigpath}/defaults.inc.php || : &> /dev/null
# Update ?
if [ ${1:-0} -eq 1 ]; then
if [ -x %{_sbindir}/a2enmod ]; then
# enable required apache modules
%if 0%{?suse_version} > 01500
if ! grep -q php %{_sysconfdir}/sysconfig/apache2 1>&2 2>/dev/null; then
%{_sbindir}/a2enmod -q %{php_name} || %{_sbindir}/a2enmod %{php_name}
fi
%endif
for module in alias brotli deflate expires filter headers rewrite setenvif version ; do
%{_sbindir}/a2enmod -q $module || %{_sbindir}/a2enmod $module
done
fi
fi
# restore backed up logs, temp and config
if [ -h %{roundcubepath}/logs ] && [ -d %{roundcubepath}/migration/logs ]; then
mkdir -p %{roundcubepath}/migrated
cp %{roundcubepath}/migration/logs/* %{roundcubepath}/logs/.
mv %{roundcubepath}/migration/logs %{roundcubepath}/migrated/.
fi
if [ -h %{roundcubepath}/temp ] && [ -d %{roundcubepath}/migration/temp ]; then
mkdir -p %{roundcubepath}/migrated
cp %{roundcubepath}/migration/temp/* %{roundcubepath}/temp/.
mv %{roundcubepath}/migration/temp %{roundcubepath}/migrated/.
fi
if [ -h %{roundcubepath}/SQL ] && [ -d %{roundcubepath}/migration/SQL ]; then
rm -r %{roundcubepath}/migration/SQL
fi
for PLUGIN in acl managesieve password; do
if [ -f %{roundcubepath}/migration/$PLUGIN.inc.php ] && [ -h %{roundcubepath}/plugins/$PLUGIN/config.inc.php ]; then
cp %{roundcubepath}/migration/$PLUGIN.inc.php %{roundcubeconfigpath}/.
mv %{roundcubepath}/migration/$PLUGIN.inc.php %{roundcubepath}/migrated/$PLUGIN.inc.php
fi
done
for MIGDIR in migration migrated; do
if [ -d %{roundcubepath}/$MIGDIR ]; then
find %{roundcubepath}/$MIGDIR -empty -delete
fi
if [ -d %{roundcubepath}/$MIGDIR ]; then
echo "Found %{roundcubepath}/$MIGDIR! Make sure you delete this folder after checking the migration!"
fi
done
# update/make new config
if [ ! -f %{roundcubeconfigpath}/config.inc.php ]; then
if [ -f %{roundcubeconfigpath}/main.inc.php ] && [ -f %{roundcubeconfigpath}/db.inc.php ]; then
%{roundcubepath}/bin/update.sh \
--version '?' \
--accept
else
cp %{roundcubeconfigpath}/config.inc.php.sample %{roundcubeconfigpath}/config.inc.php
fi
fi
exit 0
%files
%defattr(0644, root, root,0755)
%doc CHANGELOG
%if 0%{?suse_version} >= 1500
%license LICENSE
%else
%doc LICENSE
%endif
%doc README.md
%doc README.openSUSE
%doc UPGRADING
%doc SQL/
%doc %{_defaultdocdir}/%{name}/*
%dir %{roundcubepath}
%dir %{roundcubeconfigpath}
%dir %{roundcubeconfigpath}/skins
%dir %{roundcubeconfigpath}/skins/elastic
%dir %{roundcubeconfigpath}/skins/elastic/styles/
%ghost %config(noreplace) %{roundcubeconfigpath}/config.inc.php
%config(noreplace) %{roundcubeconfigpath}/acl.inc.php
%config(noreplace) %{roundcubeconfigpath}/managesieve.inc.php
%config(noreplace) %{roundcubeconfigpath}/password.inc.php
%config %{roundcubeconfigpath}/config.inc.php.sample
%config %{roundcubeconfigpath}/defaults.inc.php
%config %{roundcubeconfigpath}/mimetypes.php
%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf
%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.inc
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{roundcubeconfigpath}/skins/elastic/styles/_styles.less
%config(noreplace) %{roundcubeconfigpath}/skins/elastic/styles/_variables.less
%{roundcubepath}/composer.json-dist
%{roundcubepath}/composer.json
%{roundcubepath}/composer.lock
%{roundcubepath}/config
%{roundcubepath}/index.php
%{roundcubepath}/robots.txt
%dir %{roundcubepath}/bin
%attr(0755,root,root) %{roundcubepath}/bin/*.sh
%attr(0755,root,root) %{roundcubepath}/vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh
%attr(0755,root,root) %{roundcubepath}/plugins/password/helpers/change_ldap_pass.pl
%attr(0755,root,root) %{roundcubepath}/vendor/pear/crypt_gpg/scripts/crypt-gpg-pinentry
%{roundcubepath}/installer/
%{roundcubepath}/logs
%ghost %{roundcubepath}/migrated/
%ghost %{roundcubepath}/migration/
- Update to 1.2.2 [boo#1001856] - Enigma: Add possibility to configure gpg-agent binary location (enigma_pgp_agent) - Enigma: Fix signature verification with some IMAP servers, e.g. Gmail, DBMail (#5371) - Enigma: Make recipient key searches case-insensitive (#5434) - Fix regression in resizing JPEG images with Imagick (#5376) - Managesieve: Fix parsing of vacation date-time with non-default date_format (#5372) - Use SymLinksIfOwnerMatch in .htaccess instead of FollowSymLinks disabled on some hosts for security reasons (#5370) - Wash position:fixed style in HTML mail for better security (#5264) - Fix bug where memcache_debug didn't work for session operations - Fix bug where Message-ID domain part was tied to username instead of current identity (#5385) - Fix bug where blocked.gif couldn't be attached to reply/forward with insecure content - Fix E_DEPRECATED warning when using Auth_SASL::factory() (#5401) - Fix bug where names of downloaded files could be malformed when derived from the message subject (#5404) - Fix so "All" messages selection is resetted on search reset (#5413) - Fix bug where folder creation could fail if personal namespace contained more than one entry (#5403) - Fix error causing empty INBOX listing in Firefox when using an URL with user:password specified (#5400) - Fix PHP warning when handling shared namespace with empty prefix (#5420) - Fix so folders list is scrolled to the selected folder on page load (#5424) - Fix so when moving to Trash we make sure the folder exists (#5192) - Fix displaying size of attachments with zero size - Fix so "Action disabled" error uses more appropriate 404 code (#5440) OBS-URL: https://build.opensuse.org/package/show/server:php:applications/roundcubemail?expand=0&rev=104
2016-10-05 13:21:28 +02:00
%{roundcubepath}/public_html/
%{roundcubepath}/plugins/
%{roundcubepath}/program/
%{roundcubepath}/skins/
%{roundcubepath}/SQL
%{roundcubepath}/temp
%{roundcubepath}/vendor/
%{_datadir}/%{php_name}/Roundcube
%attr(-, wwwrun, root) %{_localstatedir}/log/%{name}
%attr(-, wwwrun, root) %{_localstatedir}/lib/%{name}
%changelog