Spec help

This forum is dedicated to packaging and translating :

On those activities rely the making of Mageia Linux Distribution.

Post all questions and information about packaging and translating : feedbacks, discussion about guidelines, packaging practices...

Spec help

Postby pete910 » Apr 7th, '15, 16:05

Been trying to update OBS-studio from 6.4 to the 8.3 release, however when building the rpms the main rpm always requires the dev packages to be installed to.

From what i've read
Code: Select all
BuildRequires:
means only needed when been built and
Code: Select all
Requires:
for what the package needs.

I am has me stuck to ne honest, also having the same issue with the new roccat rpms doing the same. Any pointers guys/gals?

Spec here

Code: Select all
Name:           obs-studio
Version:        0.8.3
Release: %mkrel 1
Summary:        A recording/broadcasting program

Group:          Multimedia
License:        GPL-2.0
URL:            https://obsproject.com/
Source:         %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-build

BuildRequires:  cmake
BuildRequires:  fontconfig-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  %{_lib}ffmpeg-devel
BuildRequires:  jansson-devel
BuildRequires:  %{_lib}pulseaudio-devel
BuildRequires:  qtbase5-common-devel
BuildRequires:   %{_lib}x264-devel
BuildRequires:  %{_lib}udev-devel
BuildRequires:  %{_lib}v4l-devel
BuildRequires:  %{_lib}xcomposite-devel
BuildRequires:  %{_lib}xinerama-devel
BuildRequires:  %{_lib}xrandr-devel
BuildRequires:  %{_lib}qt5widgets-devel
BuildRequires:  %{_lib}qt5network-devel
BuildRequires:  %{_lib}qt5x11extras-devel

%description
Open Broadcaster Software is free and open source software for video recording and live streaming.

%package devel
Summary:        A recording/broadcasting program - Development Files
Group:          Development/Multimedia
Requires:       %{name} = %{version}

%description devel
Open Broadcaster Software is free and open source software for video recording and live streaming.

%prep
%setup -q

%build
mkdir -p build && cd build
# does not like cmake macro as it fails to link in math.h (-lm)
cmake \
  -DUNIX_STRUCTURE=1 \
  -DCMAKE_INSTALL_PREFIX=/usr \
  ..

%install
cd build
%make_install

# fix lib package locations which are inconsistent since they are 64bit libs, but placed in lib/
%ifarch x86_64
mkdir -p %{buildroot}%{_libdir}/obs-plugins
# needs obs-plugins in lib/ even though 64bit
# mv %%{buildroot}/usr/lib/obs-plugins/* %%{buildroot}%%{_libdir}/obs-plugins
mv %{buildroot}/usr/lib/libobs*.so* %{buildroot}%{_libdir}
%endif

%post   -n %{name} -p /sbin/ldconfig
%postun -n %{name} -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%{_bindir}/obs
# needs obs-plugins in lib/ even though 64bit
%{_usr}/lib/obs-plugins
%{_libdir}/libobs.so.0
%{_libdir}/libobs-opengl.so*
%{_libdir}/libobsglad.so.0
%{_datadir}/applications/obs.desktop
%{_datadir}/icons/hicolor/256x256/apps/obs.png
%{_datadir}/obs

%files devel
%defattr(-, root, root)
%{_usr}/lib/cmake
%{_libdir}/libobs.so
%{_libdir}/libobsglad.so
%{_includedir}/obs

%changelog
* Mon Apr 6 2015 Pete Wallace (pete910)
- Updated to 0.8.3

* Sat Jan 3 2015 Pete Wallace (pete910)
- Addapted for use on mageia 5

* Thu Nov 13 2014 jimmy@boombatower.com
- Initial 0.6.4 release.
User avatar
pete910
 
Posts: 357
Joined: Jan 8th, '12, 18:53

Re: Spec help

Postby doktor5000 » Apr 7th, '15, 21:09

pete910 wrote:Been trying to update OBS-studio from 6.4 to the 8.3 release, however when building the rpms the main rpm always requires the dev packages to be installed to.

That is usually a different issue and not related to Requires/BuildRequires at all. If that happens, usually that is because no proper libification was done.
That means, the normal library package should only contain the library, and a separate -devel package contains the development headers and a symlink to the library.

pete910 wrote:From what i've read
Code: Select all
BuildRequires:
means only needed when been built and
Code: Select all
Requires:
for what the package needs.

Exactly. FWIW, Requires: are usually only added when some binaries are needed on the target system
Dependencies on libraries, perl/python and ruby stuff and some more are automatically added by rpm itself as it will scan all files that are packaged in the rpm for dependencies.
See the macro %__find_requires and /usr/lib/rpm/mageia/find-requires for more on that.
This is also extensively covered in our packaging guidelines: https://wiki.mageia.org/en/Packaging_gu ... t_Requires
Feel free to drop me some lines if things are unclear and I'll explain :)


The spec you posted looks OK so far, except that you should use %cmake to not have to fiddle around later manually with /usr/lib64 and /usr/lib ;)

For library packages, here's a skeleton spec, for your question regarding the dependencies on -dev packages pay attention to the %files list.
libskel_2.spec
(842 Bytes) Downloaded 169 times
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Spec help

Postby pete910 » Apr 9th, '15, 19:21

Well, still stuck. Not a clue what is causing it tbh.

I tried the %cmake but then the build fails on jannson needing 2.5 as it then fails to build the bundled version.
User avatar
pete910
 
Posts: 357
Joined: Jan 8th, '12, 18:53

Re: Spec help

Postby doktor5000 » Apr 9th, '15, 20:35

Hmmm, that sounds like a different issue. Usually with cmake it's good to go to the BUILD dir, and run ccmake .
to see which switches/options it accepts as you may need to adjust the paths to some libraries if it doesn't find them.

In this particular case you maybe need to adjust Jansson_LIB as it defaults to /bin/../lib64/libjansson.so which looks pretty weird.
But even that would not help unless you locally upgraded jansson to a version >= 2.5

-- Jansson >=2.5 not found, building bundled version


From a short try with the current version 0.9.1, manually running cmake . and make successfully builds obs-studio.
Maybe you should try that first.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Spec help

Postby doktor5000 » Apr 9th, '15, 20:42

Another approach would be to try a different source package for obs-studio, maybe the one from packman/opensuse:
http://packman.inode.at/suse/factory/Mu ... .1.src.rpm
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Spec help

Postby pete910 » Apr 9th, '15, 21:26

Not having a problem using cmake as originally used. It's the dev deps that's got me stuck . Was looking at the suse build earlier . will give that a go later and see.

Cheers Dok.

Edit: Had a go with the suse build/src. Same issue .
User avatar
pete910
 
Posts: 357
Joined: Jan 8th, '12, 18:53


Return to Packaging and translating for Mageia

Who is online

Users browsing this forum: No registered users and 1 guest