File libqt5-qtscript.spec.in of Package libqt5-qtbase

#
# spec file for package libqt5-qtscript
#
# Copyright (c) 2012 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/
#

%define _prefix /opt/qt-5.0
%define packageprefix opt-

Name:           %{packageprefix}libQtScript5
# COMMON-VERSION-BEGIN
# COMMON-VERSION-END
BuildRequires:  %{packageprefix}libqt5-qtbase-devel >= %version
BuildRequires:  %{packageprefix}libqt5-qtbase-private-headers-devel
BuildRequires:  xz
Url:            http://qt.digia.com
Summary:        Qt 5 QtScript Library
License:        SUSE-LGPL-2.1-with-nokia-exception-1.1 or GPL-3.0
Group:          Development/Libraries/X11
# COMMON-BEGIN
# COMMON-END

%package -n %{packageprefix}libQtScript-devel
Summary:        Qt Development Kit
Group:          Development/Libraries/X11
Requires:       %name = %version
Requires:       %{packageprefix}libqt5-qtbase-devel >= %version

%description -n %{packageprefix}libQtScript-devel
You need this package, if you want to compile programs with qtscript.

%package -n %{packageprefix}libQtScript-private-headers-devel
Summary:        Non-ABI stable experimental API
Group:          Development/Libraries/C and C++
Requires:       %{packageprefix}libQtScript-devel = %version
Requires:       %{packageprefix}libqt5-qtbase-private-headers-devel

%description -n %{packageprefix}libQtScript-private-headers-devel
This package provides private headers of libqt5-qtscript that are normally
not used by application development and that do not have any ABI or
API guarantees. The packages that build against these have to require
the exact Qt version.

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%build
export QTDIR=`pwd`/qtbase
export PATH=$PATH:%{_prefix}/bin
cd qtscript
%ifarch ppc64
  RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mminimal-toc"
%endif
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DOPENSSL_LOAD_CONF"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DOPENSSL_LOAD_CONF"
export MAKEFLAGS="%{?jobs:-j %jobs}"
qmake
make

%install
cd qtscript
make INSTALL_ROOT=$RPM_BUILD_ROOT install
find $RPM_BUILD_ROOT/%_libdir -type f -name '*la' -print -exec perl -pi -e 's, -L%{_builddir}/\S+,,g' {} \;
find $RPM_BUILD_ROOT/%_libdir -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=%_bindir/moc," -e "s,uic_location=.*,uic_location=%_bindir/uic," {} \;

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,755)
%_libdir/libQt5Script.so.*
%_libdir/libQt5ScriptTools.so.*

%files -n %{packageprefix}libQtScript-private-headers-devel
%defattr(-,root,root,755)
%_includedir/QtScript/%{version}
%_includedir/QtScriptTools/%{version}

%files -n %{packageprefix}libQtScript-devel
%defattr(-,root,root,755)
%exclude %_includedir/QtScript/%{version}
%_includedir/QtScript
%exclude %_includedir/QtScriptTools/%{version}
%_includedir/QtScriptTools
%_libdir/cmake/Qt5Script
%_libdir/cmake/Qt5ScriptTools
%_libdir/libQt5Script.la
%_libdir/libQt5Script.prl
%_libdir/libQt5Script.so
%_libdir/libQt5ScriptTools.la
%_libdir/libQt5ScriptTools.prl
%_libdir/libQt5ScriptTools.so
%_libdir/pkgconfig/Qt5Script.pc
%_libdir/pkgconfig/Qt5ScriptTools.pc
%_libdir/qt5/mkspecs/modules/qt_lib_script.pri
%_libdir/qt5/mkspecs/modules/qt_lib_scripttools.pri

%changelog
openSUSE Build Service is sponsored by