Commit 1252ba66 authored by ayllon's avatar ayllon
Browse files

Preparing to make fts3rest installable

parent bb0680f5
cmake_minimum_required (VERSION 2.6)
project (fts3-misc)
# Python libraries location
execute_process (COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Subdirectories
add_subdirectory (src)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
%if 0%{?rhel} == 5
%global with_python26 1
%endif
%if 0%{?with_python26}
%global __python26 %{_bindir}/python2.6
%global py26dir %{_builddir}/python26-%{name}-%{version}-%{release}
%{!?python26_sitelib: %global python26_sitelib %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%{!?python26_sitearch: %global python26_sitearch %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
# Update rpm byte compilation script so that we get the modules compiled by the
# correct inerpreter
%global __os_install_post %__multiple_python_os_install_post
%endif
Name: fts-rest
Version: 0.0.1
Release: 1%{?dist}
BuildArch: noarch
Summary: FTS3 Rest Interface
Group: Applications/Internet
License: ASL 2.0
URL: https://svnweb.cern.ch/trac/fts3
Source0: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cmake
%if 0%{?with_python26}
BuildRequires: python26-devel
%else
BuildRequires: python-devel
%endif
Requires: gridsite%{?_isa} >= 1.7
Requires: httpd%{?_isa}
Requires: mod_wsgi
Requires: python-fts
%description
This package provides the FTS3 REST interface
%prep
%setup -q -n %{name}-%{version}
%build
%cmake . -DCMAKE_INSTALL_PREFIX=/
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{python_sitearch}/*
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
%changelog
* Thu Mar 21 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-1
- Initial build
cmake_minimum_required (VERSION 2.6)
add_subdirectory (fts3rest)
cmake_minimum_required (VERSION 2.6)
add_subdirectory (fts3rest)
# WSGI
install (FILES fts3rest.wsgi
DESTINATION usr/libexec/fts3/
)
# Configuration file
install (FILES fts3rest.ini
DESTINATION etc/fts3
)
# Apache configuration file
install (FILES fts3rest.conf
DESTINATION etc/httpd/conf.d
)
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /fts3 /usr/libexec/fts3/fts3rest.wsgi
#!/usr/bin/env python
import os, sys
wd = os.path.dirname(__file__)
if wd not in sys.path:
sys.path.append(wd)
from paste.deploy import loadapp
application = loadapp('config:%s/development.ini' % wd)
application = loadapp('config:/etc/fts3/fts3rest.ini')
cmake_minimum_required (VERSION 2.6)
install (FILES __init__.py websetup.py
DESTINATION ${PYTHON_SITE_PACKAGES}/fts3rest/
)
install (DIRECTORY config
DESTINATION ${PYTHON_SITE_PACKAGES}/fts3rest
PATTERN "*.pyc" EXCLUDE
)
install (DIRECTORY controllers
DESTINATION ${PYTHON_SITE_PACKAGES}/fts3rest
PATTERN "*.pyc" EXCLUDE
)
install (DIRECTORY lib
DESTINATION ${PYTHON_SITE_PACKAGES}/fts3rest
PATTERN "*.pyc" EXCLUDE
)
install (DIRECTORY model
DESTINATION ${PYTHON_SITE_PACKAGES}/fts3rest
PATTERN "*.pyc" EXCLUDE
)
#
# fts3rest - Pylons configuration
#
# The %(here)s variable will be replaced with the parent directory of this file
#
[DEFAULT]
debug = true
email_to = you@yourdomain.com
smtp_server = localhost
error_email_from = paste@localhost
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 5000
[app:main]
use = egg:fts3rest
full_stack = true
static_files = true
cache_dir = %(here)s/data
beaker.session.key = fts3rest
beaker.session.secret = ${app_instance_secret}
app_instance_uuid = ${app_instance_uuid}
# If you'd like to fine-tune the individual locations of the cache data dirs
# for the Cache data, or the Session saves, un-comment the desired settings
# here:
#beaker.cache.data_dir = %(here)s/data/cache
#beaker.session.data_dir = %(here)s/data/sessions
# SQLAlchemy database URL
sqlalchemy.url = sqlite:///production.db
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
# Debug mode will enable the interactive debugging tool, allowing ANYONE to
# execute malicious code after an exception is raised.
set debug = false
# Logging configuration
[loggers]
keys = root
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] [%(threadName)s] %(message)s
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment