Name:          openpgm
Version:       @PACKAGE_VERSION@
Release:       1%{?dist}
Summary:       An implementation of the PGM reliable multicast protocol.
Group:         System Environment/Libraries
License:       LGPL 2.1 license
URL:           http://code.google.com/p/openpgm/
Source:        http://openpgm.googlecode.com/files/%{name}-%{version}.tar.gz
Prefix:        %{_prefix}
Buildroot:     %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python, perl

%description
OpenPGM is an open source implementation of the 
Pragmatic General Multicast (PGM) specification in RFC 3208 
available at www.ietf.org.

%package devel
Summary:  Development files and static library for the OpenPGM library
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
%ifos aix5.2 || %ifos aix5.3 || %ifos aix6.1 || %ifos aix7.1
Requires: pkg-config
%else
Requires: pkgconfig
%endif

%description devel
OpenPGM is an open source implementation of the 
Pragmatic General Multicast (PGM) specification in RFC 3208 
available at www.ietf.org.

This package contains OpenPGM related development libraries and header files.

%prep
%setup -q

%build
%configure
%{__make} %{?_smp_mflags}

%install
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

# Install the package to build area
%makeinstall

%post
%ifos linux
/sbin/ldconfig
%endif

%postun
%ifos linux
/sbin/ldconfig
%endif

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)

# libraries
%ifos aix5.2 || %ifos aix5.3 || %ifos aix6.1 || %ifos aix7.1
%{_libdir}/libpgm.a
%{_libdir}/libpgm-@RELEASE_INFO@.a
%else
%{_libdir}/libpgm-@RELEASE_INFO@.so.0
%{_libdir}/libpgm-@RELEASE_INFO@.so.0.0.@VERSION_MICRO@
%endif

%files devel
%defattr(-,root,root,-)
%{_includedir}/pgm-@RELEASE_INFO@/pgm/atomic.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/engine.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/error.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/gsi.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/if.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/in.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/list.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/macros.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/mem.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/messages.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/msgv.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/packet.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/pgm.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/skbuff.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/socket.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/time.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/tsi.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/types.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/version.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/winint.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/wininttypes.h
%{_includedir}/pgm-@RELEASE_INFO@/pgm/zinttypes.h

%ifos aix5.2 || %ifos aix5.3 || %ifos aix6.1 || %ifos aix7.1
%{_libdir}/libpgm.la
%else
%{_libdir}/libpgm.a
%{_libdir}/libpgm.la
%{_libdir}/libpgm.so
%endif
%{_libdir}/pkgconfig/openpgm-@RELEASE_INFO@.pc

%changelog
* Thu Sep 12 2013 Jim Hague <jim.hague@acm.org>
- Adapting for AIX

* Fri Apr 8 2011 Mikko Koppanen <mikko@kuut.io> 5.1.116-1
- Initial packaging
