blob: 540e8e54bad843579653b17f1e29b2091baab0d7 [file] [log] [blame]
micky3879b9f5e72025-07-08 18:04:53 -04001Summary: Ada95 binding for ncurses
Steve Kondikae271bc2015-11-15 02:50:53 +01002%define AppProgram AdaCurses
3%define AppVersion MAJOR.MINOR
4%define AppRelease YYYYMMDD
micky3879b9f5e72025-07-08 18:04:53 -04005# $Id: AdaCurses.spec,v 1.31 2022/12/18 00:08:17 tom Exp $
Steve Kondikae271bc2015-11-15 02:50:53 +01006Name: %{AppProgram}
7Version: %{AppVersion}
8Release: %{AppRelease}
9License: MIT
10Group: Applications/Development
micky3879b9f5e72025-07-08 18:04:53 -040011URL: ftp://ftp.invisible-island.net/%{AppProgram}
Steve Kondikae271bc2015-11-15 02:50:53 +010012Source0: %{AppProgram}-%{AppRelease}.tgz
13Packager: Thomas Dickey <dickey@invisible-island.net>
14
15%description
16This is the Ada95 binding from the ncurses MAJOR.MINOR distribution, for
17patch-date YYYYMMDD.
18
19In addition to a library, this package installs sample programs in
micky3879b9f5e72025-07-08 18:04:53 -040020"bin/%{AppProgram}" to avoid conflict with other packages.
Steve Kondikae271bc2015-11-15 02:50:53 +010021%prep
22
micky3879b9f5e72025-07-08 18:04:53 -040023%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
Steve Kondikae271bc2015-11-15 02:50:53 +010027%define debug_package %{nil}
28
micky3879b9f5e72025-07-08 18:04:53 -040029%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
Steve Kondikae271bc2015-11-15 02:50:53 +010032# http://fedoraproject.org/wiki/EPEL:Packaging_Autoprovides_and_Requires_Filtering
micky3879b9f5e72025-07-08 18:04:53 -040033%filter_from_requires /lib%{AppProgram}.so.1/d
Steve Kondikae271bc2015-11-15 02:50:53 +010034%filter_setup
micky3879b9f5e72025-07-08 18:04:53 -040035%endif
Steve Kondikae271bc2015-11-15 02:50:53 +010036
37%setup -q -n %{AppProgram}-%{AppRelease}
38
39%build
40
micky3879b9f5e72025-07-08 18:04:53 -040041%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.
52unset CFLAGS
53unset LDFLAGS
54unset LT_SYS_LIBRARY_PATH
55%endif
56%endif
Steve Kondikae271bc2015-11-15 02:50:53 +010057
58INSTALL_PROGRAM='${INSTALL}' \
micky3879b9f5e72025-07-08 18:04:53 -040059 ./configure %{ada_model} \
Steve Kondikae271bc2015-11-15 02:50:53 +010060 --target %{_target_platform} \
61 --prefix=%{_prefix} \
62 --bindir=%{_bindir} \
63 --libdir=%{_libdir} \
micky3879b9f5e72025-07-08 18:04:53 -040064 --libexecdir=%{_libexecdir} \
65 --with-ada-include=%{ada_include} \
66 --with-ada-objects=%{ada_libdir} \
Steve Kondikae271bc2015-11-15 02:50:53 +010067 --mandir=%{_mandir} \
68 --datadir=%{_datadir} \
69 --disable-rpath-link \
micky3879b9f5e72025-07-08 18:04:53 -040070 --disable-echo \
71 --verbose \
72 --enable-warnings
Steve Kondikae271bc2015-11-15 02:50:53 +010073
74make
75
76%install
77[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
78
micky3879b9f5e72025-07-08 18:04:53 -040079make install DESTDIR=$RPM_BUILD_ROOT
80make install.examples DESTDIR=$RPM_BUILD_ROOT
Steve Kondikae271bc2015-11-15 02:50:53 +010081
82%clean
micky3879b9f5e72025-07-08 18:04:53 -040083if rm -rf $RPM_BUILD_ROOT; then
84 echo OK
85else
86 find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
87fi
88exit 0
Steve Kondikae271bc2015-11-15 02:50:53 +010089
90%files
91%defattr(-,root,root)
micky3879b9f5e72025-07-08 18:04:53 -040092%{_bindir}/%{AppProgram}
Steve Kondikae271bc2015-11-15 02:50:53 +010093%{_bindir}/adacurses*-config
micky3879b9f5e72025-07-08 18:04:53 -040094%{_libexecdir}/%{AppProgram}/*
95%{ada_libdir}/
96%if %{need_filter} == 1
97%{_libdir}/lib%{AppProgram}.*
98%endif
99%if %{is_suse}
100%{_libdir}/lib%{AppProgram}.*
101%endif
Steve Kondikae271bc2015-11-15 02:50:53 +0100102%{_mandir}/man1/adacurses*-config.1*
103%{_datadir}/%{AppProgram}/*
micky3879b9f5e72025-07-08 18:04:53 -0400104%{ada_include}/
Steve Kondikae271bc2015-11-15 02:50:53 +0100105
106%changelog
107# each patch should add its ChangeLog entries here
108
micky3879b9f5e72025-07-08 18:04:53 -0400109* Sat Dec 17 2022 Thomas Dickey
110- install sample programs in libexec
111
112* Sat Nov 19 2022 Thomas Dickey
113- use static libraries for Mageia.
114
115* Sat Nov 12 2022 Thomas Dickey
116- unset environment variables to work around Fedora LTO bugs.
117- build-fix for OpenSUSE with gprbuild.
118
119* Sat Nov 16 2019 Thomas Dickey
120- modify clean-rule to work around Fedora NFS bugs.
121
122* Sat Sep 14 2019 Thomas Dickey
123- build-fixes for Fedora29, OpenSUSE
124
125* Sat Sep 07 2019 Thomas Dickey
126- use AppProgram to replace "AdaCurses" globally
127- amend install-paths to work with Fedora30
128
Steve Kondikae271bc2015-11-15 02:50:53 +0100129* Thu Mar 31 2011 Thomas Dickey
130- use --with-shared option for consistency with --with-ada-sharelib
131- ensure that MY_DATADIR is set when installing examples
132- add ada_libdir symbol to handle special case where libdir is /usr/lib64
133- use --disable-rpath-link to link sample programs without rpath
134
135* Fri Mar 25 2011 Thomas Dickey
136- initial version