File kopano-webapp-plugin-smime.spec of Package kopano-webapp-plugin-smime

%define pluginname smime
%define plugindir %_datadir/kopano-webapp/plugins

Name:           kopano-webapp-plugin-smime
Summary:        Secure E-Mail plugin for Kopano WebApp
Group:          Productivity/Networking/Email/Clients
License:        AGPL-3.0
Version:        1.1
Release:	1
Url:            http://www.kopano.com
Source:         %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:	kopano-webapp-buildtools
BuildArch:      noarch
Requires:	kopano-webapp php-kopano-smime

%if "%_repository" == "RHEL_6_PHP_56" || "%_repository" == "RHEL_7_PHP_56"
Requires:	rh-php56-php-bcmath
Requires:	rh-php56-php-common
Requires:	rh-php56-php-xml
%else
Requires:	php-bcmath
Requires: 	php-curl
Requires:	php-openssl
Requires:	php-xml
%endif

%if "%_repository" == "RHEL_7"
Requires: 	php-common
%endif

%description
The S/MIME plugin for WebApp is an easy to use tool that helps you to
secure your email with minimal effort from the user.
Enables cross-organization data sharing, and fight against data leakage.

%prep
%setup -qn %{name}-%{version}
find . -type f "(" -name "*.js" -o -name "*.php" ")" \
	-exec chmod a-x "{}" "+";

%build
ant -Dtools-folder=/usr/share/kopano-webapp-buildtools/tools/ -Dserver-folder=/usr/share/kopano-webapp-buildtools/server/ -Dtarget-folder=deploy -Dplugin-folder=%{name} -Dplugin=%{pluginname} deploy;

%install
d="%buildroot/%{plugindir}/%{pluginname}";

install -d "$d";
install -d "%buildroot/%_sysconfdir/kopano/webapp"

cp -rf deploy/%{name}/* "$d/";
# LICENSE
install -m644 LICENSE.txt "$d/LICENSE.txt"
mv "$d/config.php" "%buildroot/%_sysconfdir/kopano/webapp/config-%{pluginname}.php"
ln -s "%_sysconfdir/kopano/webapp/config-%{pluginname}.php" "$d/config.php"

%files
%defattr(-,root,root)
%dir %_datadir/kopano-webapp
%dir %plugindir
%dir %_sysconfdir/kopano
%dir %_sysconfdir/kopano/webapp
%plugindir/%{pluginname}
%config(noreplace) %_sysconfdir/kopano/webapp/config-%{pluginname}.php

%changelog
* Mon Feb 02 2015 development@kopano.com
- Current release
openSUSE Build Service is sponsored by