98cd245
Summary:        Real-time Midi I/O Library
98cd245
Name:           portmidi
f6ea614
Version:        217
440d35c
Release:        35%{?dist}
98cd245
License:        MIT
98cd245
URL:            http://portmedia.sourceforge.net/
98cd245
Source0:        http://downloads.sourceforge.net/portmedia/%{name}-src-%{version}.zip
9ac4231
Source1:        pmdefaults.desktop
9ac4231
# Build fixes:
9ac4231
Patch0:         portmidi-cmake.patch
70c469c
# Fix multilib conflict RHBZ#831432
70c469c
Patch1:         portmidi-no_date_footer.patch
4417e21
Patch2:         portmidi-217-format-security.patch
4e362ee
Patch3:         portmidi-no.c++.patch
a9c77f2
Patch4:         portmidi-cyrex-0.21.patch
9ac4231
BuildRequires:  alsa-lib-devel
9ac4231
BuildRequires:  cmake
9ac4231
BuildRequires:  desktop-file-utils
70c469c
BuildRequires:  java-devel >= 1.7
9ac4231
BuildRequires:  jpackage-utils
702a6d0
BuildRequires:  python3-devel
a9c77f2
BuildRequires:  python3-Cython
9ac4231
BuildRequires:  doxygen
9ac4231
BuildRequires:  tex(latex)
4e362ee
BuildRequires:  gcc
98cd245
98cd245
%description
98cd245
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
98cd245
real-time MIDI input/output library. This package contains the PortMidi
9ac4231
libraries.
98cd245
98cd245
%package devel
98cd245
Summary:        Headers for developing programs that will use %{name}
70c469c
Requires:       %{name}%{?_isa} = %{version}-%{release}
98cd245
98cd245
%description devel
98cd245
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
98cd245
real-time MIDI input/output library. This package contains the header files
98cd245
and the documentation of PortMidi libraries.
98cd245
702a6d0
%package -n python3-%{name}
702a6d0
Summary:        Python 3 wrapper for %{name}
702a6d0
Requires:       %{name}%{?_isa} = %{version}-%{release}
702a6d0
702a6d0
%description -n python3-%{name}
702a6d0
PortMedia is a set of simple clean APIs and cross-platform library
702a6d0
implementations for music and other media. PortMidi sub-project provides a
702a6d0
real-time MIDI input/output library. This package contains the python
702a6d0
bindings of PortMidi libraries. It can send and receive MIDI data in
702a6d0
real-time from Python 3.
702a6d0
9ac4231
%package tools
Daniel Drake 5546faf
Summary:          Tools to configure and use %{name}
Daniel Drake 5546faf
Requires:         hicolor-icon-theme
70c469c
Requires:         java >= 1.7
Daniel Drake 5546faf
Requires:         jpackage-utils
70c469c
Requires:         %{name}%{?_isa} = %{version}-%{release}
9ac4231
9ac4231
%description tools
9ac4231
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
9ac4231
real-time MIDI input/output library. This package contains the PortMidi
9ac4231
configuration utility "pmdefaults" and some test applications.
98cd245
98cd245
%prep
98cd245
%setup -q -n %{name}
9ac4231
%patch0 -p1 -b .buildfix
70c469c
%patch1 -p1 -b .no.date
4417e21
%patch2 -p1 -b .fmt.security
4e362ee
%patch3 -p1 -b .no.c++
a9c77f2
%patch4 -p1 -b .pyrex021
a9c77f2
a9c77f2
# generate Cython C files during build
a9c77f2
rm -f pm_python/pyportmidi/_pyportmidi.c
9ac4231
3d0a3d0
# we do not use setup.py
3d0a3d0
rm -f pm_python/setup.py
3d0a3d0
9ac4231
# ewwww... binaries
9ac4231
rm -f portmidi_cdt.zip */*.exe */*/*.exe
98cd245
9ac4231
# Fix permissons and encoding issues:
98cd245
find . -name "*.c" -exec chmod -x {} \;
98cd245
find . -name "*.h" -exec chmod -x {} \;
9ac4231
for i in *.txt */*.txt */*/*.txt ; do
9ac4231
   chmod -x $i
98cd245
   sed 's|\r||' $i > $i.tmp
98cd245
   touch -r $i $i.tmp
98cd245
   mv -f $i.tmp $i
98cd245
done
98cd245
9ac4231
# Fedora's jni library location is different
9ac4231
sed -i 's|loadLibrary.*|load("%{_libdir}/%{name}/libpmjni.so");|' \
9ac4231
   pm_java/jportmidi/JPortMidiApi.java
9ac4231
9ac4231
# Add shebang, lib and class path
9ac4231
sed -i -e 's|^java|#!/bin/sh\njava \\\
9ac4231
   -Djava.library.path=%{_libdir}/%{name}/|' \
9ac4231
   -e 's|/usr/share/java/|%{_libdir}/%{name}/|' \
9ac4231
   pm_java/pmdefaults/pmdefaults
9ac4231
98cd245
%build
9ac4231
export JAVA_HOME=%{java_home}
f6ea614
%cmake -DCMAKE_SKIP_BUILD_RPATH=1 -DCMAKE_CACHEFILE_DIR=%{_builddir}/%{name}/build -DVERSION=%{version} .
9ac4231
make %{?_smp_flags}
98cd245
98cd245
# Build the doxygen documentation:
98cd245
doxygen
98cd245
272c92b
# Build python modules
f6ea614
pushd pm_python/pyportmidi
a9c77f2
   cython -2 _pyportmidi.pyx
f6ea614
   gcc %{optflags} -pthread -fPIC -c -o _pyportmidi.o -I../../pm_common \
a99bf3e
       -I../../porttime $(python3-config --includes) _pyportmidi.c
a99bf3e
   gcc -shared -o _pyportmidi.so _pyportmidi.o -lportmidi $(python3-config --libs) \
f6ea614
       -L../../build/Release
272c92b
popd
9ac4231
98cd245
%install
70c469c
%make_install
a08ee9d
98cd245
# Install the test applications:
98cd245
install -d %{buildroot}%{_libdir}/%{name}
272c92b
for app in latency midiclock midithread midithru mm qtest sysex test; do
9ac4231
   install -m 0755 build/Release/$app %{buildroot}%{_libdir}/%{name}/
98cd245
done
98cd245
9ac4231
# Fedora's jni library location is different
9ac4231
mv %{buildroot}%{_libdir}/libpmjni.so \
9ac4231
   %{buildroot}%{_libdir}/%{name}/
9ac4231
mv %{buildroot}%{_javadir}/pmdefaults.jar \
9ac4231
   %{buildroot}%{_libdir}/%{name}/
9ac4231
9ac4231
# pmdefaults icon
9ac4231
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac4231
install -pm 644 pm_java/pmdefaults/pmdefaults-icon.png \
9ac4231
   %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac4231
9ac4231
# desktop file
dbb87ce
mkdir -p %{buildroot}%{_datadir}/applications/
9ac4231
desktop-file-install \
dbb87ce
   --dir=%{buildroot}%{_datadir}/applications \
9ac4231
   %{SOURCE1}
9ac4231
9ac4231
# Why don't they install this header file?
9ac4231
install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}/
9ac4231
272c92b
# Install python modules
702a6d0
mkdir -p %{buildroot}%{python3_sitearch}/pyportmidi
Orcan Ogetbil cfbf01f
pushd pm_python/pyportmidi
702a6d0
   install -pm 755 _pyportmidi.so %{buildroot}%{python3_sitearch}/pyportmidi/
702a6d0
   install -pm 644 *.py %{buildroot}%{python3_sitearch}/pyportmidi/
f6ea614
popd
f6ea614
f6ea614
# we don't want to provide private python extension libs
f6ea614
%{?filter_setup:
702a6d0
%filter_provides_in %{python3_sitearch}/.*\.so$
f6ea614
%filter_setup
f6ea614
}
272c92b
821e5e8
# Remove duplicate library
821e5e8
rm -f %{buildroot}%{_libdir}/libportmidi_s.so
821e5e8
e7638df
%post -p /sbin/ldconfig
98cd245
e7638df
%postun -p /sbin/ldconfig
98cd245
98cd245
%files
4e362ee
%doc CHANGELOG.txt
4e362ee
%license license.txt
9ac4231
%{_libdir}/lib*.so.*
9ac4231
9ac4231
%files tools
821e5e8
%doc pm_java/pmdefaults/README.txt pm_cl/*
9ac4231
%{_libdir}/%{name}/
9ac4231
%{_bindir}/pmdefaults
9ac4231
%{_datadir}/icons/hicolor/128x128/apps/pmdefaults-icon.png
dbb87ce
%{_datadir}/applications/pmdefaults.desktop
9ac4231
702a6d0
%files -n python3-%{name}
702a6d0
%{python3_sitearch}/pyportmidi/
98cd245
98cd245
%files devel
9ac4231
%doc README.txt
70c469c
%doc html
98cd245
%{_includedir}/*
9ac4231
%{_libdir}/lib*.so
98cd245
98cd245
%changelog
440d35c
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 217-35
440d35c
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
440d35c
3d0a3d0
* Wed Jun 24 2020 Michael J Gruber <mjg@fedoraproject.org> - 217-34
3d0a3d0
- Make it clear that we do not use setup.py
3d0a3d0
- Remove obsolete README.
3d0a3d0
e84a743
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 217-33
e84a743
- Rebuilt for Python 3.9
e84a743
709dd5e
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 217-32
709dd5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
709dd5e
faa3b4d
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 217-31
faa3b4d
- Rebuilt for Python 3.8.0rc1 (#1748018)
faa3b4d
77ada75
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 217-30
77ada75
- Rebuilt for Python 3.8
77ada75
7a080fd
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 217-29
7a080fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7a080fd
a9c77f2
* Mon May 20 2019 Michael J Gruber <mjg@fedoraproject.org> - 217-28
a9c77f2
- Generate Cython C files during build
a9c77f2
9ce9e13
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 217-27
9ce9e13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
9ce9e13
Orcan Ogetbil cfbf01f
* Mon Oct 01 2018 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 217-26
Orcan Ogetbil cfbf01f
- Removed the Python2 binding
Orcan Ogetbil cfbf01f
0d508b5
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 217-25
0d508b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0d508b5
cfb3315
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 217-24
cfb3315
- Rebuilt for Python 3.7
cfb3315
4e362ee
* Thu Mar 08 2018 Michael J Gruber <mjg@fedoraproject.org> - 217-23
4e362ee
- Adjust to new guidelines (BR gcc)
4e362ee
1ab5fdb
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 217-22
1ab5fdb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1ab5fdb
c0fca52
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 217-21
c0fca52
- Python 2 binary package renamed to python2-portmidi
c0fca52
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
c0fca52
e8cc3c8
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-20
e8cc3c8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
e8cc3c8
c161be1
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-19
c161be1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c161be1
Igor Gnatenko 08f7387
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 217-18
Igor Gnatenko 08f7387
- Rebuild due to bug in RPM (RHBZ #1468476)
Igor Gnatenko 08f7387
702a6d0
* Thu Jun 08 2017 Gwyn Ciesla <limburgher@gmail.com> - 217-17
702a6d0
- Python 3 support.
702a6d0
1874983
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-16
1874983
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1874983
86aaf8a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-15
86aaf8a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
86aaf8a
e10cb1c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 217-14
e10cb1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e10cb1c
1e309ff
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-13
1e309ff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1e309ff
314626b
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-12
314626b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
314626b
4417e21
* Mon Jun 09 2014 Brendan Jones <brendan.jones.it@gmail.com> 217-11
4417e21
- -Wformat-security patch
4417e21
a119aea
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-10
a119aea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a119aea
dbb87ce
* Sun Aug 11 2013 Brendan Jones <brendan.jones.it@gmail.com> 217-9
dbb87ce
- Correct desktop file
dbb87ce
55c74c1
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-9
55c74c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
55c74c1
ededc98
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-8
ededc98
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ededc98
012a905
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-7
012a905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
012a905
70c469c
* Tue Jun 12 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-6
70c469c
- Fix multilib conflict RHBZ#831432
70c469c
- Don't bulid PDF doc, as it causes another multilib conflict
70c469c
- Specfile cleanup. Drop old GCJ-Java and Python bits
70c469c
cc154f3
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-5
cc154f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
cc154f3
60b33ea
* Thu Jun 23 2011 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-4
60b33ea
- Fix FTBFS due to changes in cmake. RHBZ #715668
60b33ea
Daniel Drake 5546faf
* Sat May 14 2011 Daniel Drake <dsd@laptop.org> - 217-3
Daniel Drake 5546faf
- move Requires:Java to tools subpackage, its not needed by the main package
Daniel Drake 5546faf
0c94464
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-2
0c94464
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0c94464
f6ea614
* Sat Oct 09 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-1
f6ea614
- Update to 217
f6ea614
36fe105
* Fri Jul 23 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-4
36fe105
- Fix python module build
36fe105
ddd1112
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 200-3
ddd1112
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ddd1112
821e5e8
* Sat Jan 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-2
821e5e8
- Remove duplicate library
821e5e8
272c92b
* Sat Jan 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-1
272c92b
- Update to 200.
272c92b
- Add python subpackage
272c92b
9ac4231
* Fri Nov 27 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 184-1
9ac4231
- Update to 184. Build system uses cmake now.
9ac4231
ddd859c
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 131-4
ddd859c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ddd859c
a08ee9d
* Tue Feb 24 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-3
a08ee9d
- Include pmutil.h in the devel package
a08ee9d
98cd245
* Tue Jan 27 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-2
98cd245
- Build and add doxygen documentation
98cd245
- Preserve some timestamps
98cd245
98cd245
* Sun Jan 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-1
98cd245
- New upstream release.
98cd245
98cd245
* Sun Dec 07 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 82-1
98cd245
- Initial release.