alex1701c / JetBrainsRunner

A Krunner Plugin which allows you to open your recent projects
GNU Lesser General Public License v3.0
53 stars 4 forks source link

RPM install fails with file conflict #15

Closed ovv closed 3 years ago

ovv commented 3 years ago
$ dnf install krunner-jetbrainsrunner-1.5.0-Linux.rpm
Last metadata expiration check: 0:15:41 ago on Sat 14 Nov 2020 14:09:44 CET.
Dependencies resolved.
===============================================================================================================================================================================================
 Package                                                  Architecture                            Version                                  Repository                                     Size
===============================================================================================================================================================================================
Installing:
 krunner-jetbrainsrunner                                  x86_64                                  1.5.0-1                                  @commandline                                  120 k

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package

Total size: 120 k
Installed size: 341 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction test error:
  file /usr/share/pixmaps from install of krunner-jetbrainsrunner-1.5.0-1.x86_64 conflicts with file from package filesystem-3.14-2.fc32.x86_64
  file /usr/share/kservices5 from install of krunner-jetbrainsrunner-1.5.0-1.x86_64 conflicts with file from package kf5-filesystem-5.73.0-1.fc32.x86_64
  file /usr/share/kservices5 from install of krunner-jetbrainsrunner-1.5.0-1.x86_64 conflicts with file from package kf5-kservice-5.73.0-1.fc32.x86_64

Could you share the spec file used to build the rpm ?

alex1701c commented 3 years ago

Hello, the SPEC file is generated by CPack, I will look into writing a fix this weekend.

ovv commented 3 years ago

From what I understand this happens because the directory are included in the spec files but they are already owned by another package. The spec file should only contains the path to the actual files like /usr/share/pixmaps/jetbrainsrunner.png and not /usr/share/pixmaps/

alex1701c commented 3 years ago

Can you check if the CMake file of this project works for generating the RPM https://github.com/alex1701c/krunner-vscodeprojects/blob/master/CMakeLists.txt#L39.

Just run CMake with the args from the comment and then run cpack and instal the RPM.

ovv commented 3 years ago

Yes that one works fine

~/projects/ovv/krunner-vscodeprojects master
❯ cmake -DCPACK_FEDORA=true -DKDE_INSTALL_QTPLUGINDIR=/usr/lib64/qt5/plugins
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Found KF5I18n: /usr/lib64/cmake/KF5I18n/KF5I18nConfig.cmake (found version "5.75.0") 
-- Found KF5Service: /usr/lib64/cmake/KF5Service/KF5ServiceConfig.cmake (found version "5.75.0") 
-- Installing in the same prefix as Qt, adopting their path scheme.
-- Found KF5Runner: /usr/lib64/cmake/KF5Runner/KF5RunnerConfig.cmake (found version "5.75.0") 
-- Found KF5TextWidgets: /usr/lib64/cmake/KF5TextWidgets/KF5TextWidgetsConfig.cmake (found version "5.75.0") 
-- Found KF5ConfigWidgets: /usr/lib64/cmake/KF5ConfigWidgets/KF5ConfigWidgetsConfig.cmake (found version "5.75.0") 
-- Found KF5PlasmaQuick: /usr/lib64/cmake/KF5PlasmaQuick/KF5PlasmaQuickConfig.cmake (found version "5.75.0") 
-- Found KF5: success (found version "5.75.0") found components: I18n Service Runner TextWidgets ConfigWidgets PlasmaQuick 
-- Setting build type to 'Debug' as none was specified.
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- The following OPTIONAL packages have been found:

 * KF5Sonnet (required version >= 5.75.0)
 * KF5Auth (required version >= 5.75.0)
 * KF5Codecs (required version >= 5.75.0)
 * KF5WidgetsAddons (required version >= 5.75.0)
 * KF5Package (required version >= 5.75.0)
 * KF5CoreAddons (required version >= 5.75.0)
 * KF5WindowSystem (required version >= 5.75.0)
 * KF5Plasma (required version >= 5.75.0)

-- The following REQUIRED packages have been found:

 * Qt5Network (required version >= 5.14.2)
 * Qt5Qml (required version >= 5.14.2)
 * Qt5QmlModels (required version >= 5.14.2)
 * Qt5Quick
 * Qt5QuickWidgets
 * Qt5
 * KF5Runner
 * Gettext
 * KF5I18n (required version >= 5.75.0)
 * KF5TextWidgets
 * KF5ConfigWidgets
 * Qt5Gui (required version >= 5.12.0)
 * ECM (required version >= 1.6.0)
 * KF5Service (required version >= 5.75.0)
 * Qt5Widgets (required version >= 5.12.0)
 * KF5PlasmaQuick
 * KF5
 * Qt5Core

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ovv/projects/ovv/krunner-vscodeprojects

~/projects/ovv/krunner-vscodeprojects master
❯ cpack
CPack: Create package using RPM
CPack: Install projects
CPack: - Run preinstall target for: vscodeprojectsrunner
CPack: - Install project: vscodeprojectsrunner []
CPack: Create package
CPackRPM: Will use GENERATED spec file: /home/ovv/projects/ovv/krunner-vscodeprojects/_CPack_Packages/Linux/RPM/SPECS/krunner-vscodeprojectsrunner.spec
CPack: - package: /home/ovv/projects/ovv/krunner-vscodeprojects/krunner-vscodeprojectsrunner-1.0.1-Fedora.rpm generated.

~/projects/ovv/krunner-vscodeprojects master 10s
❯ sudo dnf install /home/ovv/projects/ovv/krunner-vscodeprojects/krunner-vscodeprojectsrunner-1.0.1-Fedora.rpm
[sudo] password for ovv: 
Last metadata expiration check: 1:03:41 ago on Wed 25 Nov 2020 12:49:28 CET.
Dependencies resolved.
===============================================================================================================================================================================================
 Package                                                     Architecture                          Version                                   Repository                                   Size
===============================================================================================================================================================================================
Installing:
 krunner-vscodeprojectsrunner                                x86_64                                1.0.1-1                                   @commandline                                538 k

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package

Total size: 538 k
Installed size: 1.9 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                       1/1 
  Running scriptlet: krunner-vscodeprojectsrunner-1.0.1-1.x86_64                                                                                                                           1/1 
  Installing       : krunner-vscodeprojectsrunner-1.0.1-1.x86_64                                                                                                                           1/1 
  Running scriptlet: krunner-vscodeprojectsrunner-1.0.1-1.x86_64                                                                                                                           1/1 
  Verifying        : krunner-vscodeprojectsrunner-1.0.1-1.x86_64                                                                                                                           1/1 

Installed:
  krunner-vscodeprojectsrunner-1.0.1-1.x86_64                                                                                                                                                  

Complete!

And the generated spec files

❯ cat /home/ovv/projects/ovv/krunner-vscodeprojects/_CPack_Packages/Linux/RPM/SPECS/krunner-vscodeprojectsrunner.spec
# Restore old style debuginfo creation for rpm >= 4.14.
%undefine _debugsource_packages
%undefine _debuginfo_subpackages

# -*- rpm-spec -*-
BuildRoot:      %_topdir/krunner-vscodeprojectsrunner-1.0.1-Linux
Summary:        A Krunner Plugin which allows you to open your recent VSCode projects
Name:           krunner-vscodeprojectsrunner
Version:        1.0.1
Release:        1
License:        LGPL 3
Group:          unknown
Vendor:         Humanity

Url: https://github.com/alex1701c/krunner-vscodeprojects
Requires: kf5-krunner >= 5.75.0

Prefix: /usr

%define _rpmdir %_topdir/RPMS
%define _srcrpmdir %_topdir/SRPMS
%define _rpmfilename krunner-vscodeprojectsrunner-1.0.1-Fedora.rpm
%define _unpackaged_files_terminate_build 0

%description
DESCRIPTION
===========

This is an installer created using CPack (https://cmake.org). No additional installation instructions provided.

# This is a shortcutted spec file generated by CMake RPM generator
# we skip _install step because CPack does that for us.
# We do only save CPack installed tree in _prepr
# and then restore it in build.
%prep
mv $RPM_BUILD_ROOT %_topdir/tmpBBroot

%install
if [ -e $RPM_BUILD_ROOT ];
then
  rm -rf $RPM_BUILD_ROOT
fi
mv %_topdir/tmpBBroot $RPM_BUILD_ROOT

%clean

%post

#!/bin/bash

if pgrep -x krunner > /dev/null
then
    killall krunner
fi

%postun
#!/bin/bash

if pgrep -x krunner > /dev/null
then
    killall krunner
fi

%pre

%preun

%files
%defattr(-,root,root,-)
"/usr/share/icons/code_runner.svg"
"/usr/share/kservices5/plasma-runner-vscodeprojectsrunner_config.desktop"

%config "/usr/lib64/qt5/plugins/kcm_krunner_vscodeprojectsrunner.so"
%config "/usr/lib64/qt5/plugins/kf5/krunner/krunner_vscodeprojectsrunner.so"

%changelog
* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - 1.0.1-1
  Generated by CPack RPM (no Changelog file were provided)
alex1701c commented 3 years ago

Then I will apply the config from that project and create a new build

alex1701c commented 3 years ago

https://github.com/alex1701c/JetBrainsRunner/commit/935109169b0765b74920c47049a8355ebbfeaf49

alex1701c commented 3 years ago

Is this issue resolved? I have checked the latest release in a Fedora VM and it installs properly.

ovv commented 3 years ago

Yes, the 1.7 fedora rpm works fine. Thanks !