rpm spec

I'm packaging graph-tool for RHEL. I'd like to contribute the spec for
distribution so that your users can easily build packages on Red Hat
systems, and you can offer them for distribution if you choose to do so.

I did notice a couple of problems while packaging.

First, your build scripts appear to install into the general library
path(distutils.sysconfig.get_python_lib()) when it should install to the
platform-dependent library path
(distutils.sysconfig.get_python_lib(1)). According to the manual, I
believe you should be using pyexecdir rather than pythondir.
http://www.gnu.org/software/automake/manual/html_node/Python.html

Second, numpy headers appear to be included incorrectly.

     >>> print numpy.get_include.__doc__

         Return the directory that contains the NumPy \*.h header files.

         Extension modules that need to compile against NumPy should use
    this
         function to locate the appropriate include directory.
    $ python -c 'import numpy; print "-I" + numpy.get_include()'
    -I/usr/lib64/python2.7/site-packages/numpy/core/include

However, arrayobject.h is included directly where the correct path
should be numpy/arrayobject.h. Because the headers don't include that
prefix, the spec file includes a static path for the headers.

Similarly, the cairomm headers are included without a prefix.

    # pkg-config --cflags cairomm-1.0
    -I/usr/include/cairomm-1.0 -I/usr/include/cairo
    -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include
    -I/usr/include/pixman-1 -I/usr/include/freetype2
    -I/usr/include/libpng12

cairommconfig.h is included, when the correct path is
cairomm/cairommconfig.h.

attachment.html (2.18 KB)

python-graph-tool.spec (2 KB)

I'm packaging graph-tool for RHEL. I'd like to contribute the spec
for distribution so that your users can easily build packages on Red
Hat systems, and you can offer them for distribution if you choose to
do so.

Thank you for your efforts, and for noticing the problems you mentioned.

Are you packaging this just for yourself, or do you intend to distribute
it in a repository?

I did notice a couple of problems while packaging.

First, your build scripts appear to install into the general library path(distutils.sysconfig.get_python_lib()) when it should install to the platform-dependent library path (distutils.sysconfig.get_python_lib(1)). According to the manual, I believe you should be using pyexecdir rather than pythondir.
http://www.gnu.org/software/automake/manual/html_node/Python.html

Second, numpy headers appear to be included incorrectly.

    >>> print numpy.get_include.__doc__

        Return the directory that contains the NumPy \*.h header files.

        Extension modules that need to compile against NumPy should use this
        function to locate the appropriate include directory.
    $ python -c 'import numpy; print "-I" + numpy.get_include()'
    -I/usr/lib64/python2.7/site-packages/numpy/core/include

However, arrayobject.h is included directly where the correct path should be numpy/arrayobject.h. Because the headers don't include that prefix, the spec file includes a static path for the headers.

These issues are now fixed in the git version.

Thanks!

Similarly, the cairomm headers are included without a prefix.

    # pkg-config --cflags cairomm-1.0
    -I/usr/include/cairomm-1.0 -I/usr/include/cairo -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12

cairommconfig.h is included, when the correct path is cairomm/cairommconfig.h.

For me the cairommconfig.h file is included in

    /usr/lib/cairomm-1.0/include/cairommconfig.h

so, the is no cairomm prefix...

Best,
Tiago

Thank you for your efforts, and for noticing the problems you mentioned.

Are you packaging this just for yourself, or do you intend to distribute
it in a repository?

I'm working on this to support some of the Electrical Engineering
students at University of Washington. We don't currently publish a
repository publicly.

For me the cairommconfig.h file is included in

     /usr/lib/cairomm-1.0/include/cairommconfig.h

so, the is no cairomm prefix...

I took another look at that, and confirmed that Fedora's header is in a
similar location. I'm building for CentOS 6 which has a much older
version of cairomm, which probably explains the difference.

I'll build on CentOS 7 at some point and fix the spec's include path.

Thanks, Tiago.

I've tested building graph-tool 2.2.36 on CentOS 7.

The only major challenge is that Red Hat ships boost 1.53, which means
that I had to modify the packages for boost 1.54 to create a package
named "boost154" that I could install in parallel with boost 1.53.

For rpm systems that ship boost 1.54 or newer, the required rpm spec is
somewhat cleaner than the last one I sent. I've included that with this
message. Let me know if there's anything else I can do to help ship
packages for rpm based systems.

python-graph-tool.spec (1.8 KB)

Thanks for this. Did you try the newest version, 2.2.38?

I don't have access to a RPM-Based distro at the moment, but I will see
if I find the time to test this nevertheless.

Best,
Tiago

Just built it. Seems fine.