File emboss-explorer.spec of Package emboss-explorer

#
# spec file for package emboss-explorer
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           emboss-explorer
Summary:        Web-based Graphical User Interface for EMBOSS
License:        GPL-1.0
Group:          Productivity/Scientific/Other
Version:        2.2.0
Release:        0
BuildRequires:  perl
BuildRequires:  perl-MailTools
BuildRequires:  perl-macros
BuildRequires:  perl-Parse-RecDescent
Requires:       apache2
Requires:       cron
Requires:       perl = %{perl_version}
Requires:       perl-MailTools
Requires:       perl-Parse-RecDescent
Source:         %{name}-%{version}.tar.gz
Patch0:         %{name}-conf.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://embossgui.sourceforge.net/

%if 0%{?suse_version} < 1140
Requires:       perl = %{perl_version}
%else
%{perl_requires}
%endif

%define EMBOSS_PREFIX /usr
%define HTML_PATH /srv/www/htdocs/emboss
%define OUTPUT_PATH %{HTML_PATH}/output
%define HTML_URL /emboss
%define OUTPUT_URL %{HTML_URL}/output
%define CGI_PATH /srv/www/cgi-bin/emboss
%define CGI_URL /cgi-bin/emboss

%description
EMBOSS explorer is a web-based graphical user interface to the EMBOSS suite of 
bioinformatics tools. It is exceedingly simple to install, configure, maintain 
and use.

%prep
%setup -n %{name}
%patch0 -p1

%build
%{__perl} Makefile.PL

%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist

for i in output images style
do
    install -d %{buildroot}%{HTML_PATH}/$i
done

mkdir -p %{buildroot}/srv/www/cgi-bin
install -m 755 cgi/emboss %{buildroot}%{CGI_PATH}

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"
 \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
  <head>
    <title>EMBOSS Explorer</title>
  </head>
  <frameset cols=\"170, *\">
    <frame src=\"/cgi-bin/emboss/menu\" name=\"menu\" />
    <frame src=\"/cgi-bin/emboss/intro\" name=\"main\" />
  </frameset>
</html>" > %{buildroot}%{HTML_PATH}/index.html

install -d html/images %{buildroot}%{HTML_PATH}/images
install -d html/style %{buildroot}%{HTML_PATH}/style 

#write permissions on the output dir to apache2
mkdir -p %{buildroot}%{OUTPUT_PATH}

mkdir -p %{buildroot}%{_sysconfdir}/cron.d
cat << __EOF__ >> %{buildroot}%{_sysconfdir}/cron.d/emboss-clean-output
#EMBOSS Explorer generates temporary output files every time an application is
#used.  Depending on the tasks being performed, these output files can consume
#space fairly quickly.
#The following example runs every
#morning at 0400 and removes all output files that have not been accessed in
#the last 24 hours:
0 4 * * * find %{OUTPUT_PATH} -type d -mindepth 1 -maxdepth 1 -atime 1 -exec rm -rf {} \;
__EOF__

%post
chown wwwrun:www /srv/www/htdocs/emboss/output

%clean

%files -f %{name}.files
%defattr(-,root,root)
%doc %{_mandir}/man?/*
%doc README
/srv/www/cgi-bin/emboss
/srv/www/htdocs/emboss
%config %{_sysconfdir}/cron.d/emboss-clean-output

%changelog
openSUSE Build Service is sponsored by