diff --git a/.cvsignore b/.cvsignore index e69de29..91fab93 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +portmidi-src-131.zip diff --git a/import.log b/import.log new file mode 100644 index 0000000..0279d42 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +portmidi-131-2_fc10:F-10:portmidi-131-2.fc10.src.rpm:1233124298 diff --git a/portmidi-shared.patch b/portmidi-shared.patch new file mode 100644 index 0000000..99a6c38 --- /dev/null +++ b/portmidi-shared.patch @@ -0,0 +1,111 @@ +diff -rupN portmidi.old/pm_common/portmidi.c portmidi/pm_common/portmidi.c +--- portmidi.old/pm_common/portmidi.c 2009-01-02 18:06:13.000000000 -0500 ++++ portmidi/pm_common/portmidi.c 2009-01-11 01:20:21.000000000 -0500 +@@ -56,7 +56,7 @@ static void prompt_and_exit(void) + printf("type ENTER..."); + fgets(line, STRING_MAX, stdin); + /* this will clean up open ports: */ +- exit(-1); ++ // DO NOT EXIT SINCE THIS IS BEING COMPILED AS A SHARED LIBRARY // exit(-1); + } + + +diff -rupN portmidi.old/pm_linux/Makefile portmidi/pm_linux/Makefile +--- portmidi.old/pm_linux/Makefile 2008-06-13 20:23:43.000000000 -0400 ++++ portmidi/pm_linux/Makefile 2009-01-11 01:24:28.000000000 -0500 +@@ -30,11 +30,13 @@ VFLAGS = -DPMALSA + # ALSALIB = + # VFLAGS = -DPMNULL + +-pmlib = pm_linux/libportmidi.a ++pmlib = pm_linux/libportmidi.so.0$(VERSION) + +-ptlib = porttime/libporttime.a ++ptlib = porttime/libporttime.so.0$(VERSION) + +-CC = gcc $(VFLAGS) $(PMFLAGS) -g -Ipm_common -Iporttime ++CC = gcc $(CFLAGS) $(VFLAGS) $(PMFLAGS) -g -Ipm_common -Iporttime ++ ++INSTALL = install + + pmobjects = pm_common/pmutil.o $(versions) pm_linux/pmlinux.o \ + pm_common/portmidi.o +@@ -43,14 +45,18 @@ ptobjects = porttime/porttime.o porttime + + current: all + +-all: $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread \ ++all: $(ptlib) $(pmlib) pm_test/test pm_test/sysex pm_test/midithread \ + pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm + + $(pmlib): pm_linux/Makefile $(pmobjects) +- ar -cr $(pmlib) $(pmobjects) ++ $(CC) -shared $(ALSALIB) $(pmobjects) -Wl,-soname -Wl,libportmidi.so.0 -Lporttime -lporttime -o $(pmlib) ++ ln -sf libportmidi.so.0$(VERSION) pm_linux/libportmidi.so ++ ln -sf libportmidi.so.0$(VERSION) pm_linux/libportmidi.so.0 + + $(ptlib): pm_linux/Makefile $(ptobjects) +- ar -cr $(ptlib) $(ptobjects) ++ $(CC) -shared $(ptobjects) -Wl,-soname -Wl,libporttime.so.0 -Wl,-l,pthread -o $(ptlib) ++ ln -sf libporttime.so.0$(VERSION) porttime/libporttime.so ++ ln -sf libporttime.so.0$(VERSION) porttime/libporttime.so.0 + + pm_linux/pmlinuxalsa.o: pm_linux/Makefile pm_linux/pmlinuxalsa.c pm_linux/pmlinuxalsa.h + $(CC) -c pm_linux/pmlinuxalsa.c -o pm_linux/pmlinuxalsa.o +@@ -96,3 +102,15 @@ cleanest: cleaner + + backup: cleanest + cd ..; zip -r portmidi.zip portmidi ++ ++install: ++ $(INSTALL) -d $(DESTDIR)/$(INCLUDEDIR)/ ++ $(INSTALL) -m 644 pm_common/portmidi.h $(DESTDIR)/$(INCLUDEDIR)/ ++ $(INSTALL) -m 644 porttime/porttime.h $(DESTDIR)/$(INCLUDEDIR)/ ++ $(INSTALL) -d $(DESTDIR)/$(LIBDIR)/ ++ $(INSTALL) pm_linux/libportmidi.so.0.* $(DESTDIR)/$(LIBDIR)/ ++ $(INSTALL) porttime/libporttime.so.0.* $(DESTDIR)/$(LIBDIR)/ ++ cp -a porttime/libporttime.so $(DESTDIR)/$(LIBDIR)/ ++ cp -a porttime/libporttime.so.0 $(DESTDIR)/$(LIBDIR)/ ++ cp -a pm_linux/libportmidi.so $(DESTDIR)/$(LIBDIR)/ ++ cp -a pm_linux/libportmidi.so.0 $(DESTDIR)/$(LIBDIR)/ +diff -rupN portmidi.old/pm_linux/pmlinuxalsa.c portmidi/pm_linux/pmlinuxalsa.c +--- portmidi.old/pm_linux/pmlinuxalsa.c 2008-06-13 20:23:43.000000000 -0400 ++++ portmidi/pm_linux/pmlinuxalsa.c 2009-01-11 01:26:06.000000000 -0500 +@@ -243,8 +243,8 @@ static PmError alsa_out_close(PmInternal + alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor; + if (!desc) return pmBadPtr; + +- if (pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port, +- desc->client, desc->port)) { ++ if ((pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port, ++ desc->client, desc->port))) { + // if there's an error, try to delete the port anyway, but don't + // change the pm_hosterror value so we retain the first error + snd_seq_delete_port(seq, desc->this_port); +@@ -333,8 +333,8 @@ static PmError alsa_in_close(PmInternal + { + alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor; + if (!desc) return pmBadPtr; +- if (pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port, +- desc->client, desc->port)) { ++ if ((pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port, ++ desc->client, desc->port))) { + snd_seq_delete_port(seq, desc->this_port); /* try to close port */ + } else { + pm_hosterror = snd_seq_delete_port(seq, desc->this_port); +diff -rupN portmidi.old/pm_linux/pmlinux.c portmidi/pm_linux/pmlinux.c +--- portmidi.old/pm_linux/pmlinux.c 2006-11-29 18:37:09.000000000 -0500 ++++ portmidi/pm_linux/pmlinux.c 2009-01-11 01:26:48.000000000 -0500 +@@ -28,10 +28,10 @@ PmError pm_init() + * devices. + */ + #ifdef PMALSA +- pm_linuxalsa_init(); ++ return pm_linuxalsa_init(); + #endif + #ifdef PMNULL +- pm_linuxnull_init(); ++ return pm_linuxnull_init(); + #endif + return pmNoError; + } diff --git a/portmidi.spec b/portmidi.spec new file mode 100644 index 0000000..54f8645 --- /dev/null +++ b/portmidi.spec @@ -0,0 +1,103 @@ +Summary: Real-time Midi I/O Library +Name: portmidi +Version: 131 +Release: 2%{?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 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 +* Tue Jan 27 2009 Orcan Ogetbil 131-2 +- Build and add doxygen documentation +- Preserve some timestamps + +* Sun Jan 11 2009 Orcan Ogetbil 131-1 +- New upstream release. + +* Sun Dec 07 2008 Orcan Ogetbil 82-1 +- Initial release. diff --git a/sources b/sources index e69de29..be3f9fb 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +1715bb3d9f63c6b259720709ef43b534 portmidi-src-131.zip