ncurses 6.1 - patch 20180526
[ncurses.git] / package / ncurses.spec
1 Summary: shared libraries for terminal handling
2 Name: ncurses6
3 Version: 6.1
4 Release: 20180526
5 License: X11
6 Group: Development/Libraries
7 Source: ncurses-%{version}-%{release}.tgz
8 # URL: https://invisible-island.net/ncurses/
9
10 %define CC_NORMAL -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
11 %define CC_STRICT %{CC_NORMAL} -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
12
13 %global MY_ABI 6
14
15 # save value before redefining
16 %global sys_libdir %{_libdir}
17
18 # was redefined...
19 #global _prefix /usr/local/ncurses#{MY_ABI}
20
21 %global MY_PKG %{sys_libdir}/pkgconfig
22 %define MYDATA /usr/local/ncurses/share/terminfo
23
24 %description
25 The ncurses library routines are a terminal-independent method of
26 updating character screens with reasonable optimization.
27
28 This package is used for testing ABI %{MY_ABI}.
29
30 %package -n ncursest6
31 Summary:        Curses library with POSIX thread support.
32
33 %description -n ncursest6
34 The ncurses library routines are a terminal-independent method of
35 updating character screens with reasonable optimization.
36
37 This package is used for testing ABI %{MY_ABI} with POSIX threads.
38
39 %prep
40
41 %define debug_package %{nil}
42 %setup -q -n ncurses-%{version}-%{release}
43
44 %build
45 %define my_srcdir ..
46 %define CFG_OPTS \\\
47         --target %{_target_platform} \\\
48         --prefix=%{_prefix} \\\
49         --bindir=%{_bindir} \\\
50         --includedir=%{_includedir} \\\
51         --libdir=%{_libdir} \\\
52         --includedir='${prefix}/include' \\\
53         --disable-echo \\\
54         --disable-getcap \\\
55         --disable-leaks \\\
56         --disable-macros  \\\
57         --disable-overwrite  \\\
58         --disable-termcap \\\
59         --enable-hard-tabs \\\
60         --enable-opaque-curses \\\
61         --enable-opaque-form \\\
62         --enable-opaque-menu \\\
63         --enable-opaque-panel \\\
64         --enable-pc-files \\\
65         --enable-rpath \\\
66         --enable-warnings \\\
67         --enable-wgetch-events \\\
68         --enable-widec \\\
69         --enable-xmc-glitch \\\
70         --program-suffix=%{MY_ABI} \\\
71         --verbose \\\
72         --with-abi-version=%{MY_ABI} \\\
73         --with-config-suffix=dev \\\
74         --with-cxx-shared \\\
75         --with-default-terminfo-dir=%{MYDATA} \\\
76         --with-develop \\\
77         --with-extra-suffix=%{MY_ABI} \\\
78         --with-install-prefix=$RPM_BUILD_ROOT \\\
79         --with-pkg-config-libdir=%{MY_PKG} \\\
80         --with-shared \\\
81         --with-terminfo-dirs=%{MYDATA}:/usr/share/terminfo \\\
82         --with-termlib \\\
83         --with-ticlib \\\
84         --with-trace \\\
85         --with-versioned-syms \\\
86         --with-xterm-kbs=DEL \\\
87         --without-ada \\\
88         --without-debug \\\
89         --without-normal
90
91 %global _configure ../configure
92
93 mkdir BUILD-ncurses6
94 pushd BUILD-ncurses6
95 CFLAGS="%{CC_NORMAL}" \
96 RPATH_LIST=../lib:%{_libdir} \
97 CONFIGURE_TOP=%{my_srcdir} \
98 %configure %{CFG_OPTS}
99 make
100 popd
101
102 mkdir BUILD-ncursest6
103 pushd BUILD-ncursest6
104 CFLAGS="%{CC_NORMAL}" \
105 RPATH_LIST=../lib:%{_libdir} \
106 CONFIGURE_TOP=%{my_srcdir} \
107 %configure %{CFG_OPTS} \
108         --enable-interop \
109         --enable-sp-funcs \
110         --program-suffix=t%{MY_ABI} \
111         --with-pthread
112 make
113 popd
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117
118 pushd BUILD-ncurses6
119 make install.libs install.progs
120 rm -f test/ncurses
121 ( cd test && make ncurses LOCAL_LIBDIR=%{_libdir} && mv ncurses $RPM_BUILD_ROOT/%{_bindir}/ncurses%{MY_ABI} )
122 popd
123
124 pushd BUILD-ncursest6
125 make install.libs install.progs
126 rm -f test/ncurses
127 ( cd test && make ncurses LOCAL_LIBDIR=%{_libdir} && mv ncurses $RPM_BUILD_ROOT/%{_bindir}/ncursest%{MY_ABI} )
128 popd
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %files -n ncurses6
134 %defattr(-,root,root,-)
135 %{_bindir}/*
136 %{_includedir}/*
137 %{_libdir}/*
138 %exclude %{_bindir}/tict6
139 %exclude %{_bindir}/toet6
140 %exclude %{_bindir}/tabst6
141 %exclude %{_bindir}/resett6
142 %exclude %{_bindir}/???*tt6
143 %exclude %{_bindir}/?????*t6
144 %exclude %{_bindir}/*tw6*
145 %exclude %dir %{_includedir}/*tw6*
146 %exclude %{_includedir}/*tw6*/*
147 %exclude %{_libdir}/*tw6*
148 %exclude %{_libdir}/pkgconfig/*tw6*
149
150 %files -n ncursest6
151 %defattr(-,root,root,-)
152 %{_bindir}/tict6
153 %{_bindir}/toet6
154 %{_bindir}/tabst6
155 %{_bindir}/???*tt6
156 %{_bindir}/?????*t6
157 %{_bindir}/*tw6*
158 %{_includedir}/*tw6*
159 %{_libdir}/*tw6*
160 %{_libdir}/pkgconfig/*tw6*
161
162 %changelog
163
164 * Sat May 26 2018 Thomas E. Dickey
165 - use predefined configure-macro
166 - separate ncurses6/ncursest6 packages
167
168 * Sat Feb 10 2018 Thomas E. Dickey
169 - add ncursest6 package
170 - add several development features
171
172 * Mon Jan 01 2018 Thomas E. Dickey
173 - drop redundant files pattern for "*.pc"
174
175 * Tue Dec 26 2017 Thomas E. Dickey
176 - add --with-config-suffix option
177
178 * Sun Apr 26 2015 Thomas E. Dickey
179 - move package to /usr
180
181 * Sun Apr 12 2015 Thomas E. Dickey
182 - factor-out MY_ABI
183
184 * Sat Mar 09 2013 Thomas E. Dickey
185 - add --with-cxx-shared option to demonstrate c++ binding as shared library
186
187 * Sat Oct 27 2012 Thomas E. Dickey
188 - add ncurses program as "ncurses6" to provide demonstration.
189
190 * Fri Jun 08 2012 Thomas E. Dickey
191 - initial version.