Author Topic: Fail to build RPM  (Read 2695 times)

ajschult

  • Jr. Member
  • **
  • Posts: 98
Fail to build RPM
« on: August 07, 2016, 02:19:53 AM »
After the build updates, I'm unable to build RPMs (with --rpm).  I've attached the full .err file, which ends with

error: Directory not found: /home/andrew/build/avidemux/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160806.x86_64/usr/include/avidemux/2.6/ADM_audioCodec

The directory does indeed not exist.  avidemux/2.6/ contains only qt5.  avidemux/2.6/qt5 contains

ADM_openGL
ADM_UIs
config.h

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6054
Re: Fail to build RPM
« Reply #1 on: August 07, 2016, 05:19:47 AM »
You have the developer libraries installed for audio codecs? List from ubuntu, don't know the equivalents of your system:

libaften-dev:          audio AC3 encoder - development files
libfaac-dev:           AAC audio encoder (development)
libfaad-dev:           freeware Advanced Audio Decoder - development files
libmp3lame-dev:        MP3 encoding library (development)
libasound2-dev:        shared library for ALSA applications -- development files
libdca-dev:            decoding library for DTS Coherent Acoustics streams (development)
libmad0-dev:           MPEG audio decoder development library
libogg-dev:            Ogg bitstream library development files
libopencore-amrnb-dev: Adaptive Multi Rate speech codec - development files
libopencore-amrwb-dev: Adaptive Multi-Rate - Wideband speech codec - development files
libopus-dev:           Opus codec library development files
libpulse-dev:          PulseAudio client development headers and libraries
libtwolame-dev:        MPEG Audio Layer 2 encoder (development files)
libvorbis-dev:         The Vorbis General Audio Compression Codec (development files)


Can't test any further (16.04.1) misses rpmbuild, 14.04 had this option.

You don't find a logbuildQT5 in your /tmp?
My understanding: that folder is being filled during the build with the needed components (rpm) to create the QT5 rpm installable?
« Last Edit: August 07, 2016, 05:51:26 AM by Jan Gruuthuse »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6054
Re: Fail to build RPM
« Reply #2 on: August 07, 2016, 05:31:57 AM »
After installing rpm, installing librpm-dev did not install rpm.
I could test further, rpm is building now.
this message is produced when building rpm:
Code: [Select]
error: Directory not found: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64/usr/include/avidemux/2.6/ADM_audioCodec
    Directory not found: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64/usr/include/avidemux/2.6/ADM_audioCodec
 ***
CPackRPM:Debug:    - /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/rpmbuildavidemux3-qt5.out
CPackRPM:Debug: *** Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.FhfjXH
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.atVtFb
Processing files: avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64


RPM build errors:
 ***
CPack Error: Problem copying the package: /home/jan/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160807.x86_64.rpm to /home/jan/avidemux2/buildQt5/avidemux3-qt5-2.6.12-160807.x86_64.rpm
CPack Error: Error when generating package: Avidemux_qt4
Makefile:97: recipe for target 'package' failed
make: *** [package] Error 1
** Failed at package**

with the same result as in the 1st post

Could this be an issue from ~/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/rpmbuildavidemux3-qt5.out
Code: [Select]
Processing files: avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64
« Last Edit: August 07, 2016, 05:58:47 AM by Jan Gruuthuse »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #3 on: August 07, 2016, 07:00:47 AM »
After the build updates, I'm unable to build RPMs (with --rpm).

Yes, like in http://avidemux.org/smif/index.php/topic,16975.msg76038.html#msg76038

Quote
I've attached the full .err file, which ends with

error: Directory not found: /home/andrew/build/avidemux/avidemux2/buildQt5/_CPack_Packages/Linux/RPM/avidemux3-qt5-2.6.12-160806.x86_64/usr/include/avidemux/2.6/ADM_audioCodec

The directory does indeed not exist.

The question is, why this directory gets included into the SPEC file for avidemux3-qt5 in the first place. avidemux3-qt5 should not own it.
« Last Edit: August 07, 2016, 07:05:00 AM by eumagga0x2a »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6054
Re: Fail to build RPM
« Reply #4 on: August 07, 2016, 09:37:18 AM »
after todays commits:
fc448bd   [common] Audiocodec is now in core
27c22d4   [build] Search lrelease-FLAVOR when lrelease is not there
c84e984   [build] Fedora style build all

Quote
** Preparing debs **
Preparing packages
** debs directory ready **
total 10804
-rw-rw-r-- 1 jan jan 1594296 aug  7 11:33 avidemux3-cli-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 4900591 aug  7 11:33 avidemux3-core-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan   53509 aug  7 11:33 avidemux3-plugins-CLI-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 1530746 aug  7 11:33 avidemux3-plugins-COMMON-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan  371741 aug  7 11:33 avidemux3-plugins-qt5-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan 2528345 aug  7 11:33 avidemux3-qt5-2.6.12-160807.x86_64.rpm
-rw-rw-r-- 1 jan jan   66766 aug  7 11:33 avidemux3-settings-2.6.12-160807.x86_64.rpm
** ALL DONE **
** The installable packages are in the debs folder **

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #5 on: August 07, 2016, 09:38:17 AM »
RPM packaging confirmed fixed by https://github.com/mean00/avidemux2/commit/fc448bdca4de801785fc19730c770e642be202d0, thanks.

BTW:

Code: [Select]
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../common/ADM_audioCodec/include)
in avidemux/admAppSettings.cmake looks out of place, isn't it?

ajschult

  • Jr. Member
  • **
  • Posts: 98
Re: Fail to build RPM
« Reply #6 on: August 07, 2016, 03:03:43 PM »
Right, the RPMs are built now, but their version is not quite happy,

Code: [Select]
# rpm -qp debs/avidemux3-qt5-2.6.12-160807.x86_64.rpm
avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64

that's coming from cmake/admCPackRpm.cmake,

Code: [Select]
SET(CPACK_RPM_PACKAGE_RELEASE "1.r${ADM_SUBVERSION}.bootstrap")

and ADM_SUBVERSION comes from cmake/admMainChecks.cmake

Code: [Select]
IF(RELEASE OR AVIDEMUX_EXTERNAL_BUILD)
        SET( ADM_SUBVERSION 0)
ELSE()
        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
ENDIF()

RELEASE is not set in cmake/avidemuxVersion.cmake, so I'm not sure what the issue is.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #7 on: August 07, 2016, 05:21:03 PM »
Right, the RPMs are built now, but their version is not quite happy,

Code: [Select]
# rpm -qp debs/avidemux3-qt5-2.6.12-160807.x86_64.rpm
avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64

I'm not sure ATM either:

Code: [Select]
for i in avidemux*.rpm; do echo -n $i:\ \  && rpm -qp $i; done
avidemux3-cli-2.6.12-160807.x86_64.rpm:  avidemux3-cli-2.6.12-1.r0.bootstrap.x86_64
avidemux3-core-2.6.12-160807.x86_64.rpm:  avidemux3-core-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-CLI-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-CLI-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-COMMON-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-COMMON-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-plugins-qt5-2.6.12-160807.x86_64.rpm:  avidemux3-plugins-qt5-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64
avidemux3-qt5-2.6.12-160807.x86_64.rpm:  avidemux3-qt5-2.6.12-1.r0.bootstrap.x86_64
avidemux3-settings-2.6.12-160807.x86_64.rpm:  avidemux3-settings-2.6.12-1.r160807_60937d79a0a.bootstrap.x86_64

This is with

Code: [Select]
diff --git a/cmake/admMainChecks.cmake b/cmake/admMainChecks.cmake
index 58f6291..79dfed2 100644
--- a/cmake/admMainChecks.cmake
+++ b/cmake/admMainChecks.cmake
@@ -131,7 +131,7 @@ MESSAGE(STATUS "****************")
 IF(RELEASE OR AVIDEMUX_EXTERNAL_BUILD)
         SET( ADM_SUBVERSION 0)
 ELSE()
-        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
+        admGetRevision( ${CMAKE_SOURCE_DIR}/../ ADM_SUBVERSION)
 ENDIF()
 MESSAGE("")
 include(avidemuxVersion)

as probably the source directory doesn't get set correctly.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10966
Re: Fail to build RPM
« Reply #8 on: August 07, 2016, 05:48:35 PM »
yes, side effects of source split
Thanks

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10966
Re: Fail to build RPM
« Reply #9 on: August 07, 2016, 05:50:07 PM »
That will not work for all components though

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #10 on: August 07, 2016, 06:01:52 PM »
Yes, it can't work because cli and qt reside one folder level deeper the core and plugins.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #11 on: August 07, 2016, 06:52:36 PM »
I have no idea whether it is ugly or not, but this fixes RPM version generation for me:

Code: [Select]
diff --git a/avidemux/cli/CMakeLists.txt b/avidemux/cli/CMakeLists.txt
index 67738ae..ae3c9da 100644
--- a/avidemux/cli/CMakeLists.txt
+++ b/avidemux/cli/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
 
 SET(AVIDEMUX_API_VERSION 2.6)
 SET(ADM_PROJECT Avidemux_cli)
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../)
 
 MESSAGE("")
 MESSAGE("#########################################")
diff --git a/avidemux/qt4/CMakeLists.txt b/avidemux/qt4/CMakeLists.txt
index ee0d936..2ce46a9 100644
--- a/avidemux/qt4/CMakeLists.txt
+++ b/avidemux/qt4/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 2.6)
 SET(AVIDEMUX_API_VERSION 2.6)
 SET(ADM_PROJECT Avidemux_qt4)
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../)
 
 MESSAGE("")
 MESSAGE("#########################################")
diff --git a/avidemux_plugins/CMakeLists.txt b/avidemux_plugins/CMakeLists.txt
index 0333abd..86fad1a 100644
--- a/avidemux_plugins/CMakeLists.txt
+++ b/avidemux_plugins/CMakeLists.txt
@@ -46,6 +46,7 @@ MESSAGE(STATUS "Found cmake subfolder.good.")
 ########################################
 # Where is the top dir ?
 ########################################
+SET(AVIDEMUX_TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../)
 
 # Common definitions...
 include(commonCmakeApplication)
diff --git a/cmake/admMainChecks.cmake b/cmake/admMainChecks.cmake
index 58f6291..2c8c604 100644
--- a/cmake/admMainChecks.cmake
+++ b/cmake/admMainChecks.cmake
@@ -131,7 +131,7 @@ MESSAGE(STATUS "****************")
 IF(RELEASE OR AVIDEMUX_EXTERNAL_BUILD)
         SET( ADM_SUBVERSION 0)
 ELSE()
-        admGetRevision( ${CMAKE_SOURCE_DIR} ADM_SUBVERSION)
+        admGetRevision( ${AVIDEMUX_TOP_SOURCE_DIR} ADM_SUBVERSION)
 ENDIF()
 MESSAGE("")
 include(avidemuxVersion)

With this patch I get:

Code: [Select]
find build* -name "*.spec" | xargs grep Release
buildCli/_CPack_Packages/Linux/RPM/SPECS/avidemux3-cli.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildCore/_CPack_Packages/Linux/RPM/SPECS/avidemux3-core.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsCLI/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-CLI.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsCommon/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-COMMON.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-plugins-qt5.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildPluginsSettings/_CPack_Packages/Linux/RPM/SPECS/avidemux3-settings.spec:Release:        1.r160807_60937d79a0a.bootstrap
buildQt5/_CPack_Packages/Linux/RPM/SPECS/avidemux3-qt5.spec:Release:        1.r160807_60937d79a0a.bootstrap

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #12 on: August 08, 2016, 04:57:50 PM »
I see now that my attempt at fixing the revision extraction partially reverts changes made in https://github.com/mean00/avidemux2/commit/fb4a0341c8f470a36741faa4fc2393125f8af143. Anyway, there is only one .git folder, so the modules must know how to get there to query the revision. Any working solution would serve not only RPM packaging but generally ensure that the git revision is shown in the GUI in the "Help" menu -> "About" even without any packaging (once I saw the CPack-generated *.spec files, I stopped using rpms and simply copied the content of the install/usr folder instead).

Just for the sake of correctness I attach a version of the same patch with a better chosen place for insertions and a short comment.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2608
Re: Fail to build RPM
« Reply #13 on: August 08, 2016, 06:16:00 PM »
I'm sorry, but https://github.com/mean00/avidemux2/commit/493c06480278b65305cf684a4b426999086c4a33 doesn't fix the issue.

Code: [Select]
                 admGetGitRevision( ${_dir} ADM_GIT_SVN_REVISION)
${_dir} doesn't get set to the parent directory if the current doesn't contain a .git folder.

BTW, do you like the idea that a script tests the parent directory simply if there is no .git folder in the current? What if there is no .git directory in the top source directory on purpose? What if there is an unrelated .git folder in the parent of the Avidemux top source directory?

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10966
Re: Fail to build RPM
« Reply #14 on: August 08, 2016, 07:10:28 PM »
I dont like it, but i dislike also having to propagate the top folder from the top cmakelists
I'm open to ideas