termcap: Rename the library as libtermcap-0.dll for compatibility with
[fedora-mingw.git] / readline / mingw32-readline.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-readline
8 Version:        5.2
9 Release:        2%{?dist}
10 Summary:        MinGW port of readline for editing typed command lines
11
12 License:        GPLv2+
13 Group:          System Environment/Libraries
14 URL:            http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
15 Source0:        ftp://ftp.gnu.org/gnu/readline/readline-%{version}.tar.gz
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17
18 Patch1:         readline-5.2-shlib.patch
19 Patch2:         readline-5.2-001.patch
20 Patch3:         readline-5.2-002.patch
21 Patch4:         readline-5.2-003.patch
22 Patch5:         readline-5.2-004.patch
23 Patch6:         readline-5.2-005.patch
24 Patch7:         readline-5.2-006.patch
25 Patch8:         readline-5.2-007.patch
26 Patch9:         readline-5.2-008.patch
27 Patch10:        readline-5.2-009.patch
28 Patch11:        readline-5.2-010.patch
29 Patch12:        readline-5.2-011.patch
30 Patch13:        readline-5.2-redisplay-sigint.patch
31
32 BuildArch:      noarch
33
34 BuildRequires:  mingw32-filesystem >= 29
35 BuildRequires:  mingw32-gcc
36 BuildRequires:  mingw32-binutils
37 BuildRequires:  mingw32-termcap >= 1.3.1-3
38
39
40 %description
41 The Readline library provides a set of functions that allow users to
42 edit command lines. Both Emacs and vi editing modes are available. The
43 Readline library includes additional functions for maintaining a list
44 of previously-entered command lines for recalling or editing those
45 lines, and for performing csh-like history expansion on previous
46 commands.
47
48 This is a port of the library and development tools to Windows.
49
50
51 %prep
52 %setup -q -n readline-%{version}
53 %patch1 -p1 -b .shlib
54 %patch2 -p0 -b .001
55 %patch3 -p0 -b .002
56 %patch4 -p0 -b .003
57 %patch5 -p0 -b .004
58 %patch6 -p0 -b .005
59 %patch7 -p0 -b .006
60 %patch8 -p0 -b .007
61 %patch9 -p0 -b .008
62 %patch10 -p0 -b .009
63 %patch11 -p0 -b .010
64 %patch12 -p0 -b .011
65 %patch13 -p1 -b .redisplay-sigint
66
67 pushd examples
68 rm -f rlfe/configure
69 iconv -f iso8859-1 -t utf8 -o rl-fgets.c{_,}
70 touch -r rl-fgets.c{,_}
71 mv -f rl-fgets.c{_,}
72 popd
73
74
75 %build
76 %{_mingw32_configure} --enable-shared
77 make SHLIB_LIBS=-ltermcap
78
79 # Rebuild the DLLs correctly and create implibs.
80 pushd shlib
81 %{_mingw32_cc} -shared -o readline.dll -Wl,--out-implib,readline.dll.a readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so -ltermcap
82 %{_mingw32_cc} -shared -o history.dll -Wl,--out-implib,history.dll.a history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so xmalloc.so
83 popd
84
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 make DESTDIR=$RPM_BUILD_ROOT install
89
90 # Remove the fake .so files and install our DLLs and implibs.
91 pushd shlib
92 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/lib*.so.*
93 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
94 install readline.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
95 install readline.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
96 install history.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
97 install history.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
98 popd
99
100 # Don't want the info files or manpages which duplicate the native package.
101 rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/{info,man}
102
103 # Don't want the static library.
104 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libhistory.a
105 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libreadline.a
106
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111
112 %files
113 %defattr(-,root,root)
114 %{_mingw32_bindir}/readline.dll
115 %{_mingw32_bindir}/history.dll
116 %{_mingw32_libdir}/readline.dll.a
117 %{_mingw32_libdir}/history.dll.a
118 %{_mingw32_includedir}/readline/
119
120
121 %changelog
122 * Fri Oct 31 2008 Richard W.M. Jones <rjones@example.com> - 5.2-2
123 - Rebuild against latest termcap.
124
125 * Thu Sep 25 2008 Richard W.M. Jones <rjones@example.com> - 5.2-1
126 - Initial RPM release.