Blob Blame History Raw
Summary:        Real-time Midi I/O Library
Name:           portmidi
Version:        131
Release:        4%{?dist}
License:        MIT
Group:          System Environment/Libraries
URL:            http://portmedia.sourceforge.net/
Source0:        http://downloads.sourceforge.net/portmedia/%{name}-src-%{version}.zip
# For building shared libraries:
Patch0:         portmidi-shared.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  alsa-lib-devel doxygen tex(latex)

%description
PortMedia is a set of simple clean APIs and cross-platform library
implementations for music and other media. PortMidi subproject provides a
real-time MIDI input/output library. This package contains the PortMidi
libraries and some test applications.

%package devel
Summary:        Headers for developing programs that will use %{name}
Group:          System Environment/Libraries
Requires:       %{name} = %{version}-%{release}

%description devel
PortMedia is a set of simple clean APIs and cross-platform library
implementations for music and other media. PortMidi subproject provides a
real-time MIDI input/output library. This package contains the header files
and the documentation of PortMidi libraries.


%prep
%setup -q -n %{name}
%patch0 -p1

# Fix permissions and encoding issues:
find . -name "*.c" -exec chmod -x {} \;
find . -name "*.h" -exec chmod -x {} \;
for i in *.txt */*.txt ; do
   sed 's|\r||' $i > $i.tmp
   touch -r $i $i.tmp
   mv -f $i.tmp $i
done

# Preserve timestamps:
sed -i 's|\(INSTALL = install\)|\1 -p|' pm_linux/Makefile

%build
# Parallel make not supported
make -f pm_linux/Makefile \
     CFLAGS="%{optflags} -fPIC" \
     VERSION=".%{version}" 

# Build the doxygen documentation:
doxygen
pushd latex
   make %{?_smp_flags}
popd

%install
rm -rf %{buildroot}
# Install the libraries and headers:
make -f pm_linux/Makefile install \
     DESTDIR=%{buildroot} \
     LIBDIR=%{_libdir} \
     INCLUDEDIR=%{_includedir}

install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}

# Install the test applications:
install -d %{buildroot}%{_libdir}/%{name}
for app in latency midithread midithru mm qtest sysex test; do
   install -m 0755 pm_test/$app %{buildroot}%{_libdir}/%{name}
done

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGELOG.txt license.txt
%{_libdir}/*.so.*
%{_libdir}/%{name}

%files devel
%defattr(-,root,root,-)
%doc CHANGELOG.txt license.txt README.txt pm_linux/README_LINUX.txt
%doc html latex/*.pdf
%{_includedir}/*
%{_libdir}/*.so

%changelog
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 131-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-3
- Include pmutil.h in the devel package

* Tue Jan 27 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-2
- Build and add doxygen documentation
- Preserve some timestamps

* Sun Jan 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-1
- New upstream release.

* Sun Dec 07 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 82-1
- Initial release.