Qpid on CentOS 5

Build using Fedora

  1. Install the RPM development tools

    sudo yum install rpmdevtools mock
    
  2. Add yourself to the mock group

    sudo /usr/sbin/usermod --groups mock --append $USER
    
  3. Setup build directories

    rpmdev-setuptree
    
  4. Install spec and source files (or get latest here)

    rpm -i ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/RHEMRG/SRPMS/qpidc-0.5.752581-17.el5.src.rpm
    rpm -i ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/RHEMRG/SRPMS/amqp-1.0.750054-1.el5.src.rpm
    rpm -i ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/RHEMRG/SRPMS/python-qpid-0.5.752581-3.el5.src.rpm
    
  5. Build qpidc

    rpmbuild -bs --nodeps ~/rpmbuild/SRPM/qpidc.spec
    mock -vr epel-5-x86_64 ~/rpmbuild/SRPMS/qpidc-*.src.rpm
    scp /var/lib/mock/epel-5-x86_64/result/*.rpm CENTOS_HOST:SOME_PATH
    
  6. Build amqp

    rpmbuild -bs --nodeps ~/rpmbuild/SPECS/amqp.spec
    mock -vr epel-5-x86_64 ~/rpmbuild/SRPMS/amqp-*.src.rpm
    scp /var/lib/mock/epel-5-x86_64/result/*.rpm CENTOS_HOST:SOME_PATH
    
  7. Build python-qpid

    rpmbuild -bs --nodeps ~/rpmbuild/SPECS/python-qpid.spec
    mock -vr epel-5-x86_64 ~/rpmbuild/SRPMS/python-qpid-*.src.rpm
    scp /var/lib/mock/epel-5-x86_64/result/*.rpm CENTOS_HOST:SOME_PATH
    

Install on CentOS

  1. Become root

    sudo su -
    
  2. Install Qpid server and Python client packages

    cd SOME_PATH
    yum localinstall --nogpgcheck qpidc-*.el5.x86_64.rpm qpidd-*.el5.x86_64.rpm amqp-*.el5.noarch.rpm python-qpid-*.el5.noarch.rpm
    
  3. Disable auth for testing

    echo 'auth=no' >> /etc/qpidd.conf
    
  4. Start qpidd

    service qpidd start
    
  5. Test using these instructions.

NOTE: I realize you can build the SRPMs without installing them.

Python Line-by-line Profiler (line_profiler and kernprof)

The following is a quick and dirty guide to getting started with line_profiler, a Python line-by-line profiler, on Fedora.

  1. Build and install the python-line_profiler package
  2. Create a file called test.py with the code below

    import random, time
    
    def sleep():
        seconds = random.randint(0, 5)
        print 'Sleeping %s seconds' % seconds
        time.sleep(seconds)
    
    @profile
    def test():
        sleep()
        sleep()
        sleep()
    
    test()
    
  3. Profile test.py

    [silas@silas ~]$ kernprof.py -l test.py
    Sleeping 4 seconds
    Sleeping 5 seconds
    Sleeping 2 seconds
    Wrote profile results to test.py.lprof
    
  4. View the results

    [silas@silas ~]$ python -m line_profiler test.py.lprof
    Timer unit: 1e-06 s
    
    File: test.py
    Function: test at line 8
    Total time: 10.9994 s
    
    Line #      Hits         Time  Per Hit   % Time  Line Contents
    ==============================================================
         8                                           @profile
         9                                           def test():
        10         1      3999416 3999416.0     36.4      sleep()
        11         1      4999982 4999982.0     45.5      sleep()
        12         1      1999990 1999990.0     18.2      sleep()
    

NOTE: I have a package review up for line_profiler and it should be available via yum eventually.

Scribe – Scalable Real Time Log Aggregation for CentOS 5 / RHEL 5

"Scribe is a server for aggregating log data streamed in real time from a large number of servers. It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine. Scribe was developed at Facebook and released as open source."

I've packaged Thrift, fb303 and Scribe for CentOS 5 / RHEL 5.

SRPM

Scribe depends on fb303 which in turns depends on Thrift so you'll need to setup a local repository and build them in that order. To build the above packages for Fedora 9+ you'll need to tweak the Python sub-packages to include the egg files.

Both fb303 and Scribe need some tweaks upstream before they're suitable for a package review, but I'd like to get them in Fedora shortly (I've already submitted Thrift).

If you'd like to hack around with my latest Fedora specs you can grab them here.

Adobe Flash 10 64-bit SPEC File for Fedora 9

I hacked up a quick SPEC file for the alpha release of Adobe Flash 10 64-bit for Linux.

Name:           adobe-flash
Version:        10.0.d20.7
Release:        1%{?dist}
Summary:        Adobe Flash player.

Group:          Application/Internet
License:        Proprietary
URL:            http://labs.adobe.com/technologies/flashplayer10/
Source0:        http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      x86_64
Requires:       firefox >= 3
Requires:       mozilla-filesystem

%description
The Adobe Flash player.

%prep
%setup -T -c -a 0

%install
install -D -m 644 libflashplayer.so $RPM_BUILD_ROOT%{_usr}/lib64/mozilla/plugins/libflashplayer.so

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_usr}/lib64/mozilla/plugins/libflashplayer.so

%changelog
* Tue Nov 18 2008 Silas Sewell <silas@sewell.ch> - 10.0.d20.7
- Created package.