]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/package/AdaCurses.spec
be18e68dc559b175859e8c21c58aeaebdc98262c
[ncurses.git] / Ada95 / package / AdaCurses.spec
1 Summary: Ada95 binding for ncurses
2 %define AppProgram AdaCurses
3 %define AppVersion MAJOR.MINOR
4 %define AppRelease YYYYMMDD
5 # $Id: AdaCurses.spec,v 1.33 2024/06/01 22:51:57 tom Exp $
6 Name: %{AppProgram}
7 Version: %{AppVersion}
8 Release: %{AppRelease}
9 License: MIT
10 Group: Applications/Development
11 URL: ftp://ftp.invisible-island.net/%{AppProgram}
12 Source0: %{AppProgram}-%{AppRelease}.tgz
13 Packager: Thomas Dickey <dickey@invisible-island.net>
14
15 %description
16 This is the Ada95 binding from the ncurses MAJOR.MINOR distribution, for
17 patch-date YYYYMMDD.
18
19 In addition to a library, this package installs sample programs in
20 "bin/%{AppProgram}" to avoid conflict with other packages.
21 %prep
22
23 %global is_mandriva %(test -f /etc/mandriva-release && echo 1 || echo 0)
24 %global is_redhat   %(test -f /etc/redhat-release && echo 1 || echo 0)
25 %global is_suse     %(if grep -E -i '(opensuse)' /etc/issue >/dev/null; then echo 1; else echo 0; fi)
26
27 %define debug_package %{nil}
28
29 %define need_filter %(if grep -E -i '(red hat|fedora)' /etc/issue >/dev/null; then echo 1; elif test -f /etc/fedora-release; then echo 1; else echo 0; fi)
30
31 %if %{need_filter} == 1
32 # http://fedoraproject.org/wiki/EPEL:Packaging_Autoprovides_and_Requires_Filtering
33 %filter_from_requires /lib%{AppProgram}.so.1/d
34 %filter_setup
35 %endif
36
37 %setup -q -n %{AppProgram}-%{AppRelease}
38
39 %build
40
41 %define ada_libdir %{_libdir}/ada/adalib
42 %define ada_include %{_prefix}/share/ada/adainclude
43
44 %if %{is_mandriva}
45 # Mageia 8 lacks gprbuild, needed for building shared libraries.
46 %define ada_model --without-shared --without-ada-sharedlib --with-ada-objects=%{_libdir}/adalib
47 %else
48 # OpenSUSE actually lacks gprbuild, but there is a workable "community" package.
49 %define ada_model --with-shared --with-ada-sharedlib
50 %if %{is_redhat}
51 # Fedora 36 LTO does not work with gprbuild system configuration.
52 unset CFLAGS
53 unset LDFLAGS
54 unset LT_SYS_LIBRARY_PATH
55 %endif
56 %endif
57
58 INSTALL_PROGRAM='${INSTALL}' \
59         ./configure %{ada_model} \
60                 --target %{_target_platform} \
61                 --prefix=%{_prefix} \
62                 --bindir=%{_bindir} \
63                 --libdir=%{_libdir} \
64                 --libexecdir=%{_libexecdir} \
65                 --with-ada-include=%{ada_include} \
66                 --with-ada-objects=%{ada_libdir} \
67                 --mandir=%{_mandir} \
68                 --datadir=%{_datadir} \
69                 --disable-rpath-link \
70                 --disable-echo \
71                 --verbose \
72                 --with-screen=ncursesw6dev \
73                 --enable-warnings
74
75 make
76
77 %install
78 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
79
80 make install DESTDIR=$RPM_BUILD_ROOT
81 make install.examples DESTDIR=$RPM_BUILD_ROOT
82
83 %clean
84 if rm -rf $RPM_BUILD_ROOT; then
85   echo OK
86 else
87   find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
88 fi
89 exit 0
90
91 %files
92 %defattr(-,root,root)
93 %{_bindir}/%{AppProgram}
94 %{_bindir}/adacurses*-config
95 %{_libexecdir}/%{AppProgram}/*
96 %{ada_libdir}/
97 %if %{need_filter} == 1
98 %{_libdir}/lib%{AppProgram}.*
99 %endif
100 %if %{is_suse}
101 %{_libdir}/lib%{AppProgram}.*
102 %endif
103 %{_mandir}/man1/adacurses*-config.1*
104 %{_datadir}/%{AppProgram}/*
105 %{ada_include}/
106
107 %changelog
108 # each patch should add its ChangeLog entries here
109
110 * Sat Dec 17 2022 Thomas Dickey
111 - install sample programs in libexec
112
113 * Sat Nov 19 2022 Thomas Dickey
114 - use static libraries for Mageia.
115
116 * Sat Nov 12 2022 Thomas Dickey
117 - unset environment variables to work around Fedora LTO bugs.
118 - build-fix for OpenSUSE with gprbuild.
119
120 * Sat Nov 16 2019 Thomas Dickey
121 - modify clean-rule to work around Fedora NFS bugs.
122
123 * Sat Sep 14 2019 Thomas Dickey
124 - build-fixes for Fedora29, OpenSUSE
125
126 * Sat Sep 07 2019 Thomas Dickey
127 - use AppProgram to replace "AdaCurses" globally
128 - amend install-paths to work with Fedora30
129
130 * Thu Mar 31 2011 Thomas Dickey
131 - use --with-shared option for consistency with --with-ada-sharelib
132 - ensure that MY_DATADIR is set when installing examples
133 - add ada_libdir symbol to handle special case where libdir is /usr/lib64
134 - use --disable-rpath-link to link sample programs without rpath
135
136 * Fri Mar 25 2011 Thomas Dickey
137 - initial version