package init

This commit is contained in:
daidai_is_here 2020-03-07 18:39:54 +08:00
parent ac411f1f0d
commit 3a5157e52d
2 changed files with 127 additions and 0 deletions

60
kf5.spec Normal file
View File

@ -0,0 +1,60 @@
Name: kf5
Version: 5.59.0
Release: 2
Summary: Filesystem and RPM macros of KDE Frameworks 5
License: BSD
URL: http://www.kde.org
Source0: macros.kf5
%description
Filesystem and RPM macros of KDE Frameworks 5.
%package filesystem
Summary: Filesystem of KF5
Obsoletes: kf5-filesystem < 5.10.0-2
%{?_qt5_version:Requires: qt5-qtbase%{?_isa} >= %{_qt5_version}}
%description filesystem
Filesystem of KF5.
%package rpm-macros
Summary: RPM macros of KF5
Requires: cmake >= 3 qt5-rpm-macros >= 5.10
BuildArch: noarch
%description rpm-macros
RPM macros of KF5.
%install
install -d %{buildroot}%{_prefix}/{lib,%{_lib}}/qt5/plugins/kf5/
install -d %{buildroot}%{_prefix}/{lib,%{_lib}}/kconf_update_bin
install -d %{buildroot}%{_includedir}/KF5
install -d %{buildroot}%{_datadir}/{config.kcfg,kconf_update,kf5,kservicetypes5}
install -d %{buildroot}%{_datadir}/kpackage/genericqml
install -d %{buildroot}%{_datadir}/kpackage/kcms
install -d %{buildroot}%{_datadir}/kservices5/ServiceMenus
install -d %{buildroot}%{_datadir}/solid/actions
install -d %{buildroot}%{_datadir}/solid/devices
install -d %{buildroot}%{_libexecdir}/kf5
install -d %{buildroot}%{_sysconfdir}/xdg/plasma-workspace/env
install -d %{buildroot}%{_sysconfdir}/xdg/plasma-workspace/shutdown
install -Dpm644 %{_sourcedir}/macros.kf5 %{buildroot}%{_rpmconfigdir}/macros.d/macros.kf5
sed -i -e "s|@@KF5_VERSION@@|%{version}|g" %{buildroot}%{_rpmconfigdir}/macros.d/macros.kf5
%files filesystem
%{_sysconfdir}/xdg/plasma-workspace/
%{_prefix}/lib/qt5/plugins/kf5/
%{_prefix}/%{_lib}/qt5/plugins/kf5/
%{_prefix}/lib/kconf_update_bin/
%{_prefix}/%{_lib}/kconf_update_bin/
%{_includedir}/KF5/
%{_libexecdir}/kf5/
%{_datadir}/{config.kcfg,kconf_update,kf5,kpackage,kservices5,kservicetypes5,solid}
%files rpm-macros
%{_rpmconfigdir}/macros.d/macros.kf5
%changelog
* Sat Mar 07 2020 daiqianwen <daiqianwen@huawei.com> - 5.59.0-2
- Package init

67
macros.kf5 Normal file
View File

@ -0,0 +1,67 @@
%_kf5_prefix %_prefix
%_kf5_archdatadir %_qt5_archdatadir
%_kf5_bindir %_kf5_prefix/bin
%_kf5_datadir %_datadir
%_kf5_docdir /usr/share/doc
%_kf5_includedir %_includedir/KF5
%_kf5_libdir %_libdir
%_kf5_libexecdir %_libexecdir/kf5
%_kf5_metainfodir %_metainfodir
%_kf5_qtplugindir %_qt5_plugindir
%_kf5_plugindir %_qt5_plugindir/kf5
%_kf5_sysconfdir %_sysconfdir
%_kf5_mandir %_kf5_datadir/man
%_kf5_buildtype release
%_kf5_qmldir %_kf5_archdatadir/qml
%_kf5_version @@KF5_VERSION@@
%cmake_kf5 \
QTDIR="%{_qt5_prefix}" ; export QTDIR ; \
PATH="%{_qt5_bindir}:$PATH" ; export PATH ; \
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \
%{__cmake} \\\
-DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DBUILD_TESTING:BOOL=FALSE \\\
-DCMAKE_BUILD_TYPE=%{_kf5_buildtype} \\\
-DCMAKE_INSTALL_INCLUDEDIR_KF5:PATH=%{_kf5_includedir} \\\
-DCMAKE_INSTALL_LIBEXECDIR_KF5:PATH=%{_kf5_libexecdir} \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{_kf5_prefix} \\\
-DCMAKE_USE_RELATIVE_PATHS:BOOL=ON \\\
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
-DECM_MKSPECS_INSTALL_DIR:PATH=%{_kf5_archdatadir}/mkspecs/modules \\\
-DKDE_INSTALL_BINDIR:PATH=%{_kf5_bindir} \\\
-DKDE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \\\
-DKDE_INSTALL_KCFGDIR:PATH=%{_datadir}/config.kcfg \\\
-DKDE_INSTALL_LIBDIR:PATH=%{_kf5_libdir} \\\
-DKDE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \\\
-DKDE_INSTALL_METAINFODIR:PATH=%{_kf5_metainfodir} \\\
-DKDE_INSTALL_PLUGINDIR:PATH=%{_qt5_plugindir} \\\
-DKDE_INSTALL_QMLDIR:PATH=%{_kf5_qmldir} \\\
-DKDE_INSTALL_QTPLUGINDIR:PATH=%{_qt5_plugindir} \\\
-DKDE_INSTALL_QTQUICKIMPORTSDIR:PATH=%{_qt5_importdir} \\\
-DKDE_INSTALL_SYSCONFDIR:PATH=%{_kf5_sysconfdir} \\\
-DKDE_INSTALL_USE_QT_SYS_PATHS:BOOL=ON
# %%find_lang_kf5
#
# This macro is used in KDE Frameworks 5 packages instead of %%find_lang,
# becasue find_lang is broken an it thinks that "_qt" in foobar_qt.qm is
# the name of the language.
# This macro should NOT be used with anything else but KDE Frameworks, since
# it does some assumptions regarding the names and locations and it might not
# work with other packages.
# We should eventually get this to RPM, or fix %%find_lang
# -- dvratil
# Usage: find_lang_kf5 fooBar5
# - will look for fooBar5_qt.qm files in %%{buildroot}/usr/share/locale/
#
%find_lang_kf5() \
(find %{buildroot}/%{_datadir}/locale/ -name "%1.qm" -type f | sed ' \
s:%{buildroot}/:: \
s:%{_datadir}/locale/\\([a-zA-Z_\\@]*\\)/\\([a-zA-Z_]*\\)/%1.qm:%lang(\\1) %{_datadir}/locale/\\1/\\2/%1.qm:' > %1.lang)