File slang.spec of Package slang

#
# spec file for package slang (Version 2.2.2)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           slang
License:        GPLv2+
Group:          System/Libraries
Version:        2.2.2
Release:        2
AutoReqProv:    on
Summary:        Programming Library and Embeddable Extansion Language
Url:            http://www.jedsoft.org/
Source:         ftp://space.mit.edu/pub/davis/slang/v2.2/slang-%{version}.tar.bz2
Source2:        baselibs.conf
Patch:          slang-2.2.2.dif
Patch4:         slang-2.2.2-autoconf.dif
Patch5:         slang-2.2.2-fsuid.dif
Patch8:         slang-2.2.2-makefile.patch
Patch9:         slang-2.2.2-libpng12-linker-flag.patch
# BuildRequires:  oniguruma-devel >= 5.9.0
BuildRequires:  pcre-devel
%if 0%{?suse_version} > 1120
BuildRequires:  libpng12-devel
%else
BuildRequires:  libpng-devel
%endif
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
S-Lang is a multi-platform programming library designed to allow a developer to
create robust multi-platform software. It provides facilities required by
interactive applications such as display/screen management, keyboard input,
keymaps etc. Another major feature of the library is the interpreter for the
S-Lang extension language which can be embedded into an application to make it
extensible. With slsh a standalone interpreter is available as well.


%package slsh
License:        GPLv2+
Summary:        Interpreter for S-Lang Scripts
Group:          Development/Languages/Other
Provides:       slang = %version
Obsoletes:      slang <= 2.1.1
# bug437293
%ifarch ppc64
Obsoletes:      slang-64bit
%endif
#

%description slsh
slsh is a standalone interpreter of the S-Lang language. It can be used to
execute scripts or interactively.


%package -n libslang2
License:        GPLv2+
Summary:        Programming Library and Embeddable Extension Language
Group:          System/Libraries

%description -n libslang2
S-Lang is a multi-platform programming library designed to allow a developer to
create robust multi-platform software. It provides facilities required by
interactive applications such as display/screen management, keyboard input,
keymaps etc. Another major feature of the library is the interpreter for the
S-Lang extension language which can be embedded into an application to make it
extensible. With slsh a standalone interpreter is available as well.


%package devel
License:        GPLv2+
Summary:        Programming Library and Embeddable Extension Language - Development Package
Group:          Development/Languages/C and C++
Requires:       libslang2 = %{version}
Provides:       slang:/usr/include/slang.h
# bug437293
%ifarch ppc64
Obsoletes:      slang-devel-64bit
%endif
#

%description devel
S-Lang is a multi-platform programming library designed to allow a developer to
create robust multi-platform software. It provides facilities required by
interactive applications such as display/screen management, keyboard input,
keymaps etc. Another major feature of the library is the interpreter for the
S-Lang extension language which can be embedded into an application to make it
extensible. With slsh a standalone interpreter is available as well.

This package contains all necessary include files and libraries needed to
develop applications that require it.


%prep
%setup -q
%patch -p1
%patch4 -p1
%patch5 -p1
#%patch8 -p1
%patch9 -p1

%build
mv autoconf/configure.ac .
mv autoconf/aclocal.m4 autoconf/acinclude.m4
#autoheader -I autoconf
aclocal -I autoconf --output=autoconf/aclocal.m4
autoconf -I autoconf
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fstack-protector"
export ELF_CFLAGS="$CFLAGS"
%configure \
    --docdir=%{_datadir}/doc/packages/slang-devel \
    --with-pcre \
    --with-pnginc=/usr/include/libpng12 \
    --with-pnglib=/usr/lib \
    --with-z
#    --with-onig
# parallel make still broken in 2.2.2
make
make static

%clean
rm -rf "$RPM_BUILD_ROOT"

%install
%makeinstall install-static

rm -rf %{buildroot}%{_datadir}/doc/

%check
make check

%post -n libslang2 -p /sbin/ldconfig

%postun -n libslang2 -p /sbin/ldconfig

%files slsh
%defattr(-,root,root)
%doc COPYING slsh/README
%doc slsh/doc/html/
%config(noreplace) %{_sysconfdir}/slsh.rc
%{_bindir}/slsh
%{_libdir}/slang/
%{_datadir}/slsh/
%{_mandir}/man1/slsh.1*

%files -n libslang2
%defattr(-,root,root)
%{_libdir}/libslang.so.*

%files devel
%defattr(-,root,root)
%doc changes.txt COPYING NEWS README UPGRADE.txt demo/ examples/
%doc doc/grammar.txt doc/text/
%{_includedir}/*
%{_libdir}/pkgconfig/slang.pc
%{_libdir}/libslang.a
%{_libdir}/libslang.so

%changelog
openSUSE Build Service is sponsored by