FSearch基于C+GTK的文件搜索软件

#1

链接: https://pan.baidu.com/s/1EaUL4xRjvdbxrxnY6a6kUw 提取码: v8av
源码: https://github.com/cboxdoerfer/fsearch
C加GTK写的 速度贼快 主要能自定义搜索目录
OBS分类不对

[  101s] WARNING: '/usr/lib/rpm/brp-desktop.data/suse-screensavers.menu' does not exist
[  101s] WARNING: '/usr/lib/rpm/brp-desktop.data/applications-kmenuedit.menu' does not exist
[  101s] WARNING: '/usr/lib/rpm/brp-desktop.data/custom.menu' does not exist
[  101s] ERROR: No sufficient Category definition: /home/abuild/rpmbuild/BUILDROOT/fsearch-0-lp150.10.1.x86_64//usr/share/applications/fsearch.desktop 
[  101s] Please refer to https://en.opensuse.org/openSUSE:Packaging_desktop_menu_categories
[  101s] WARNING: Empty GenericName: /home/abuild/rpmbuild/BUILDROOT/fsearch-0-lp150.10.1.x86_64//usr/share/applications/fsearch.desktop
[  101s] Errors in installed desktop file detected. Please refer to http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros
[  101s] error: Bad exit status from /var/tmp/rpm-tmp.KH6bNC (%install)

这几个意思 到底怎么分类?

#
# spec file for package FSearch
#
# Copyright (c) 2018 SUSE LINUX 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/
#

Name:           fsearch
Version:        0
Release:        1
License:        GPL-3.0
Summary:        A fast file search utility for Unix-like systems based on GTK+3 
Url:          	https://github.com/cboxdoerfer/fsearch
Group:          System/FileTools
Source0:        fsearch.tar.gz
BuildRequires:  automake
BuildRequires:  autoconf
BuildRequires:  autoconf-archive
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  glib2-devel
BuildRequires:  gtk3-devel
BuildRequires:  pkgconfig

BuildRoot:      %{_tmppath}-%{version}-%{release}-build

%description
A fast file search utility for Unix-like systems based on GTK+3 
​License:        GPL-3.0
Group:			System/FileTools

%prep
rm -rf %{name}
rm -rf %{buildroot}
# git clone %{url}.git %{_builddir}/%{name}
tar xvf %{_sourcedir}/fsearch.tar.gz -C %{_builddir}

%build
cd %{_builddir}/%{name}
./autogen.sh
# 更改默认安装的/usr/local/bin为/usr/bin否则无法打包
./configure --prefix=%{_bindir}
make

%install

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES
mkdir -p %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES

cp -r %{_builddir}/%{name}/src/%{name} %{buildroot}
cp -r %{_builddir}/%{name}/data/%{name}.desktop %{buildroot}
cp -r %{_builddir}/%{name}/po/zh_CN.gmo %{buildroot}
cp -r %{_builddir}/%{name}/po/uk.gmo %{buildroot}

####### 
cd %{buildroot}
install -c %{name} %{buildroot}%{_bindir}
install -c -m 644 %{name}.desktop %{buildroot}%{_datadir}/applications
install -c -m 644 zh_CN.gmo %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/fsearch.mo
install -c -m 644 uk.gmo %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES/fsearch.mo

rm %{buildroot}/%{name} %{name}.desktop zh_CN.gmo uk.gmo

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/locale/uk/LC_MESSAGES/fsearch.mo
%{_datadir}/locale/zh_CN/LC_MESSAGES/fsearch.mo

openSUSE-Gossip-20190408-20190731
#2

应该就是源码里面的 desktop 文件不符合 OBS 分类写法吧,参考 angrysearch 在 build 部分 sed 改成Utility;Filesystem;GTK; 试试?

#3

刚才搞定了 主要还是软件分类不符合 OBS检查太精细了 rpmbuild可以打包成功到了OBS这里就出问题了 我源里面还有个也这样 懒得弄了

#
# spec file for package FSearch
#
# Copyright (c) 2018 SUSE LINUX 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/
#

Name:           fsearch
Version:        0
Release:        1
License:        GPL-3.0
Summary:        A fast file search utility for Unix-like systems based on GTK+3 
Url:          	https://github.com/cboxdoerfer/fsearch
Group:          System;FileTools
Source0:        fsearch.tar.gz
BuildRequires:  automake
BuildRequires:  autoconf
BuildRequires:  autoconf-archive
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  glib2-devel
BuildRequires:  gtk3-devel
BuildRequires:  pkgconfig
BuildRequires:  git
BuildRequires:  kmenuedit5
BuildRequires:  desktop-file-utils
Requires(post): update-desktop-files
BuildRequires:  update-desktop-files

BuildRoot:      %{_tmppath}-%{version}-%{release}-build

%description
A fast file search utility for Unix-like systems based on GTK+3 

%prep
rm -rf %{name}
rm -rf %{buildroot}
# git clone %{url}.git %{_builddir}/%{name}
tar xvf %{_sourcedir}/fsearch.tar.gz -C %{_builddir}

%build
cd %{_builddir}/%{name}
./autogen.sh
# 更改默认安装的/usr/local/bin为/usr/bin否则无法打包
./configure --prefix=%{_bindir}
make

%install

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES
mkdir -p %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES

cp -r %{_builddir}/%{name}/src/%{name} %{buildroot}
cp -r %{_builddir}/%{name}/data/%{name}.desktop %{buildroot}
cp -r %{_builddir}/%{name}/po/zh_CN.gmo %{buildroot}
cp -r %{_builddir}/%{name}/po/uk.gmo %{buildroot}

####### 
cd %{buildroot}
install -c %{name} %{buildroot}%{_bindir}
install -c -m 644 %{name}.desktop %{buildroot}%{_datadir}/applications
install -c -m 644 zh_CN.gmo %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/fsearch.mo
install -c -m 644 uk.gmo %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES/fsearch.mo

# installing .desktop Files
%suse_update_desktop_file -i %{name} GTK FileManager

rm %{buildroot}/%{name} %{name}.desktop zh_CN.gmo uk.gmo

%clean


%post
%desktop_database_post

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/locale/uk/LC_MESSAGES/fsearch.mo
%{_datadir}/locale/zh_CN/LC_MESSAGES/fsearch.mo

%changelog
#4

这个是自动把 desktop 的 categories 改成和包的 group 一样的操作?

#5

%desktop_database_post / %desktop_database_postun

These macros need to be called for every application which installs a .desktop file. This will update the system media type cache by calling update-desktop-database.

https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25icon_theme_cache_post_.2F_.25icon_theme_cache_postun

#6

好吧,是没怎么注意。

话说可以通过

%suse_update_desktop_file

直接更改 desktop 文件,不清真的 sed 操作。

#7

/usr/lib/rpm/suse_update_desktop_file.sh --help

Usage: suse_update_desktop_file.sh [OPTIONS] <APPLICATION> [CATEGORIES]

 Summary:
       Used to add easily a category to .desktop files according to XDG
       standard. More information is available on
       http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros
       If you have any questions, please use our mailinglist: 
       opensuse-packaging@opensuse.org
 Options:
       <APPLICATION>             : The name of the desktop file.
                                   Example: use "qbrew" to edit qbrew.desktop
                                   If APPLICATION has multiple desktop files, try the exact path
                                   to the desktop file.
                                   Example: use "%suse_update_desktop_file \
                                   %{buildroot}%{_datadir}/susehelp/meta/%name/%name.desktop"
                                   to edit the susehelp desktop entry file instead.
       -u|--unimportant          : add "NoDisplay=true" to the resulting desktop
                                   file.
       -n|--no-i18n              : Do not prepare the desktop file for translators (obsoletes -t).
                                   (adds X-SuSE-translate=false to the desktop file)
       -i|--install              : Install an existing desktop file in /usr/share/applications/
                                   The to be installed desktop file can be located in:
                                   - RPM_SOURCE_DIR or
                                   - RPM_BUILD_DIR
                                   A referenced icon file (ending *.png; *.xpm) is installed in
                                   /usr/share/pixmaps/ automatically if it is located in one of the 
                                   directories mentioned above (-maxdepth 1).
       -r|--reset                : Reset the "Categories" line in an existing desktop file.
                                   Normally, categories mentioned in an existing desktop file will be
                                   obtained. Additional categories from commandline are added.
       -d|--docid <string>       : Add "X-SuSE-DocTeamID=<string>" to the desktop file.
       -D|--docpath <path>       : Add "DocPath=<path>" to the desktop file - do not guess it
                                   automatically.
       -c|--create <name>        : Create a new desktop file in /usr/share/applications/<name>.desktop .
       -C|--comment <string>     : Use <string> as "Comment=<string>" in desktop file.
       -N|--name <string>        : Use <string> as "Name=<string>" in desktop file.
       -G|--genericname <string> : Use <string> as "GenericName=<string>" in desktop file.