d83ff220b0d4bb171de60c2f3b9324000df51a83
[ncurses.git] / package / ncurses.spec
1 Summary: shared libraries for terminal handling
2 Name: ncurses6
3 Version: 6.1
4 Release: 20180428
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 CFG_OPTS \\\
42         --target %{_target_platform} \\\
43         --prefix=%{_prefix} \\\
44         --bindir=%{_bindir} \\\
45         --includedir=%{_includedir} \\\
46         --libdir=%{_libdir} \\\
47         --includedir='${prefix}/include' \\\
48         --disable-echo \\\
49         --disable-getcap \\\
50         --disable-leaks \\\
51         --disable-macros  \\\
52         --disable-overwrite  \\\
53         --disable-termcap \\\
54         --enable-hard-tabs \\\
55         --enable-opaque-curses \\\
56         --enable-opaque-form \\\
57         --enable-opaque-menu \\\
58         --enable-opaque-panel \\\
59         --enable-pc-files \\\
60         --enable-rpath \\\
61         --enable-warnings \\\
62         --enable-wgetch-events \\\
63         --enable-widec \\\
64         --enable-xmc-glitch \\\
65         --program-suffix=%{MY_ABI} \\\
66         --verbose \\\
67         --with-abi-version=%{MY_ABI} \\\
68         --with-config-suffix=dev \\\
69         --with-cxx-shared \\\
70         --with-default-terminfo-dir=%{MYDATA} \\\
71         --with-develop \\\
72         --with-extra-suffix=%{MY_ABI} \\\
73         --with-install-prefix=$RPM_BUILD_ROOT \\\
74         --with-pkg-config-libdir=%{MY_PKG} \\\
75         --with-shared \\\
76         --with-terminfo-dirs=%{MYDATA}:/usr/share/terminfo \\\
77         --with-termlib \\\
78         --with-ticlib \\\
79         --with-trace \\\
80         --with-versioned-syms \\\
81         --with-xterm-kbs=DEL \\\
82         --without-ada \\\
83         --without-debug \\\
84         --without-normal
85
86 %define debug_package %{nil}
87 %setup -q -n ncurses-%{version}-%{release}
88
89 %build
90
91 mkdir BUILD-ncurses6
92 pushd BUILD-ncurses6
93 CFLAGS="%{CC_NORMAL}" \
94 RPATH_LIST=../lib:%{_prefix}/lib \
95 ../configure %{CFG_OPTS}
96 make
97 popd
98
99 mkdir BUILD-ncursest6
100 pushd BUILD-ncursest6
101 CFLAGS="%{CC_NORMAL}" \
102 RPATH_LIST=../lib:%{_prefix}/lib \
103 ../configure %{CFG_OPTS} \
104         --enable-interop \
105         --enable-sp-funcs \
106         --program-suffix=t%{MY_ABI} \
107         --with-pthread
108 make
109 popd
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 pushd BUILD-ncurses6
115 make install.libs install.progs
116 rm -f test/ncurses
117 ( cd test && make ncurses LOCAL_LIBDIR=%{_libdir} && mv ncurses $RPM_BUILD_ROOT/%{_bindir}/ncurses%{MY_ABI} )
118 popd
119
120 pushd BUILD-ncursest6
121 make install.libs install.progs
122 rm -f test/ncurses
123 ( cd test && make ncurses LOCAL_LIBDIR=%{_libdir} && mv ncurses $RPM_BUILD_ROOT/%{_bindir}/ncursest%{MY_ABI} )
124 popd
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %files -n ncurses6
130 %defattr(-,root,root,-)
131 %{_bindir}/*
132 %{_includedir}/*
133 %{_libdir}/*
134
135 %files -n ncursest6
136 %defattr(-,root,root,-)
137 %{_bindir}/*
138 %{_includedir}/*
139 %{_libdir}/*
140
141 %changelog
142
143 * Sat Feb 10 2018 Thomas E. Dickey
144 - add ncursest6 package
145 - add several development features
146
147 * Mon Jan 01 2018 Thomas E. Dickey
148 - drop redundant files pattern for "*.pc"
149
150 * Tue Dec 26 2017 Thomas E. Dickey
151 - add --with-config-suffix option
152
153 * Sun Apr 26 2015 Thomas E. Dickey
154 - move package to /usr
155
156 * Sun Apr 12 2015 Thomas E. Dickey
157 - factor-out MY_ABI
158
159 * Sat Mar 09 2013 Thomas E. Dickey
160 - add --with-cxx-shared option to demonstrate c++ binding as shared library
161
162 * Sat Oct 27 2012 Thomas E. Dickey
163 - add ncurses program as "ncurses6" to provide demonstration.
164
165 * Fri Jun 08 2012 Thomas E. Dickey
166 - initial version.