--- /dev/null
+--- cpmio-1.1.1/lib/Makefile.am.orig 2001-07-07 15:14:31.000000000 +0200
++++ cpmio-1.1.1/lib/Makefile.am 2003-08-16 16:23:41.311514832 +0200
+@@ -2,6 +2,6 @@
+
+ INCLUDES=-I$(top_srcdir)/include
+
+-lib_LIBRARIES=libcpmio.a
+-libcpmio_a_SOURCES = conbdos.c cpmio_i.h termansi.c termcore.h \
++lib_LTLIBRARIES=libcpmio.la
++libcpmio_la_SOURCES = conbdos.c cpmio_i.h termansi.c termcore.h \
+ cpmio.c iosig.c termcore.c termvt52.c
+--- cpmio-1.1.1/check/Makefile.am.orig 2001-07-07 15:15:30.000000000 +0200
++++ cpmio-1.1.1/check/Makefile.am 2003-08-16 16:24:04.014063520 +0200
+@@ -1,7 +1,7 @@
+ ## Process this file with automake to produce Makefile.in
+
+ INCLUDES=-I$(top_srcdir)/include
+-LDADD=../lib/libcpmio.a
++LDADD=../lib/libcpmio.la
+
+ check_PROGRAMS = testio
+ testio_SOURCES = testio.c
+--- cpmio-1.1.1/configure.in.orig 2003-03-28 21:04:25.000000000 +0100
++++ cpmio-1.1.1/configure.in 2003-08-16 16:22:55.046548176 +0200
+@@ -15,11 +15,11 @@
+ AC_PROG_CPP
+ AC_PROG_INSTALL
+ AC_PROG_MAKE_SET
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+
+ dnl Checks for libraries.
+-AC_CHECK_LIB(ncurses, printw, LIBS="-lncurses $LIBS")
+-AC_CHECK_LIB(curses, printw, LIBS="-lcurses $LIBS")
++AC_CHECK_LIB(ncurses, printw, LIBS="-lncurses $LIBS",
++[AC_CHECK_LIB(curses, printw, LIBS="-lcurses $LIBS")])
+ if test x"$with_readline" = x"yes"; then
+ CFLAGS="$CFLAGS -DUSE_READLINE"
+ AC_CHECK_LIB(readline, readline)
--- /dev/null
+Summary: CPMIO - console access functions of an emulated CP/M computer
+Summary(pl): CPMIO - funcje dostêpu do konsoli emulowanego komputera CP/M
+Name: cpmio
+Version: 1.1.1
+Release: 1
+License: LGPL
+Group: Libraries
+Source0: http://www.seasip.demon.co.uk/Unix/Zxcc/%{name}-%{version}.tar.gz
+# Source0-md5: 0e1bd22ab7eb4ef9d11e0931dea7cdfc
+Patch0: %{name}-shared.patch
+URL: http://www.seasip.demon.co.uk/Unix/Zxcc/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: readline-devel
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+CPMIO is a library intended to support the console access functions of
+an emulated CP/M computer, on a Unix box.
+
+%description -l pl
+CPMIO to biblioteka maj±ca obs³ugiwaæ funkcje dostêpu do konsoli
+emulowanego komputera CP/M na maszynie uniksowej.
+
+%package devel
+Summary: Header files for cpmio library
+Summary(pl): Pliki nag³ówkowe biblioteki cpmio
+Group: Development/Libraries
+Requires: %{name} = %{version}
+Requires: readline-devel
+
+%description devel
+Header files for cpmio library.
+
+%description devel -l pl
+Pliki nag³ówkowe biblioteki cpmio.
+
+%package static
+Summary: Static cpmio library
+Summary(pl): Statyczna biblioteka cpmio
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}
+
+%description static
+Static cpmio library.
+
+%description static -l pl
+Statyczna biblioteka cpmio.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+CPPFLAGS="-I/usr/include/ncurses"
+%configure \
+ --with-readline
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib*.so
+%{_libdir}/lib*.la
+%{_includedir}/*.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a