%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?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))")} %endif %define name fpaste-server %define version 0.1 %define unmangled_version 0.1 %define release 2 Name: %{name} Version: %{version} Release: %{release} Summary: Fedora Pastebin Group: Applications/Internet License: GPLv2+ URL: https://fedorahosted.org/fpaste-server/ Source0: https://fedorahosted.org/releases/f/p/fpaste-server/%{name}-%{unmangled_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Prefix: %{_prefix} BuildRequires: python2-devel BuildRequires: python-setuptools Requires: django-tracking >= 0.2.7 Requires: django-simple-captcha >= 0.2.0 Requires: django-mptt >= 0.4.2 Requires: django-dpaste >= 0.2.4 Requires: httpd %description fpaste-server is simply put, a pastebin. Like many a pastebin application before it, fpaste-server strives to make it easy to share code and other information collaboratively. %prep %setup -qn %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} %build python setup.py build %install python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES chmod a+x %{buildroot}%{python_sitelib}/fpaste_server/manage.py sed -i 's|#python_path#|%{python_sitelib}|g' %{buildroot}%{python_sitelib}/fpaste_server/conf/fpaste_server.conf mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d/ mv %{buildroot}%{python_sitelib}/fpaste_server/conf/fpaste_server.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/fpaste_server.conf # uses the dpaste path structure and needs a symbolic link to work ln -sf %{python_sitelib}/fpaste_server/templates/fpaste_server %{buildroot}/%{python_sitelib}/fpaste_server/templates/dpaste %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README %{python_sitelib}/* %config(noreplace) %{_sysconfdir}/httpd/conf.d/fpaste_server.conf %changelog * Mon Mar 07 2011 Clint Savage 0.1-2 - Fixed rpmlint errors and warnings. * Tue Feb 08 2011 Clint Savage 0.1-1 - Initial package build