157014b
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
157014b
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
157014b
157014b
157014b
Name:		stfl
157014b
Version:	0.21
bf1f8be
Release:	12%{?dist}
157014b
Summary:	The Structured Terminal Forms Language/Library
157014b
157014b
Group:		System Environment/Libraries
157014b
License:	LGPLv3+
157014b
URL:		http://www.clifford.at/stfl/
157014b
Source0:	http://www.clifford.at/stfl/%{name}-%{version}.tar.gz
157014b
157014b
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
157014b
157014b
BuildRequires:	ncurses-devel
157014b
BuildRequires:	swig
157014b
BuildRequires:	perl-devel
157014b
BuildRequires:	python-devel
157014b
BuildRequires:	ruby, ruby-devel
157014b
157014b
%description
157014b
STFL is a library which implements a curses-based widget set for text
157014b
terminals.
157014b
157014b
157014b
%package	devel
157014b
Summary:	Development files for %{name}
157014b
Group:		Development/Libraries
157014b
Requires:	%{name} = %{version}-%{release}
157014b
Requires:	pkgconfig
157014b
157014b
%description	devel
157014b
The %{name}-devel package contains libraries and header files for
157014b
developing applications that use %{name}.
157014b
157014b
157014b
%package	perl
157014b
Summary:	Perl binding for STFL
157014b
Group:		Development/Libraries
157014b
Requires:	%{name} = %{version}-%{release}
157014b
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
157014b
157014b
%description	perl
157014b
Perl binding for STFL
157014b
157014b
157014b
%package	python
157014b
Summary:	Python binding for STFL
157014b
Group:		Development/Libraries
157014b
Requires:	%{name} = %{version}-%{release}
157014b
157014b
%description	python
157014b
Python binding for STFL.
157014b
157014b
157014b
%package	ruby
157014b
Summary:	Ruby binding for STFL
157014b
Group:		Development/Libraries
157014b
Requires:	%{name} = %{version}-%{release}
157014b
Requires:	ruby(abi) = 1.8
157014b
157014b
%description	ruby
157014b
Ruby binding for STFL.
157014b
157014b
157014b
%prep
157014b
%setup -q
157014b
## ensures that _stfl.so doesn't end up in lib-dynload
157014b
## - http://www.rocklinux.net/pipermail/stfl/2009-June/000113.html
157014b
sed -i.path \
157014b
 -e '/mkdir.*lib-dynload/d' \
157014b
 -e '/cp/s|lib-dynload||' \
157014b
 python/Makefile.*
157014b
## creates an soname symlink for the shared library
157014b
## - http://www.rocklinux.net/pipermail/stfl/2009-June/000114.html
157014b
## add the new line needed (the part starting with \n) If you know a better way with sed to do it, please educate me
157014b
sed -i.soname \
157014b
 -e 's|\(.*ln -fs.*/\)\(libstfl\.so\)$|\1\2\n\1\$(SONAME)|' \
157014b
 Makefile
157014b
## fixes undefined-non-weak-symbol rpmlint warnings
157014b
## - http://www.rocklinux.net/pipermail/stfl/2009-October/000116.html
157014b
sed -i.ldflags -e 's|\(-shared\)|\1 \$(LDLIBS)|' Makefile
157014b
## fixes libdir for other arch than x86 
157014b
## - http://www.rocklinux.net/pipermail/stfl/2009-October/000118.html
157014b
sed -i.path -e 's|libdir=.*|libdir=%{_libdir}|' stfl.pc.in
157014b
sed -i.cflags -e 's|-Os||' Makefile
bf1f8be
# fix paths in Makefile.cfg
bf1f8be
sed -i.path -e 's|lib$|%{_lib}|' -e 's|/usr/local$|%{_prefix}|' Makefile.cfg
157014b
157014b
%build
157014b
# building with smp flags causes random failures
157014b
export CFLAGS="%{optflags}"
8997b5e
# test with explicit prefix and echo
8dbf1b0
#make prefix=/usr libdir=%{_lib}
8dbf1b0
#echo %ruby_sitearch
8dbf1b0
#echo `ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] '`
157014b
157014b
%install
157014b
rm -rf %{buildroot}
bf1f8be
make install DESTDIR=%{buildroot}
157014b
# give the shared libraries executable permissions so they get stripped
157014b
# also fixes the 0555 permissions on the perl bindings
157014b
find %{buildroot} -name '*.so' -exec chmod 755 {} ';'
157014b
# perl ignores empty .bs files
157014b
find %{buildroot} -name '*.bs' -size 0c -exec rm -f {} ';'
157014b
# fedora doesn't ship static libraries
157014b
rm -f %{buildroot}%{_libdir}/libstfl.a
157014b
## remove unneeded files
157014b
rm -f %{buildroot}%{perl_vendorarch}/example.pl
157014b
rm -f %{buildroot}%{perl_vendorarch}/auto/stfl/.packlist
157014b
rm -f %{buildroot}%{perl_archlib}/perllocal.pod
157014b
157014b
%clean
157014b
rm -rf %{buildroot}
157014b
157014b
157014b
%post -p /sbin/ldconfig
157014b
157014b
157014b
%postun -p /sbin/ldconfig
157014b
157014b
157014b
%files
157014b
%defattr(-,root,root,-)
157014b
%doc README COPYING
157014b
%{_libdir}/*.so.*
157014b
157014b
%files devel
157014b
%defattr(-,root,root,-)
157014b
%{_includedir}/*
157014b
%{_libdir}/*.so
157014b
%{_libdir}/pkgconfig/stfl.pc
157014b
157014b
%files perl
157014b
%defattr(-,root,root,-)
157014b
%dir %{perl_vendorarch}/auto/stfl
157014b
%{perl_vendorarch}/*.pm
157014b
%{perl_vendorarch}/auto/stfl/*
157014b
157014b
%files python
157014b
%defattr(-,root,root,-)
157014b
%{python_sitearch}/stfl.py*
157014b
%{python_sitearch}/_stfl.so
157014b
157014b
%files ruby
157014b
%defattr(-,root,root,-)
157014b
%{ruby_sitearch}/stfl.so
157014b
157014b
%changelog
bf1f8be
* Wed Sep 29 2010 Dan HorĂ¡k <dan[at]danny.cz> 0.21-12
bf1f8be
- prefix/libdir handling is broken in the Makefile chains
bf1f8be
128cd74
* Tue Sep 07 2010 thomas Janssen 
128cd74
- find out what FTBFS
128cd74
8331d42
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.21-10
8331d42
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
8331d42
2ae5bb7
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.21-9
2ae5bb7
- Mass rebuild with perl-5.12.0
2ae5bb7
501731d
* Mon Dec  7 2009 Stepan Kasal <skasal@redhat.com> - 0.21-8
501731d
- rebuild against perl 5.10.1
501731d
157014b
* Tue Oct 20 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-7
157014b
- Removed empty %%doc
157014b
- Changed sed commands
157014b
157014b
* Tue Oct 06 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-6
157014b
- Changed CFLAGS again
157014b
157014b
* Tue Oct 06 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-5
157014b
- Better use of sed
157014b
- Fixed CFLAGS
157014b
- Use of rm instead of exclude
157014b
- Removed empty doc
157014b
157014b
* Mon Oct 05 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-4
157014b
- Removed unneeded requires
157014b
- Removed dupe docs
157014b
- removed patches and make use of sed
157014b
- fixed stfl.pc.in for x86_64
157014b
157014b
* Fri Oct 02 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-3
157014b
- fixed installed rpmlint output
157014b
157014b
* Fri Oct 02 2009 Thomas Janssen <thomasj@fedoraproject.org> 0.21-2
157014b
- Added Requires: pkgconfig
157014b
- Mentioned to upstream the rpmlint warnings
157014b
- http://www.rocklinux.net/pipermail/stfl/2009-October/000115.html
157014b
- Minor spec changes
157014b
157014b
* Sun Jun 28 2009 Byron Clark <byron@theclarkfamily.name> 0.21-1
157014b
- New upstream release
157014b
- Stop placing _stfl.so in lib-dynload
157014b
- Add patch to properly create soname symlink for shared lib.
157014b
157014b
* Wed Jun 10 2009 Byron Clark <byron@theclarkfamily.name> 0.20-5
157014b
- Stop using both python_sitelib and python_sitearch
157014b
- Modify stfl-pythonpaths.patch to only use python_sitearch
157014b
157014b
* Sat Jun 6 2009 Byron Clark <byron@theclarkfamily.name> 0.20-4
157014b
- Don't explicitly require python and perl
157014b
157014b
* Thu May 21 2009 Byron Clark <byron@theclarkfamily.name> 0.20-3
157014b
- Use the patches that have been sent upstream
157014b
157014b
* Thu May 21 2009 Byron Clark <byron@theclarkfamily.name> 0.20-2
157014b
- Add the minimal docs
157014b
157014b
* Thu May 21 2009 Byron Clark <byron@theclarkfamily.name> 0.20-1
157014b
- Initial release