From 6ed2aec553b9d9a3dec3a6a15d92b45b755170f4 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Jul 25 2016 09:52:36 +0000 Subject: Add packaging files and info --- diff --git a/MANIFEST.in b/MANIFEST.in index 08c6638..c584738 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,5 @@ recursive-include plus_plus_service *.ini include plus_plus_service/migrations/script.py.mako recursive-include plus_plus_service/migrations *.py recursive-include fedmsg.d *.py +graft deploy +include *.spec diff --git a/deploy/apache.conf b/deploy/apache.conf new file mode 100644 index 0000000..68b86d4 --- /dev/null +++ b/deploy/apache.conf @@ -0,0 +1,13 @@ +WSGIDaemonProcess plus_plus_service threads=5 +WSGIScriptAlias / /etc/plus-plus-service/wsgi.py + + + WSGIProcessGroup plus_plus_service + WSGIApplicationGroup %{GLOBAL} + + Order deny,allow + Allow from all + + Order deny,allow + Allow from all + diff --git a/deploy/wsgi.py b/deploy/wsgi.py new file mode 100644 index 0000000..0a4e523 --- /dev/null +++ b/deploy/wsgi.py @@ -0,0 +1,18 @@ +#-*- coding: utf-8 -*- + +## Optional: The following is only needed if you did not install the app +## as a python module (for example if you run it from a git clone). +#import sys +#sys.path.insert(0, '/path/to/code/') + +import os +## Set the environment variable pointing to the configuration file +# Might required to be adjusted to your setup +os.environ['FLASK_SETTINGS'] = '/etc/plus-plus-service/settings.py' + +## The most import line to setup WSGI. +from plus_plus_service import APP as application + +## Optional: Turn on the debug mode to get more information in the +## logs about internal errors +#application.debug = True diff --git a/plus-plus-service.spec b/plus-plus-service.spec new file mode 100644 index 0000000..91330d9 --- /dev/null +++ b/plus-plus-service.spec @@ -0,0 +1,85 @@ +Name: plus-plus-service +Version: 0.1 +Release: 1%{?dist} +Summary: REST service to send karma to Fedora users + +License: AGPLv3+ +URL: https://pagure.io/plus-plus-service +Source0: %{name}-%{version}.tar.gz + +BuildArch: noarch + +BuildRequires: python3-pkgversion-macros +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +# Unit testing +BuildRequires: python%{python3_pkgversion}-alembic +BuildRequires: python%{python3_pkgversion}-fedora +BuildRequires: python%{python3_pkgversion}-flask +BuildRequires: python%{python3_pkgversion}-mock +BuildRequires: python%{python3_pkgversion}-nose2 +BuildRequires: python%{python3_pkgversion}-requests +BuildRequires: python%{python3_pkgversion}-fedmsg +BuildRequires: python%{python3_pkgversion}-sqlalchemy + +Requires: python%{python3_pkgversion}-alembic +Requires: python%{python3_pkgversion}-fedora +Requires: python%{python3_pkgversion}-flask +Requires: python%{python3_pkgversion}-requests +Requires: python%{python3_pkgversion}-fedmsg +Requires: python%{python3_pkgversion}-sqlalchemy + + +%description +Plus Plus Service is a REST-based service to increment or decrement karma for +Fedora users. + + +%prep +%setup -q + + +%build +%{__python3} setup.py build + + +%install +rm -rf %{buildroot} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} + +mkdir -p %{buildroot}%{_sysconfdir}/%{name} + +# Install WSGI and Apache files +install -m 644 deploy/wsgi.py %{buildroot}%{_sysconfdir}/%{name}/ +install -m 644 deploy/apache.conf %{buildroot}%{_sysconfdir}/%{name}/ +mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d +ln -s ../../%{name}/apache.conf %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf + +# Install the fedmsg config file +mkdir -p %{buildroot}%{_sysconfdir}/fedmsg.d +install -m 644 fedmsg.d/plus_plus_service.py %{buildroot}%{_sysconfdir}/fedmsg.d/ + +# Prepare a directory for the SQLite database +mkdir -p %{buildroot}%{_localstatedir}/%{name} + + +%check +%{__python3} -m nose2 plus_plus_service + + +%files +%doc README.rst AUTHORS.txt +%license COPYING.txt +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%config(noreplace) %{_sysconfdir}/fedmsg.d/%{name}.py +%dir %{_sysconfdir}/%{name}/ +%config(noreplace) %{_sysconfdir}/%{name}/* +%{python_sitelib}/%{name}/ +%{python_sitelib}/%{name}*.egg-info +%{_bindir}/%{name} +%dir %attr(apache,apache,-) %{_localstatedir}/%{name}/ + + +%changelog +* Thu Jul 21 2016 Aurelien Bompard - 0.1-1 +- initial package diff --git a/setup.py b/setup.py index 550b9c7..02c1118 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( long_description=open('README.rst').read(), author='Aurelien Bompard', author_email='abompard@fedoraproject.org', - # url="https://pagure.io/plus-plus-service", + url="https://pagure.io/plus-plus-service", license="AGPLv3+", classifiers=[ "Development Status :: 3 - Alpha",