File roundcubemail.spec of Package roundcubemail-selfcontained

# Needed for opensuse build system
%if 0%{?opensuse_bs}
#!BuildIgnore:  boa
#!BuildIgnore:  cherokee
#!BuildIgnore:  nginx
#!BuildIgnore:  httpd-itk
#!BuildIgnore:  lighttpd
#!BuildIgnore:  thttpd

#!BuildIgnore:  fedora-logos-httpd

#!BuildIgnore:  php-mysql
%endif

%global bootstrap 0

%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}

# Needed to reload the webserver if APC is installed/enabled.
%if 0%{?suse_version} < 1 && 0%{?fedora} < 1 && 0%{?rhel} < 7
%global with_systemd 0
%else
%global with_systemd 1
%endif

%if 0%{?suse_version}
%global httpd_group www
%global httpd_name apache2
%global httpd_user wwwrun
%else
%if 0%{?plesk}
%global httpd_group roundcube_sysgroup
%global httpd_name httpd
%global httpd_user roundcube_sysuser
%else
%global httpd_group apache
%global httpd_name httpd
%global httpd_user apache
%endif
%endif

%global _ap_sysconfdir %{_sysconfdir}/%{httpd_name}

# Paths. Do not include trailing slash
%global datadir %{_datadir}/roundcubemail
%global plugindir %{datadir}/plugins
%global confdir %{_sysconfdir}/roundcubemail
%global logdir /var/log/roundcubemail
%global tmpdir /var/lib/roundcubemail

%global rc_version 1.5
%global plugin_version 3.5.11
%global skin_version 0.5.0
#%%global rc_rel_suffix rc2.12
%global dot_rel_suffix %{?rc_rel_suffix:.%{rc_rel_suffix}}
%global dash_rel_suffix %{?rc_rel_suffix:-%{rc_rel_suffix}}
%global basedir %{name}-%{rc_version}%{?dash_rel_suffix}

Name:           roundcubemail
Version: 1.5.8.5

Release:        4%{?dot_rel_suffix}%{?dist}

Summary:        Roundcube Webmail is a browser-based multilingual IMAP client

Group:          Applications/System
License:        GPLv2
URL:            http://www.roundcube.net

Source0:        roundcubemail-%{rc_version}.tar.gz

Source20:       roundcubemail.conf
Source21:       roundcubemail.logrotate

Source100:      plesk.config.inc.php
Source101:      plesk.managesieve.inc.php
Source102:      plesk.password.inc.php
Source103:      plesk.calendar.inc.php
Source104:      plesk.kolab_addressbook.inc.php
Source105:      plesk.kolab_chat.inc.php
Source106:      plesk.kolab_folders.inc.php
Source107:      plesk.libkolab.inc.php
Source108:      plesk.acl.inc.php
Source109:      plesk.tasklist.inc.php

Source200:      2017111400.sql

Patch201:       default-configuration.patch
Patch202:       roundcubemail-1.4-beta86-plugin-enigma-homedir.patch
Patch203:       0001-On-mysql-5.6-191-bytes-length-is-the-best-we-can-do-.patch

BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)

%if 0%{?suse_version}
Requires:       http_daemon
Requires:       php >= 5.5
Recommends:     mod_php_any
%else
Requires:       webserver
%if 0%{?plesk} > 0 && 0%{?rhel} == 7
# On Plesk we can afford to build with an incompatible php version because we have the plesk supplied php versions
Requires:       php-common
Requires:       plesk-php74
%else
Requires:       php-common >= 5.5
%endif
%endif

%if 0%{?rhel} > 7 ||0%{?fedora}
# to avoid on OBS, for packages depending on roundcubemail:
# have choice for webserver needed by roundcubemail: lighttpd httpd nginx
Requires:       httpd
%endif

Requires:       php-gd
Requires:       php-mbstring
Requires:       php-pear >= 1.9.0
Requires:       php-xml
Requires:       php-intl
%if 0%{?rhel} > 7
Requires:       php-json
%if 0%{?plesk} < 1
Requires:       php-ldap
%endif
%endif

%if 0%{?rhel} <= 7
#FIXME keep using mysqlnd, but somehow upgrade and remove the existing roundcube packages
Requires:       php-mysql
%else
Requires:       php-mysqlnd
%endif

Obsoletes:      %{name}-core < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-core-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl-skin-elastic < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl-skin-elastic-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-acl-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-archive < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-archive-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-calendar <= %{plugin_version}
Obsoletes:      %{name}-plugin-calendar-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-calendar-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-calendar-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-contextmenu <= %{plugin_version}
Obsoletes:      %{name}-plugin-filesystem_attachments < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-filesystem_attachments-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui-skin-elastic < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui-skin-elastic-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-jqueryui-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-kolab_activesync <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_activesync-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_activesync-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_activesync-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_addressbook <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_addressbook-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_addressbook-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_addressbook-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_chat <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_chat-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_chat-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_chat-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_config <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_config-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_delegation <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_delegation-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_files <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_files-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_files-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_files-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_folders <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_folders-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_notes <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_notes-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_notes-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_notes-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_tags <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_tags-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_tags-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-kolab_tags-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-libcalendaring <= %{plugin_version}
Obsoletes:      %{name}-plugin-libcalendaring-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-libkolab <= %{plugin_version}
Obsoletes:      %{name}-plugin-libkolab-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-libkolab-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-libkolab-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-managesieve < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-managesieve-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-managesieve-skin-elastic < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-managesieve-skin-elastic-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-managesieve-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-managesieve-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-markasjunk < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-markasjunk-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-markasjunk-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-markasjunk-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-newmail_notifier < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-newmail_notifier-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-odfviewer <= %{plugin_version}
Obsoletes:      %{name}-plugin-odfviewer-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-password < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-password-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-pdfviewer <= %{plugin_version}
Obsoletes:      %{name}-plugin-pdfviewer-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-tasklist <= %{plugin_version}
Obsoletes:      %{name}-plugin-tasklist-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-tasklist-skin-elastic <= %{plugin_version}
Obsoletes:      %{name}-plugin-tasklist-skin-elastic-assets <= %{plugin_version}
Obsoletes:      %{name}-plugin-zipdownload < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-zipdownload-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-zipdownload-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-plugin-zipdownload-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-skin-elastic < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-skin-elastic-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-skin-larry < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-skin-larry-assets < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:      %{name}-skin-plesk <= %{skin_version}
Obsoletes:      %{name}-skin-plesk-assets <= %{skin_version}
Obsoletes:      %{name}-skin-plesk-core <= %{skin_version}
Obsoletes:      %{name}-skin-plesk-larry-assets <= %{skin_version}
Obsoletes:      %{name}-skin-plesk-larry-core <= %{skin_version}

Provides: %{name}-core = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}(core) = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-plugins-kolab = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_auth = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_folder = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_libcalendaring = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_libkolab = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-calendar = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_activesync = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_addressbook = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_config = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_delegation = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_files = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_folders = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_notes = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-kolab_tags = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-odfviewer = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-pdfviewer = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-tasklist = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-libcalendaring = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-libkolab = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-acl = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-archive = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-attachment_reminder = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-emoticons = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-enigma = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-hide_blockquote = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-jqueryui = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}(plugin-jqueryui) = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-plugin-kolab_chat = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-logon_page = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-managesieve = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-markasjunk = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-newmail_notifier = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-password = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-redundant_attachments = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-zipdownload = %{?epoch:%{epoch}:}%{plugin_version}-%{release}
Provides: %{name}-plugin-contextmenu = %{?epoch:%{epoch}:}%{plugin_version}-%{release}

Provides: %{name}(skin-elastic) = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-skin-elastic = %{?epoch:%{epoch}:}%{version}-%{release}

%if 0%{?plesk} > 0
Provides: %{name}(skin-plesk) = %{?epoch:%{epoch}:}%{skin_version}-%{release}
Provides: %{name}-skin-plesk = %{?epoch:%{epoch}:}%{skin_version}-%{release}
Provides: %{name}-skin-plesk-larry = %{?epoch:%{epoch}:}%{skin_version}-%{release}
Provides: %{name}(skin-plesk-larry) = %{?epoch:%{epoch}:}%{skin_version}-%{release}
Provides: %{name}(skin-plesk-larry-assets) = %{?epoch:%{epoch}:}%{skin_version}-%{release}
%else
Provides: %{name}-skin-kolab = %{?epoch:%{epoch}:}%{skin_version}-%{release}
%endif

%description
Roundcube Webmail for Kolab

%prep
%setup -q -c "%{basedir}"

pushd %{basedir}

cp -vf "%{SOURCE200}" SQL/mysql/
rm -rvf SQL/mysql/2016081200.sql

rm -rf temp/js_cache/

find . -type d -name "classic" | while read dir; do
    rm -rvf ${dir}
done

%if 0%{?plesk} > 0
cp -vf %{SOURCE100} config/config.inc.php.sample
cp -vf %{SOURCE101} plugins/managesieve/config.inc.php.dist
cp -vf %{SOURCE102} plugins/password/config.inc.php.dist
cp -vf %{SOURCE103} plugins/calendar/config.inc.php.dist
cp -vf %{SOURCE104} plugins/kolab_addressbook/config.inc.php.dist
cp -vf %{SOURCE105} plugins/kolab_chat/config.inc.php.dist
cp -vf %{SOURCE106} plugins/kolab_folders/config.inc.php.dist
cp -vf %{SOURCE107} plugins/libkolab/config.inc.php.dist
cp -vf %{SOURCE108} plugins/acl/config.inc.php.dist
cp -vf %{SOURCE109} plugins/tasklist/config.inc.php.dist
rm -rvf skins/kolab/ plugins/libkolab/skins/kolab/ public_html/assets/skins/kolab/
%else
rm -rvf skins/plesk/ plugins/libkolab/skins/plesk/ public_html/assets/skins/plesk/
%endif

#FIXME doesn't apply?
#%patch201 -p1
%if 0%{?plesk} < 1
%patch202 -p1
%endif

%if 0%{?plesk} > 0 && 0%{?rhel} == 7
%patch203 -p1
%endif

# Remove the results of patching when there's an incidental offset
find . -type f -name "*.orig" | while read file; do
    rm -rvf ${file}
done

# Remove hidden files and directories
find . -type f -name ".*" | while read file; do
    rm -rvf ${file}
done

find . -type d -name ".*" ! -name "." ! -name ".." | while read dir; do
    rm -rvf ${dir}
done

while [ ! -z "$(find . -type d -empty)" ]; do
    find . -type d -empty | while read dir; do
        rm -rvf ${dir}
    done
done

# Remove any reference to sqlite in config file so people don't
# mistakely assume it works
%{__sed} -i '/sqlite/d' config/defaults.inc.php
%{__sed} -i 's/\r//' SQL/mssql.initial.sql

# Remove password plugin helpers in Python
rm -rf plugins/password/helpers/chpass-wrapper.py
popd

cp -a %{basedir}/{CHANGELOG.md,LICENSE,README.md} .

rm -rf %{basedir}/plugins/jqueryui/themes/redmond


%build

%install
%{__rm} -rf %{buildroot}

%{__install} -d \
%if 0%{?plesk} < 1
    %{buildroot}%{_ap_sysconfdir}/conf.d \
%endif
    %{buildroot}%{_sysconfdir}/logrotate.d \
    %{buildroot}%{confdir} \
    %{buildroot}%{datadir}/public_html \
    %{buildroot}%{logdir} \
    %{buildroot}%{tmpdir}/plugins \
    %{buildroot}%{tmpdir}/plugins/enigma

pushd %{basedir}

%if 0%{?plesk} < 1
%{__install} -pm 644 %SOURCE20 %{buildroot}%{_ap_sysconfdir}/conf.d
%endif

%{__install} -pm 644 %SOURCE21 %{buildroot}%{_sysconfdir}/logrotate.d/roundcubemail

sed -i -e 's/apache apache/%{httpd_user} %{httpd_group}/g' \
    %{buildroot}%{_sysconfdir}/logrotate.d/roundcubemail

# use dist files as config files
%{__install} -pm 644 config/config.inc.php.sample %{buildroot}%{confdir}/config.inc.php
%{__install} -pm 644 config/defaults.inc.php %{buildroot}%{confdir}/defaults.inc.php
%{__install} -pm 644 config/mimetypes.php %{buildroot}%{confdir}/mimetypes.php

pushd %{buildroot}%{datadir}
%{__ln_s} ../../..%{confdir} config
%{__ln_s} ../../..%{logdir} logs
%{__ln_s} ../../..%{tmpdir} temp
popd

# Utilities
%{__cp} -a bin/ %{buildroot}%{datadir}/bin/
# Some scripts fail to validate due to the python version (we don't need them anyways)
%{__rm} -rf vendor/sabre/dav/bin
%{__cp} -a vendor/ %{buildroot}%{datadir}/vendor/

%{__cp} -a skins/ %{buildroot}%{datadir}/skins/
%{__cp} -a plugins/ %{buildroot}%{datadir}/plugins/

# The core of the program
%{__install} -pm 644 index.php %{buildroot}%{datadir}/index.php
%{__install} -d %{buildroot}%{datadir}/program/
%{__cp} -a program/include/ %{buildroot}%{datadir}/program/include/
%{__cp} -a program/lib/ %{buildroot}%{datadir}/program/lib/
%{__cp} -a program/localization/ %{buildroot}%{datadir}/program/localization/
%{__cp} -a program/actions/ %{buildroot}%{datadir}/program/actions/
%{__install} -pm 644 public_html/index.php %{buildroot}%{datadir}/public_html/index.php
popd

if [ -d "%{buildroot}%{datadir}/public_html/" ]; then
    asset_path="%{buildroot}%{datadir}/public_html/assets"
else
    asset_path="%{buildroot}%{datadir}/assets"
fi

%{__mkdir_p} ${asset_path}

orig_dir="%{basedir}"
asset_dir="%{basedir}$(echo ${asset_path} | %{__sed} -e 's|%{buildroot}%{datadir}||g')"

# Remove the skins and installer directories from ${orig_dir}
#TODO?
#%{__rm} -rf ${orig_dir}/{installer,skins}
%{__rm} -rf ${orig_dir}/{installer}

echo "Asset path: ${asset_path}"
echo "Original directory for core: ${orig_dir}"
echo "Asset directory for core: ${asset_dir}"


# This now just copies everything over to the assets directory in the build dir (needs to be installed still)
for file in $(find ${orig_dir} -type f \
        -name "*.css" -o \
        -name "*.js" -o \
        -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|${orig_dir}|${asset_dir}|g"))
    %{__mkdir_p} ${asset_loc}
    %{__cp} -av ${file} ${asset_loc}/$(basename ${file})
done

%{__cp} -a ${orig_dir}/public_html/plugins/ ${asset_path}/plugins/
%{__cp} -a ${orig_dir}/public_html/skins/ ${asset_path}/skins/

# Install the js assets without the symlinks
%{__install} -d ${asset_path}/program/
%{__install} -d ${asset_path}/program/js
%{__install} -d ${asset_path}/program/resources
%{__cp} -LR ${orig_dir}/public_html/program/js ${asset_path}/program/
%{__cp} -LR ${orig_dir}/public_html/program/resources ${asset_path}/program/

# Install plugin configs
for plugin in $(find %{buildroot}%{plugindir}/ -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sort); do
    if [ -f "%{buildroot}%{plugindir}/${plugin}/config.inc.php.dist" ]; then
        pushd %{buildroot}%{plugindir}/${plugin}
        %{__mv} config.inc.php.dist %{buildroot}%{confdir}/${plugin}.inc.php
        rm -f config.inc.php
        ln -s ../../../../..%{confdir}/${plugin}.inc.php config.inc.php
        popd
    fi
done

# Symlink for elastic images
pushd %{buildroot}%{datadir}/skins/elastic
%{__rm} -rvf images
ln -s ../../public_html/assets/skins/elastic/images images
popd

# Provide the rpm state directory
%{__mkdir_p} %{buildroot}/%{_localstatedir}/lib/rpm-state/roundcubemail/


%check
pushd %{basedir}/tests
phpunit --debug || :
popd

%clean
%{__rm} -rf %{buildroot}

%pre
if [ -f "%{_localstatedir}/lib/rpm-state/roundcubemail/httpd.restarted" ]; then
    %{__rm} -f "%{_localstatedir}/lib/rpm-state/roundcubemail/httpd.restarted"
fi

if [ -L %{plugindir}/enigma/home -a ! -d %{plugindir}/enigma/home ]; then
    %{__rm} -rf %{plugindir}/enigma/home >/dev/null 2>&1 || :
fi

%pretrans -p <lua>
-- Required because directory is replaced with symlink per
-- https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
path = "/usr/share/roundcubemail/skins/elastic/images"
st = posix.stat(path)
if st and st.type == "directory" then
  status = os.rename(path, path .. ".rpmmoved")
  if not status then
    suffix = 0
    while not status do
      suffix = suffix + 1
      status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
    end
    os.rename(path, path .. ".rpmmoved")
  end
end

%posttrans
# replace default des string in config file for better security
function makedesstr () {
    chars=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A
    B C D E F G H I J K L M N O P Q R S T U V W X Y Z)

    max=${#chars[*]}

    for i in `seq 1 24`; do
        let rand=${RANDOM}%%${max}
        str="${str}${chars[$rand]}"
    done
    echo $str
}

find %{logdir} -mindepth 1 -maxdepth 1 -type f -exec chown %{httpd_user}:%{httpd_group} {} \;

%{__sed} -i "s/rcmail-\!24ByteDESkey\*Str/`makedesstr`/" /etc/roundcubemail/defaults.inc.php || : &> /dev/null

%{__sed} -i -r -e "s/.*(\s*define\(\s*'RCMAIL_VERSION'\s*,\s*').*('\);)/\1%{version}-%{release}\2/g" \
    %{datadir}/program/include/iniset.php || :

if [ ! -f %{_localstatedir}/lib/rpm-state/roundcubemail/httpd.restarted ]; then
    if [ -f "%{php_inidir}/apc.ini" -o -f "%{php_inidir}/apcu.ini" ]; then
        if [ ! -z "$(grep ^apc.enabled=1 %{php_inidir}/apc{,u}.ini 2>/dev/null)" ]; then
%if 0%{?with_systemd}
            /bin/systemctl condrestart %{httpd_name}.service
%else
            /sbin/service %{httpd_name} condrestart
%endif
        fi
    fi
    %{__mkdir_p} %{_localstatedir}/lib/rpm-state/roundcubemail/
    touch %{_localstatedir}/lib/rpm-state/roundcubemail/httpd.restarted
fi


if [ -f "/usr/lib/systemd/system/php-fpm.service" ]; then
    /bin/systemctl reload php-fpm.service || :
fi

%if 0%{?plesk} > 0 && 0%{?rhel} == 7
php="/opt/plesk/php/7.4/bin/php"
# Process all sql updates (requires the php-mysqlnd package for the pdo driver for the system php)
${php} %{_datadir}/roundcubemail/bin/updatedb.sh \
    --dir %{_datadir}/doc/roundcubemail-%{version}/SQL/ \
    --package roundcube || :
%else
php="/usr/bin/php"
${php} %{_datadir}/roundcubemail/bin/updatedb.sh \
    --dir %{_datadir}/doc/roundcubemail/SQL/ \
    --package roundcube || :
%endif

${php} %{_datadir}/roundcubemail/bin/updatedb.sh \
    --dir %{_datadir}/roundcubemail/plugins/libkolab/SQL/ \
    --package libkolab || :

${php} %{_datadir}/roundcubemail/bin/updatedb.sh \
    --dir %{_datadir}/roundcubemail/plugins/calendar/drivers/kolab/SQL/ \
    --package calendar-kolab || :

exit 0

%files
%defattr(-,root,root,-)
%doc %{basedir}/LICENSE
%doc %{basedir}/UPGRADING
%doc %{basedir}/SQL

%{_datadir}/%{name}/
%{_sharedstatedir}/%{name}/

%ghost %{_datadir}/%{name}/skins/elastic/images.rpmmoved

%attr(0640,root,root) %{_var}/log/%{name}/

%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/%{name}

%if 0%{?suse_version}
%dir %{_ap_sysconfdir}/
%dir %{_ap_sysconfdir}/conf.d/
%attr(0755,root,%{httpd_group}) %dir %{confdir}
%endif
%if 0%{?plesk} < 1
%config(noreplace) %{_ap_sysconfdir}/conf.d/%{name}.conf
%endif
%attr(0640,root,%{httpd_group}) %config(noreplace) %{confdir}/config.inc.php
%attr(0640,root,%{httpd_group}) %config(noreplace) %{confdir}/defaults.inc.php
%attr(0640,root,%{httpd_group}) %{confdir}/mimetypes.php
%attr(0770,root,%{httpd_group}) %dir %{logdir}
%attr(0770,root,%{httpd_group}) %dir %{tmpdir}
%attr(0770,root,%{httpd_group}) %dir %{tmpdir}/plugins
%attr(0770,root,%{httpd_group}) %dir %{tmpdir}/plugins/enigma
%dir %{_localstatedir}/lib/rpm-state/
%dir %{_localstatedir}/lib/rpm-state/roundcubemail/

%changelog
* Wed Aug 3 2022 Christian Mollekopf <mollekopf@apheleia-it.ch> - 1.5.3-1
- Roundcube 1.5.3
- WOAT support
- PROXY protocol support

* Wed Apr 20 2022 Christian Mollekopf <mollekopf@apheleia-it.ch> - 1.5.2-1
- Roundcube 1.5.2

* Mon Mar  7 2022 Jeroen van Meeuwen <vanmeeuwen@apheleia-it.ch> - 1.4.13-2
- Support passwordless keys

* Tue Nov 30 2021 Christian Mollekopf <mollekopf@apheleia-it.ch> - 1.4.11.20-2
- Selfcontained build

* Wed Sep  1 2021 Jeroen van Meeuwen <vanmeeuwen@apheleia-it.ch> - 1.4.11.20-1
- Check in release 1.4.11.20

* Tue Apr  6 2021 Jeroen van Meeuwen <vanmeeuwen@apheleia-it.ch> - 1.4.11.4-1
- Check in release 1.4.11.4

* Mon Dec 28 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.10-1
- Check in release 1.4.10

* Fri Oct 16 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.9.3-1
- Check in release 1.4.9.3

* Mon Jul  6 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.7-1
- Check in release 1.4.7

* Mon May 11 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.4.14-1
- Check in 14 revisions ahead of upstream 1.4.4 release

* Tue Apr 14 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.3.29-1
- Check in 29 revisions ahead of upstream 1.4.3 release

* Mon Mar  2 2020 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.3.6-1
- Check in 6 revisions ahead of upstream 1.4.3 release

* Wed Dec  4 2019 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.4.1.27-1
- Check in 27 revisions ahead of upstream 1.4.1 release

* Mon Oct  7 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-312.rc2.12
- Check in 12 revisions ahead of upstream 1.4-rc2 release

* Mon Jul  1 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-248.rc1.221
- Check in 221 revisions ahead of the upstream 1.4-rc1 release

* Mon Jun  3 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-246.rc1.167
- Check in 167 revisions ahead of the upstream 1.4-rc1 release

* Mon May 20 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-242.rc1.133
- Fix for context menu

* Wed May 15 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-240.rc1.133
- Check in 133 revisions ahead of the upstream 1.4-rc1 release

* Mon Apr 15 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-236.rc1.65
- Check in 65 revisions ahead of the upstream rc1 release

* Sat Jan 19 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-206.beta206
- Check in 206 revisions ahead of the beta release

* Thu Dec  6 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-151.beta151
- Check in 151 revisions ahead of the beta release

* Thu Nov 22 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-66.beta136
- Check in 136 revisions ahead of the beta release

* Mon Oct 29 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-50.beta95
- Check in 95 revisions ahead of the beta release

* Tue Sep 18 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-49.beta36
- Check in 36 revisions ahead of beta release
- Conditionally include collabora.inc.php per vhost on Plesk

* Mon Aug 27 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-47.beta3
- Promote to beta (3 fixes ahead of upstream)

* Sat Aug 18 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-39.alpha8
- New snapshot
- Set create_default_folders to true on Plesk

* Thu Jul 12 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-38.alpha7
- Fix unread icon
- Use bold font for folders with unread messages
- New skin thumbnail image
- Fix search scope selection

* Tue Jun  5 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-36.alpha6
- Fix toolbars in Safari desktop browser (T110373)

* Thu May 31 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-34.alpha6
- Check in pre-alpha 1.4 release with Elastic skin

* Tue May 22 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-32.alpha5
- Check in pre-alpha 1.4 release with Elastic skin

* Tue May 15 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-31.alpha4
- Check in pre-alpha 1.4 release with Elastic skin

* Mon May 14 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-16.alpha4
- Check in pre-alpha 1.4 release with Elastic skin

* Fri May  4 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-13.alpha3
- Check in pre-alpha 1.4 release with Elastic skin

* Mon Apr 30 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-12.alpha2
- Check in pre-alpha 1.4 release with Elastic skin

* Wed Apr 25 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-9.alpha1
- Check in pre-alpha 1.4 release with Elastic skin

* Tue Apr 10 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.4-8.alpha0
- Check in pre-alpha 1.4 release with Elastic skin

* Thu Apr  5 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.5-1
- Check in 4 revisions ahead of 1.3.5 release

* Thu Mar  8 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.4-3
- Check in 14 revisions ahead of 1.3.4 release

* Wed Feb 28 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.4-2
- Check in 12 revisions ahead of 1.3.4 release

* Sun Feb 11 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.4-1
- Check in upstream 1.3.4 release

* Tue Nov 14 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.3.3-2
- Stop dropping columns

* Thu Nov  9 2017 Timotheus Pokorra <tp@tbits.net> - 1.3.3-1
- Check in upstream 1.3.3 release

* Wed Oct  4 2017 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.1.12-1
- Check in 12 revisions ahead of upstream 1.3.1 release

* Sun Aug 27 2017 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.3.0.41-1
- Check in 41 revisions ahead of upstream 1.3.0 release

* Mon Jun 19 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.2.5-6
- Fix saving preferences (timezone)
- Fix syntax error against MariaDB 10.2
- Fix assets for enigma plugin

* Thu May 25 2017 Timotheus Pokorra <tp@tbits.net> - 1.2.5-5
- avoid problems on Fedora, roundcubemail-core requires webserver but there are several available

* Wed May 10 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.2.5-2
- Fix log rotation in Plesk

* Fri Apr 28 2017 Timotheus Pokorra <tp@tbits.net> - 1.2.5-1
- Check in upstream 1.2.5 release

* Tue Apr 25 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.2.4-4
- Correct config.inc.php

* Mon Apr 24 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.2.4-2
- Include licensing.inc.php for Plesk installations

* Wed Mar 15 2017 Timotheus Pokorra <tp@tbits.net> - 1.2.4-1
- Check in upstream 1.2.4 release

* Wed Nov 30 2016 Timotheus Pokorra <tp@tbits.net> - 1.2.3-1
- Check in upstream 1.2.3 release

* Thu Sep 29 2016 Timotheus Pokorra <tp@tbits.net> - 1.2.2-1
- Check in maintenance upstream 1.2.2 release

* Wed Jul  6 2016 Jeroen van Meeuwen <vanmeeuwen@Kolabsys.com> - 1.2.0-1
- Check in the latest stable release

* Thu Jan 14 2016 Timotheus Pokorra <tp@tbits.net>
- /var/log/roundcubemail and /var/lib/roundcubemail should be owned by the webserver (#3678)
- using now the globals for those directories

* Tue Dec 22 2015 Timotheus Pokorra <tp@tbits.net>
- fix problems with upgrading, with the removed subpackages for skins

* Fri Dec 18 2015 Timotheus Pokorra <tp@tbits.net>
- fix problems with empty subpackages that occur with rpm 4.13 (#5303)
- drop some skin subpackages of plugins that are empty
- add dummy files to asset subpackages of plugins that are empty

* Fri Mar 27 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1.1.3-1
- Check in 3 revisions ahead of 1.1.1 release

* Wed Feb 25 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1.0-4
- Repack of 1.1 release branch at bbbd02bd

* Tue Feb 24 2015 Daniel Hoffend <dh@dotlan.net> - 1.1.0-3
- Fixed rewrite rules again

* Mon Feb 23 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1.0-2
- Repack of 1.1 release branch at 366ffd7a

* Sun Feb 15 2015 Daniel Hoffend <dh@dotlan.net> - - 1.1.0-2
- Remove odfviewer configuration in roundcubemail.conf

* Sat Feb 14 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1.0-1
- Final release of 1.1.0

* Wed Feb  4 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.10-git
- Ship a new GIT snapshot (09d52dbb)

* Thu Jan 29 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.10-git
- Ship a new GIT snapshot to resolve #3436 / #4431

* Wed Jan 28 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.9.git
- Require php-mysqlnd

* Fri Jan 23 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.8.git
- New snapshot release

* Wed Jan 14 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.7.git
- New snapshot release

* Fri Jan  9 2015 Timotheus Pokorra <tp@tbits.net>
- jqueryui.tagedit: backport a commit for #3912 and #4188

* Thu Jan  1 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.6.git
- New snapshot release for #4085 and various other tickets.

* Thu Aug 21 2014 Daniel Hoffend <dh@dotlan.net> - 1.1-0.5.git
- updated database upgrade process (roundcube != core)
- removed non-needed files

* Sun Aug  3 2014 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.4.git
- New git master head snapshot
- Merge using Net_LDAP3
- Increase CSRF protection

* Tue Jun 24 2014 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.3.git
- New git master head snapshot

* Fri Apr  4 2014 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.2.git
- New git master head snapshot

* Fri Feb 14 2014 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.1-0.1.git
- Current git master head snapshot

* Mon Nov 25 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.22.git
- New snapshot

* Mon Nov 11 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.21.git
- Fix the archive button

* Fri Nov  1 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.20.git
- Revert unstable list.js enhancements

* Thu Oct 31 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.19.git
- New snapshot

* Tue Oct 29 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.18.git
- Do not require httpd nor php directly

* Fri Oct 18 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.17.git
- New snapshot with many fixes and enhancements

* Sat Sep 14 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.9.git
- Fix CVE-2013-5646

* Fri Aug  9 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.7.git
- New snapshot

* Wed Jul 31 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.6.git
- New snapshot

* Tue Jun 18 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0-0.5.git
- Now with advanced LDAP features
- Snapshot

* Thu Apr 11 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.9-0.20.rc2
- New upstream version

* Tue Jan  8 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.9-0.18.beta
- Package beta release for Roundcube 0.9

* Sun Dec 16 2012 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.9-0.17
- Require php-gd for contact photos (0.16)
- Fix our logrotate (0.15)
- Ship latest contextmenu version (1.9)
- New snapshot (0.8 - 0.13, 0.15)
- Ship new skin as default (0.6)
- Check in latest from github/master (0.3, 0.4, 0.5)
- Use github/master instead (0.1)
- Snapshot from github/release-0.8 HEAD (0.1)

* Tue May 15 2012 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.8-0.3.svn6135
- Package bleeding edge upstream
- Order Allow,Deny, Allow from All (#762)
- AllowOverride All (#776)

* Thu May  3 2012 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.8-0.2.svn6135
- Correct symbolic links
- Package bleeding edge upstream

* Thu Apr 19 2012 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7.2-1
- New upstream release
- Do not include kolab plugins - these are now a separate package

* Mon Jan 09 2012 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7.1-1
- New upstream releases

* Fri Dec  2 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-6beta2
- Ship the latest fixes for testing purposes, in new pre-0.7 stable snapshot tarballs

* Thu Dec  1 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-2beta2
- Include Piwik Analytics plugin

* Mon Nov 28 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-1beta2
- Apply fix for #453 (terms plugin does not take into account skin_logo)

* Tue Nov 15 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.11beta2
- Resolve the following bugs: https://bugzilla.kolabsys.com/buglist.cgi?
  query_format=advanced&bug_status=RESOLVED&bug_status=CLOSED&product=Roundcube
  &target_milestone=0.7-beta2&target_milestone=0.7-next&target_milestone=future
- Ship upstream solution for #479 adding 'autocomplete_single' setting

* Thu Nov 10 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.10beta2
- Ship revision 0.10 of 0.7-beta2

* Sat Nov  5 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.9beta2
- Ship new snapshot version working towards 0.7-beta2, with patch for #323,
  and proposed patch for #466, #472, #473 and #479

* Tue Nov  1 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.8beta2
- Apply patch for parsing vlv response controls

* Sun Oct 30 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> 0.7-0.7beta2
- New beta release
- Include kolab_config plugin for configuration storage in IMAP folders and
  objects.
- Include creating default folders for Kolab Groupware related information
  in kolab_folders plugin.
- Include kolab_zpush configuration screen.
- Ship functional kolab_auth "helpdesk login" feature.

* Wed Oct 26 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.5beta1
- Ship zpush configuration plugin

* Thu Oct 20 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.7-0.4beta1
- 0.7 beta1 release
- Enhance use of LDAP Virtual List View controls
- Correct function use of VLV by numSubordinates, and with scope one
- Added search_only parameter for address book configuration
- ship additional plugins contextmenu, compose_addressbook, recipient_to_contact,
  and listcommands

* Thu Sep 15 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.6-8.rc1
- Fix permissions on enigma working directory
- Add thread_as_default plugin, enabling configuration to use 'threading'
  as the default view for mail folders, as opposed to the standard 'list'
  view.
- Correct symbolic link to enigma working directory.

* Fri Sep  9 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.6-6.rc1
- Ship the terms and conditions plugin

* Tue Sep  6 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.6-4.rc1
- Upstream roudncube.net release of release candidate 1 in the 0.6 series,
  see http://trac.roundcube.net/wiki/Changelog for changes.

* Fri Aug 26 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.6-3.beta3
- #369 Group of participants is displayed as one participant in the GUI (IE7)
- #368 Upload PDF as an image to a contact
- #365 event.end is null
- #357 Upload image in IE and enter
- #354 Duplicate use of tags in tagged commands, or logs entries not
  traceable per user/session
- Increase logging for memcached (part of #361)
- Increase flexibility for http_authenticate logoff event (part of #366)

* Thu Aug 18 2011 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.6-2.beta2
- New release
- Ship .htaccess file, but without some of the system settings
- Asynchronous triggering of Free/Busy
- New address book functionality
- Correct fix for illegal operand
- Rebuild with requirement for MDB2-Driver-mysqli
- Improved LDAP VLV Search/Index compatibility
- Include development on Calendar backend
- Literally remove all the external libraries
- Fix #108 configuration for Horde
- Fix ID
- Fix permission typo
- Remove Net/IDNA2 plugin
- Fix manage sieve configuration
- Split out kolab plugins

* Thu Feb 10 2011 Jon Ciesla <limb@jcomserv.net> - 0.5.1-1
- New upstream.

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Oct 18 2010 Jon Ciesla <limb@jcomserv.net> = 0.4.2-1
- New upstream.

* Mon Oct 04 2010 Jon Ciesla <limb@jcomserv.net> = 0.4.1-1
- New upstream.

* Mon Feb 01 2010 Jon Ciesla <limb@jcomserv.net> = 0.3.1-2
- Patch to fix CVE-2010-0464, BZ 560143.

* Mon Nov 30 2009 Jon Ciesla <limb@jcomserv.net> = 0.3.1-1
- New upstream.

* Thu Oct 22 2009 Jon Ciesla <limb@jcomserv.net> = 0.3-2
- Macro fix, BZ530037.

* Wed Sep 23 2009 Jon Ciesla <limb@jcomserv.net> = 0.3-1
- New upstream.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jul 15 2009 Jon Ciesla <limb@jcomserv.net> = 0.2.2-2
- Incorporated Chris Eveleigh's config changes to fix mimetype bug, BZ 511857.

* Wed Jul 01 2009 Jon Ciesla <limb@jcomserv.net> = 0.2.2-1
- New upstream.

* Fri Apr 10 2009 Jon Ciesla <limb@jcomserv.net> = 0.2.1-1
- New upstream.

* Mon Mar 30 2009 Jon Ciesla <limb@jcomserv.net> = 0.2-9.stable
- Patch for PG until php-pear-MDB2 hits 1.5.0 stable. BZ 489505.

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-8.stable
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Feb 04 2009 Jon Ciesla <limb@jcomserv.net> = 0.2-7.stable
- Patch for CVE-2009-0413, BZ 484052.

* Mon Jan 05 2009 Jon Ciesla <limb@jcomserv.net> = 0.2-6.stable
- New upstream.
- Dropped two most recent patches, applied upstream.

* Wed Dec 17 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-5.beta
- Security fix, BZ 476830.

* Fri Dec 12 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-4.beta
- Security fix, BZ 476223.

* Thu Oct 09 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-3.beta
- New upstream.

* Mon Jun 16 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-2.alpha
- osx files removed upstream.

* Mon Jun 16 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-1.alpha
- Fixed php-xml, php-mbstring Requires.  BZ 451652.
- Removing osx files, will be pulled from next upstream release.

* Fri Jun 13 2008 Jon Ciesla <limb@jcomserv.net> = 0.2-0.alpha
- Update to 0.2-alpha, security fixes for BZ 423271.
- mysql update and pear patches applied upstream.
- Patched config paths.

* Fri Apr 18 2008 Jon Ciesla <limb@jcomserv.net> = 0.1.1-5
- Added php-pecl-Fileinfo Reqires. BZ 442728.

* Wed Apr 16 2008 Jon Ciesla <limb@jcomserv.net> = 0.1.1-4
- Added mcrypt, MDB2 Requires.  BZ 442728.

* Thu Apr 10 2008 Jon Ciesla <limb@jcomserv.net> = 0.1.1-3
- Patch to fix PEAR path issue, drop symlinks.

* Thu Apr 10 2008 Jon Ciesla <limb@jcomserv.net> = 0.1.1-2
- Drop %%pre script that was breaking pear packages.

* Wed Apr 09 2008 Jon Ciesla <limb@jcomserv.net> = 0.1.1-1
- New upstream release.
- Added patch to fix mysql update.

* Tue Mar 18 2008 Jon Ciesla <limb@jcomserv.net> = 0.1-1
- Updgrade to 0.1 final, -dep.
- Added new mimeDecode dep.

* Mon Feb 04 2008 Jon Ciesla <limb@jcomserv.net> = 0.1-0.10rc2.1
- Changed to upstream -dep tarball, GPL-compliant.

* Fri Feb 01 2008 Jon Ciesla <limb@jcomserv.net> = 0.1-0.9rc2.1
- re-removed PEAR components that slipped back in after rc1.

* Fri Oct 26 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.8rc2
- Upgrade to 0.1-rc2

* Thu Aug 16 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.7rc1.1
- License tag correction.

* Tue Jul 03 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.6rc1.1
- New upstream release, all GPL, all current languages included.

* Mon May 14 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.5.beta2.2
- Fixed source timestamps, added Russian langpack.
- Added logpath fix to main.inc.php
- Fixed logrotate filename.

* Fri May 11 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.4.beta2.2
- Cleanup/elegantization of spec, .conf.

* Thu May 10 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.3.beta2.2
- Fixed bad chars in script.

* Thu May 10 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.2.beta2.2
- Added all langpacks.

* Thu May 10 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-0.1.beta2.2
- Versioning fix.

* Wed May 09 2007 Jon Ciesla <limb@jcomserv.net> = 0.1-beta2.3
- Fixed generation of DES.
- Cleanup re patch.

* Mon May 07 2007 Jon Ciesla <limb@jcomserv.net> - 0.1-beta2.2.3
- Removed duplicate docs.
- Moved SQL to doc.
- Fixed perms on log dir, sysconfdir.
- Fixed Requires.
- Fixed config.
- Fixed changelog spacing.

* Fri May 04 2007 Jon Ciesla <limb@jcomserv.net> - 0.1-beta2.2.2
- Created new source tarball with PEAR code removed. Added script for creation.

* Tue Feb 13 2007 Jon Ciesla <limb@jcomserv.net> - 0.1-beta2.2.1
- Excluded Portions from PEAR, included as dependancies
- Fixed log/temp issues, including logrotate

* Tue Jan 30 2007 Jon Ciesla <limb@jcomserv.net> - 0.1-beta2.2
- Initial packaging.