blob: bfadd10e850b27344ed1be3b8b98feb6fcf20c51 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001Summary: ncurses-examples - example/test programs from ncurses
2%?mingw_package_header
3
micky3879b9f5e72025-07-08 18:04:53 -04004%global AppProgram ncurses-examples
5%global AppVersion MAJOR.MINOR
6%global AppRelease YYYYMMDD
7# $Id: mingw-ncurses-examples.spec,v 1.11 2023/02/25 23:10:34 tom Exp $
Steve Kondikae271bc2015-11-15 02:50:53 +01008Name: mingw32-ncurses6-examples
9Version: %{AppVersion}
10Release: %{AppRelease}
11License: X11
12Group: Development/Libraries
micky3879b9f5e72025-07-08 18:04:53 -040013URL: https://invisible-island.net/ncurses/%{AppProgram}.html
14Source: https://invisible-island.net/archives/%{AppProgram}/%{AppProgram}-%{release}.tgz
Steve Kondikae271bc2015-11-15 02:50:53 +010015
16BuildRequires: mingw32-ncurses6
17
18BuildRequires: mingw32-filesystem >= 95
19BuildRequires: mingw32-gcc
20BuildRequires: mingw32-binutils
21
22BuildRequires: mingw64-ncurses6
23
24BuildRequires: mingw64-filesystem >= 95
25BuildRequires: mingw64-gcc
26BuildRequires: mingw64-binutils
27
28%define CC_NORMAL -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
29%define CC_STRICT %{CC_NORMAL} -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
30
31%description -n mingw32-ncurses6-examples
32Cross-compiling support for ncurses to mingw32.
33
34The ncurses library routines are a terminal-independent method of
35updating character screens with reasonable optimization.
36
37This package is used for testing ABI 6 with cross-compiles to MinGW.
38
39%package -n mingw64-ncurses6-examples
40Summary: Curses library for MinGW64
41
42%description -n mingw64-ncurses6-examples
43Cross-compiling support for ncurses to mingw64.
44
45The ncurses library routines are a terminal-independent method of
46updating character screens with reasonable optimization.
47
48This package is used for testing ABI 6 with cross-compiles to MinGW.
49
50%prep
51
52# override location of bindir, e.g., to avoid conflict with pdcurses
micky3879b9f5e72025-07-08 18:04:53 -040053%global mingw32_bindir %{mingw32_exec_prefix}/bin/%{AppProgram}
54%global mingw64_bindir %{mingw64_exec_prefix}/bin/%{AppProgram}
55
56%global mingw32_datadir %{mingw32_datadir}/%{AppProgram}
57%global mingw64_datadir %{mingw64_datadir}/%{AppProgram}
58
59%global mingw32_libexec %{mingw32_libexecdir}/%{AppProgram}
60%global mingw64_libexec %{mingw64_libexecdir}/%{AppProgram}
Steve Kondikae271bc2015-11-15 02:50:53 +010061
62%define CFG_OPTS \\\
micky3879b9f5e72025-07-08 18:04:53 -040063 --enable-echo \\\
64 --enable-warnings \\\
65 --verbose \\\
66 --with-screen=ncursesw6
Steve Kondikae271bc2015-11-15 02:50:53 +010067
68%define debug_package %{nil}
69%setup -q -n ncurses-examples-%{release}
70
71%build
72mkdir BUILD-W32
73pushd BUILD-W32
74CFLAGS="%{CC_NORMAL}" \
75CC=%{mingw32_cc} \
micky3879b9f5e72025-07-08 18:04:53 -040076NCURSES_CONFIG_SUFFIX=dev \
77%mingw32_configure %{CFG_OPTS} \
78 --datadir=%{mingw32_datadir}
Steve Kondikae271bc2015-11-15 02:50:53 +010079make
80popd
81
82mkdir BUILD-W64
83pushd BUILD-W64
84CFLAGS="%{CC_NORMAL}" \
85CC=%{mingw64_cc} \
micky3879b9f5e72025-07-08 18:04:53 -040086%mingw64_configure %{CFG_OPTS} \
87 --datadir=%{mingw32_datadir}
Steve Kondikae271bc2015-11-15 02:50:53 +010088make
89popd
90
91%install
92rm -rf $RPM_BUILD_ROOT
93
94pushd BUILD-W32
95%{mingw32_make} install DESTDIR=$RPM_BUILD_ROOT
96popd
97
98pushd BUILD-W64
99%{mingw64_make} install DESTDIR=$RPM_BUILD_ROOT
100popd
101
Steve Kondikae271bc2015-11-15 02:50:53 +0100102%files -n mingw32-ncurses6-examples
micky3879b9f5e72025-07-08 18:04:53 -0400103%defattr(-,root,root,-)
Steve Kondikae271bc2015-11-15 02:50:53 +0100104%{mingw32_bindir}/*
micky3879b9f5e72025-07-08 18:04:53 -0400105%{mingw32_datadir}/*
106%{mingw32_libexec}/*
Steve Kondikae271bc2015-11-15 02:50:53 +0100107
108%files -n mingw64-ncurses6-examples
micky3879b9f5e72025-07-08 18:04:53 -0400109%defattr(-,root,root,-)
Steve Kondikae271bc2015-11-15 02:50:53 +0100110%{mingw64_bindir}/*
micky3879b9f5e72025-07-08 18:04:53 -0400111%{mingw64_datadir}/*
112%{mingw64_libexec}/*
Steve Kondikae271bc2015-11-15 02:50:53 +0100113
114%changelog
115
micky3879b9f5e72025-07-08 18:04:53 -0400116* Sat Feb 25 2023 Thomas Dickey
117- use libexecdir for programs rather than subdir of bindir
118- amend URLs per rpmlint
119
120* Sat Nov 16 2019 Thomas Dickey
121- modify clean-rule to work around Fedora NFS bugs.
122
Steve Kondikae271bc2015-11-15 02:50:53 +0100123* Sat Oct 19 2013 Thomas E. Dickey
124- initial version