LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File deepin-tool-kit.spec of Package deepin-tool-kit (Project home:wxkj001)

#
# spec file for package deepin-tool-kit
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Hillwood Yang <hillwood@opensuse.org>
#
# 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/
#


Name:           deepin-tool-kit
Version:        0.2.1
Release:        0
Summary:        Deepin Tool Kit Base Devel library
License:        GPL-3.0+
Group:          Development/Libraries/X11
Url:            https://github.com/linuxdeepin/deepin-tool-kit
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  libqt5-linguist
BuildRequires:  libqt5-qtdeclarative-devel
BuildRequires:  libqt5-qtx11extras-devel
BuildRequires:  libqt5-qtmultimedia-devel
BuildRequires:  libqt5-qtbase-private-headers-devel
BuildRequires:  pkgconfig(xcb-util)
BuildRequires:  pkgconfig(libstartup-notification-1.0)
Requires:		libdtkbase-devel = %{version}
Requires:		libdtkutil-devel = %{version}
Requires:		libdtkwidget-devel = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Deepin Tool Kit (Dtk) is the base devlopment tool for all
C++/Qt-based work on Deepin.

%package -n libdtkbase1
Summary:        Deepin Tool Kit base library
Group:          System/Libraries
Requires:       %{name}

%description -n libdtkbase1
The Deepin Tool Kit (Dtk) is the base devlopment tool for all
C++/Qt-based work on Deepin.

%package -n libdtkbase-devel
Summary:        Development tools for libdtkbase
Group:          Development/Libraries/X11
Requires:       libdtkbase1 = %{version}

%description -n libdtkbase-devel
The libdtkbase-devel package contains the header files and developer
docs for libdtkbase1.

%package -n libdtkutil1
Summary:        Deepin Tool Kit utility library
Group:          System/Libraries
Requires:       %{name}

%description -n libdtkutil1
The Deepin Tool Kit (Dtk) is the base devlopment tool for all
C++/Qt-based work on Deepin.

%package -n libdtkutil-devel
Summary:        Development tools for libdtkutil
Group:          Development/Libraries/X11
Requires:       libdtkutil1 = %{version}

%description -n libdtkutil-devel
The libdtkutil-devel package contains the header files and developer
docs for libdtkutil.

%package -n libdtkwidget1
Summary:        Deepin Tool Kit widget library
Group:          System/Libraries
Requires:       %{name}

%description -n libdtkwidget1
The Deepin Tool Kit (Dtk) is the base devlopment tool for all
C++/Qt-based work on Deepin.

%package -n libdtkwidget-devel
Summary:        Development tools for libdtkwidget
Requires:       libdtkwidget1 = %{version}

%description -n libdtkwidget-devel
The libdtkwidget-devel package contains the header files and developer
docs for libdtkwidget1.

%prep
%setup -q

%build
sed -i 's|lrelease|lrelease-qt5|g' tool/translate_generation.sh
sed -i -E '/test|examples/d' dtk.pro

%qmake5 DEFINES+=QT_NO_DEBUG_OUTPUT \
        PREFIX=%{_prefix} \
        LIB_INSTALL_DIR=%{_libdir}
make %{?_smp_mflags}

%install
%qmake5_install

# Fix paths in .pc files
sed -i 's|${prefix}|/usr|g' %{buildroot}%{_libdir}/pkgconfig/dtkbase.pc
sed -i 's|${prefix}|/usr|g' %{buildroot}%{_libdir}/pkgconfig/dtkutil.pc
sed -i 's|${prefix}|/usr|g' %{buildroot}%{_libdir}/pkgconfig/dtkwidget.pc
sed -i 's|${includedir}|/usr/include|g' %{buildroot}%{_libdir}/pkgconfig/dtkbase.pc
sed -i 's|${includedir}|/usr/include|g' %{buildroot}%{_libdir}/pkgconfig/dtkutil.pc
sed -i 's|${includedir}|/usr/include|g' %{buildroot}%{_libdir}/pkgconfig/dtkwidget.pc
sed -i 's|-L/home/abuild/rpmbuild/BUILD/deepin-tool-kit-0.2.1/dutil/../dbase/ ||g' %{buildroot}%{_libdir}/pkgconfig/dtkutil.pc
sed -i 's|-L/home/abuild/rpmbuild/BUILD/deepin-tool-kit-0.2.1/dwidget/../dbase/ -ldtkbase -L/home/abuild/rpmbuild/BUILD/deepin-tool-kit-0.2.1/dwidget/../dutil/ ||g' \
%{buildroot}%{_libdir}/pkgconfig/dtkwidget.pc
sed -i 's,-I/usr/include,-I/usr/include/libdtk-1.0/DBase,g' %{buildroot}%{_libdir}/pkgconfig/dtkbase.pc
sed -i 's,-I/usr/include,-I/usr/include/libdtk-1.0/DUtil,g' %{buildroot}%{_libdir}/pkgconfig/dtkutil.pc
sed -i 's,-I/usr/include,-I/usr/include/libdtk-1.0/DWidget,g' %{buildroot}%{_libdir}/pkgconfig/dtkwidget.pc

# Fix the name for pkgconfig files
mv %{buildroot}%{_libdir}/pkgconfig/dtkbase.pc %{buildroot}%{_libdir}/pkgconfig/dtkbase-0-2.pc
mv %{buildroot}%{_libdir}/pkgconfig/dtkutil.pc %{buildroot}%{_libdir}/pkgconfig/dtkutil-0-2.pc
mv %{buildroot}%{_libdir}/pkgconfig/dtkwidget.pc %{buildroot}%{_libdir}/pkgconfig/dtkwidget-0-2.pc

%post -n libdtkbase1 -p /sbin/ldconfig

%postun -n libdtkbase1 -p /sbin/ldconfig

%post -n libdtkutil1 -p /sbin/ldconfig

%postun -n libdtkutil1 -p /sbin/ldconfig

%post -n libdtkwidget1 -p /sbin/ldconfig

%postun -n libdtkwidget1 -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc debian/copyright README.md Specification.md

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

%files -n libdtkbase-devel
%defattr(-,root,root,-)
%dir %{_includedir}/libdtk-1.0
%{_includedir}/libdtk-1.0/DBase/
%{_libdir}/pkgconfig/dtkbase-0-2.pc
%{_libdir}/libdtkbase.so

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

%files -n libdtkutil-devel
%defattr(-,root,root,-)
%{_includedir}/libdtk-1.0/DUtil/
%{_libdir}/pkgconfig/dtkutil-0-2.pc
%{_libdir}/libdtkutil.so

%files -n libdtkwidget1
%defattr(-,root,root,-)
%{_libdir}/libdtkwidget.so.*
%dir %{_datadir}/dtkwidget
%dir %{_datadir}/dtkwidget/translations
%{_datadir}/dtkwidget/translations/*

%files -n libdtkwidget-devel
%defattr(-,root,root,-)
%{_includedir}/libdtk-1.0/DWidget/
%{_libdir}/pkgconfig/dtkwidget-0-2.pc
%{_libdir}/libdtkwidget.so

%changelog