# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?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))")} %global bentoflags --docdir=%{_docdir} --sharedstatedir=%{_sharedstatedir} --htmldir=%{_docdir} --localstatedir=%{_localstatedir} --prefix=%{_prefix} --psdir=%{_docdir} --mandir=%{_mandir} --infodir=%{_infodir} --libdir=%{_libdir} --localedir=%{_datadir}locale --dvidir=%{_docdir} --bindir=%{_bindir} --sitedir=%{python_sitelib} --pdfdir=%{_docdir} --exec-prefix=%{_exec_prefix} --datarootdir=%{_datarootdir} --sysconfdir=%{_sysconfdir} --includedir=%{_includedir} --sbindir=%{_sbindir} --libexecdir=%{_libexecdir} %if 0%{?fedora} || 0%{?rhel} > 6 %global with_python3 1 %endif %global srcname bento Name: python-%{srcname} Version: 0.0.6 Release: 1.20110720git312f656%{?dist} Summary: Tool to nicely package python software Group: Development/Languages License: BSD URL: http://cournape.github.com/Bento/html/index.html # Bento is still in highly active development # Packaging a snapshot for now # git clone https://github.com/cournape/Bento.git # git checkout -r 312f656 # cd Bento # python bootstrapy.py install # ./bentomaker sdist # The tarball will be in dist/bento-%%{version}.tar.gz Source0: %{srcname}-%{version}.tar.gz # rpm macros for bento packages Source1: macros.bento Patch0: bento-destdir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python2-devel # Once bento is in the distro we'll need it to build new versions # BuildRequires: python-bento # For testing BuildRequires: python-simplejson BuildRequires: python-ply #BuildRequires: python-yaku Requires: python-simplejson Requires: python-ply Requires: python-yaku Requires: python-bento-common = %{version}-%{release} %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python-tools BuildRequires: python3-ply #BuildRequires: python3-yaku Requires: python3-ply Requires: python3-yaku Requires: python-bento-common = %{version}-%{release} %endif %description Bento aims at simplifying the packaging of python softwares both from the user and developer point of view. Bento packages are described by a bento.info file which is parsed by the different build tools to do the actual work. Currently, the main user interface to bento is bentomaker, a command line tool to build, install and query bento packages. %package -n python-bento-common Summary: Files shared between the python2 and python3 bento module Group: Development/Languages %description -n python-bento-common Bento aims at simplifying the packaging of python softwares both from the user and developer point of view. Bento packages are described by a bento.info file which is parsed by the different build tools to do the actual work. Currently, the main user interface to bento is bentomaker, a command line tool to build, install and query bento packages. This package contains files used by both the python2 and python3 versions of bento. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: Tool to nicely package python software for python3 Group: Development/Languages %description -n python3-%{srcname} Bento aims at simplifying the packaging of python softwares both from the user and developer point of view. Bento packages are described by a bento.info file which is parsed by the different build tools to do the actual work. Currently, the main user interface to bento is bentomaker, a command line tool to build, install and query bento packages. This package contains the module, ported to run under python3. %endif # with_python3 %prep %setup -q -n %{srcname}-%{version} %patch0 -p1 -b .destdir # Until we fix a bug with bento.info defaults overriding the commandline, sed -i 's/Default: true/Default: false/' bento.info %build # Once bento is in the distribution, we can use prior versions to build newer # versions %{__python} bootstrap.py %if 0%{?with_python3} ./bentomaker run_2to3 pushd build/py3k %{__python3} -m bentomakerlib.bentomaker configure %{bentoflags} --sitedir=%{python3_sitelib} --bundling=false %{__python3} -m bentomakerlib.bentomaker build popd %endif # If not a noarch package, set --sitedir=%%{python_sitearch} ./bentomaker configure %{bentoflags} --bundling=false ./bentomaker build %install rm -rf %{buildroot} %if 0%{?with_python3} pushd build/py3k %{__python3} -m bentomakerlib.bentomaker install --destdir=%{buildroot} mv %{buildroot}%{_bindir}/bentomaker %{buildroot}%{_bindir}/python3-bentomaker popd %endif # Once bento is in the distribution, use prior versions to build newer versions ./bentomaker install --destdir=%{buildroot} install -d %{buildroot}/%{_sysconfdir}/rpm install -p -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/rpm/macros.bento %check ./bentomaker test %if 0%{?with_python3} pushd %{py3dir} %{__python3} -m bentomakerlib.bentomaker test_py3k popd %endif %clean rm -rf %{buildroot} %files -n python-bento-common %defattr(-,root,root,-) %doc README.rst LICENSE.txt THANKS examples %config(noreplace) %{_sysconfdir}/rpm/macros.bento %{_datadir}/%{srcname}/ %files %defattr(-,root,root,-) %{_bindir}/bentomaker %{python_sitelib}/* %if 0%{?with_python3} %files -n python3-%{srcname} %defattr(-,root,root,-) %{_bindir}/python3-bentomaker %{python3_sitelib}/* %endif %changelog * Thu Jul 21 2011 Toshio Kuratomi - 0.0.6-1.20110720git312f656 - Initial Fedora packaging