ncurses 6.3 - patch 20220514
[ncurses.git] / test / package / ncurses-examples.spec
1 Summary: example/test programs from ncurses
2 %global AppProgram ncurses-examples
3 %global AltProgram ncursest-examples
4 %global AppVersion MAJOR.MINOR
5 %global AppRelease YYYYMMDD
6 # $Id: ncurses-examples.spec,v 1.21 2021/12/19 00:13:46 tom Exp $
7 Name: %{AppProgram}
8 Version: %{AppVersion}
9 Release: %{AppRelease}
10 License: MIT
11 Group: Applications/Development
12 URL: ftp://ftp.invisible-island.net/pub/%{AppProgram}
13 Source0: %{AppProgram}-%{AppRelease}.tgz
14 Packager: Thomas Dickey <dickey@invisible-island.net>
15
16 %description
17 These are the example/test programs from the ncurses MAJOR.MINOR distribution,
18 for patch-date YYYYMMDD.
19
20 This package installs in "bin/%{AppProgram}" to avoid conflict with other
21 packages.
22
23 %package -n %{AltProgram}
24 Summary:  examples/test programs from ncurses with POSIX thread support
25
26 %description -n %{AltProgram}
27 These are the example/test programs from the ncurses MAJOR.MINOR distribution,
28 for patch-date YYYYMMDD, using the "ncurseswt" library to demonstrate the
29 use of POSIX threads, e.g., in ditto, rain, and worm.
30
31 This package installs in "bin/%{AltProgram}" to avoid conflict with other
32 packages.
33
34 %prep
35
36 %setup -q -n %{AppProgram}-%{AppRelease}
37
38 %define debug_package %{nil}
39
40 %build
41
42 %global _configure ../configure
43 %define my_srcdir ..
44
45 mkdir BUILD-%{AppProgram}
46 pushd BUILD-%{AppProgram}
47 INSTALL_PROGRAM='${INSTALL}' \
48 NCURSES_CONFIG_SUFFIX=dev \
49 CONFIGURE_TOP=%{my_srcdir} \
50 %configure \
51         --target %{_target_platform} \
52         --prefix=%{_prefix} \
53         --datadir=%{_datarootdir}/%{AppProgram} \
54         --with-screen=ncursesw6dev \
55         --disable-rpath-hack
56
57 make
58 popd
59
60 mkdir BUILD-%{AltProgram}
61 pushd BUILD-%{AltProgram}
62 INSTALL_PROGRAM='${INSTALL}' \
63 NCURSES_CONFIG_SUFFIX=dev \
64 CONFIGURE_TOP=%{my_srcdir} \
65 %configure \
66         --target %{_target_platform} \
67         --prefix=%{_prefix} \
68         --datadir=%{_datarootdir}/%{AltProgram} \
69         --with-screen=ncursestw6dev \
70         --disable-rpath-hack
71
72 make
73 popd
74
75 %install
76 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
77
78 pushd BUILD-%{AppProgram}
79 make install PACKAGE=%{AppProgram} DESTDIR=$RPM_BUILD_ROOT
80 popd
81
82 pushd BUILD-%{AltProgram}
83 make install PACKAGE=%{AltProgram} DESTDIR=$RPM_BUILD_ROOT
84 popd
85
86 %clean
87 if rm -rf $RPM_BUILD_ROOT; then
88   echo OK
89 else
90   find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
91 fi
92 exit 0
93
94 %files -n %{AppProgram}
95 %defattr(-,root,root)
96 %{_bindir}/%{AppProgram}
97 %{_libexecdir}/%{AppProgram}/*
98 %{_datarootdir}/%{AppProgram}/*
99
100 %files -n %{AltProgram}
101 %defattr(-,root,root)
102 %{_bindir}/%{AltProgram}
103 %{_libexecdir}/%{AltProgram}/*
104 %{_datarootdir}/%{AltProgram}/*
105
106 %changelog
107 # each patch should add its ChangeLog entries here
108
109 * Sat Dec 18 2021 Thomas Dickey
110 - use libexecdir for programs rather than subdir of bindir
111
112 * Sat Nov 16 2019 Thomas Dickey
113 - modify clean-rule to work around Fedora NFS bugs.
114
115 * Sat Nov 11 2017 Thomas Dickey
116 - add example data-files
117 - use rpm built-in "configure"
118 - suppress debug-package
119
120 * Thu Mar 25 2010 Thomas Dickey
121 - initial version