# Turn off the brp-python-bytecompile script # This is needed to not generate /etc/restauth/localsettings.pyo and /etc/restauth/localsettings.pyc %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') Name: restauth Version: 0.5.2 Release: 3%{?dist} Summary: Web-service providing shared authentication, authorization and preferences Group: Applications/Internet License: GPLv3+ URL: https://server.restauth.net/ Source0: https://server.restauth.net/download/%{name}-%{version}.tar.gz # Put comments to empty files. Django needs them to be there... Patch0: restauth-0.5.2-empty-files.patch BuildArch: noarch BuildRequires: python-devel BuildRequires: python-sphinx Requires: Django >= 1.3 Requires: python-restauth-common Requires: python-mimeparse %description Lightweight web-service that provides shared authentication, authorization and preferences. RestAuth does not attempt to provide "one account for the web" like OpenId or OAuth but instead allows multiple systems to directly use the same user base, much like the way LDAP or Kerberos is commonly used. %package doc Summary: RestAuth Documentation Group: Documentation Requires: restauth = %{version}-%{release} %description doc Documentation for RestAuth %prep %setup -q %patch0 -p1 -b .empty-files %build CFLAGS="%{optflags}" %{__python} setup.py build %{__python} setup.py build_man %{__python} setup.py build_doc %install %{__python} setup.py install --skip-build --root %{buildroot} rm -rf %{buildroot}/usr/share/doc/* # setup.py does not install those files, but they are important mkdir -p %{buildroot}%{_bindir} install -m 755 ./bin/restauth-group.py %{buildroot}%{_bindir}/restauth-group install -m 755 ./bin/restauth-import.py %{buildroot}%{_bindir}/restauth-import install -m 755 ./bin/restauth-service.py %{buildroot}%{_bindir}/restauth-service install -m 755 ./bin/restauth-user.py %{buildroot}%{_bindir}/restauth-user ln -s %{python_sitelib}/RestAuth/manage.py %{buildroot}%{_bindir}/restauth-manage chmod 755 %{buildroot}%{python_sitelib}/RestAuth/manage.py mkdir -p %{buildroot}%{_sysconfdir}/restauth # config file should not be in /usr/... so we move it to /etc/restauth # and create symlink to it in /usr/ mv %{buildroot}%{python_sitelib}/RestAuth/localsettings.py %{buildroot}%{_sysconfdir}/restauth/localsettings.py ln -s %{_sysconfdir}/restauth/localsettings.py %{buildroot}%{python_sitelib}/RestAuth/localsettings.py # man pages mkdir -p %{buildroot}/%{_mandir}/man1 install -m 644 ./doc/_build/man/*.1 %{buildroot}/%{_mandir}/man1 # documentation cp -a ./doc/_build/html . rm -f ./html/\.buildinfo # py_byte_compile files in python_sitelib manually find %{buildroot}%{python_sitelib} -type f -a -name "*.py" -print0 | xargs -0 %{__python} -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || : find %{buildroot}%{python_sitelib} -type f -a -name "*.py" -print0 | xargs -0 %{__python} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || : %files %doc AUTHORS ChangeLog COPYING COPYRIGHT %{python_sitelib}/* %{_bindir}/* %{_datadir}/restauth/ %{_mandir}/man*/* %dir %{_sysconfdir}/restauth/ %config(noreplace) %attr(0644, root, root) %{_sysconfdir}/restauth/localsettings.py %files doc %doc html %changelog * Mon Nov 28 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.2-3 - fixed rpmlint warnings * Tue Nov 22 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.2-2 - added -doc package - added man pages * Wed Nov 02 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.2-1 - Initial version