Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#76 Specfile patch to rename library packages in rpm builds...

Testing_purpose
open
nobody
None
5
2013-05-14
2013-05-14
FeRD
No

BTW, if you do want to rename the library rpm packages (which I'm all for!), the following patch (against your rev 5570) should get things all fixed up. I successfully built and installed all four parts of 0.7.63/0.4.29 incrementally using these specfiles, and running rpmlint against them produces only the most superficial of whining.

A couple of things worth mentioning:

  • Note that the library packages both obsolete the previous libfoo0 packages, which will cause yum/rpm to handle gracefully removing the old versions of those packages under the previous names, on upgrade.

  • I version-limited the Obsoletes: to <= the current version number, hardcoded.
    • (That gives you the option to distribute a libmediainfo0/libzen0 package under that name at some point in the future, which you might want to do if, say, you bump the primary lib version and want the legacy version to be able to coexist with it.)
    • So, if libmediainfo-1.0 provides libmediainfo.so.1, and obsoletes libmediainfo0 <= 0.7.63, you'll be able to distribute libmediainfo.so.0 as long as it's packaged as libmediainfo0 >= 0.7.64.

  • The devel BuildRequires I added to mediainfo.spec aren't strictly necessary (in fact, I didn't need to touch that spec), but they're a good idea to make sure that the packages are built against the right headers & linked to the right library version.

Here are the patches, also attached as a single file...

Index: ZenLib/Project/GNU/libzen.spec
===================================================================
--- ZenLib/Project/GNU/libzen.spec  (revision 441)
+++ ZenLib/Project/GNU/libzen.spec  (working copy)
@@ -20,17 +20,12 @@
 BuildRequires:  automake
 BuildRequires:  autoconf

-%description
-ZenLib is a C++ utility library. It includes classes for handling strings,
-configuration, bit streams, threading, translation, and cross-platform
-operating system functions.
-
-%package -n %{name}0
 Summary:       C++ utility library -- runtime
 Group:         System/Libraries
 Requires:      glibc
+Obsoletes:     %{name}0 <= 0.4.29

-%description -n %{name}0
+%description
 ZenLib is a C++ utility library. It includes classes for handling strings,
 configuration, bit streams, threading, translation, and cross-platform
 operating system functions.
@@ -41,7 +36,7 @@
 %package        doc
 Summary:        C++ utility library -- documentation
 Group:          Development/Libraries
-Requires:       %{name}0 = %{version}
+Requires:       %{name} = %{version}

 %description    doc
 ZenLib is a C++ utility library. It includes classes for handling strings,
@@ -53,8 +48,8 @@
 %package        devel
 Summary:        C++ utility library -- development
 Group:          Development/Libraries
-Requires:      %{name}0%{?_isa} = %{version}
-Requires:      glibc-devel
+Requires:       %{name}%{?_isa} = %{version}
+Requires:       glibc-devel

 %description    devel
 ZenLib is a C++ utility library. It includes classes for handling strings,
@@ -118,11 +113,11 @@
     %{buildroot}%{_libdir}/pkgconfig

-%post -n %{name}0 -p /sbin/ldconfig
+%post -p /sbin/ldconfig

-%postun -n %{name}0 -p /sbin/ldconfig
+%postun -p /sbin/ldconfig

-%files -n %{name}0
+%files
 %defattr(-,root,root,-)
 %doc History.txt License.txt ReadMe.txt
 %{_libdir}/%{name}.so.*

Index: MediaInfoLib/Project/GNU/libmediainfo.spec
===================================================================
--- MediaInfoLib/Project/GNU/libmediainfo.spec  (revision 5570)
+++ MediaInfoLib/Project/GNU/libmediainfo.spec  (working copy)
@@ -15,6 +15,7 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires:  gcc-c++
 BuildRequires:  libzen-devel >= %{libzen_version}
+Requires:       libzen >= %{libzen_version}
 BuildRequires:  pkgconfig
 BuildRequires:  zlib-devel
 BuildRequires:  doxygen
@@ -22,34 +23,11 @@
 BuildRequires:  automake
 BuildRequires:  autoconf

-%description
-MediaInfo is a convenient unified display of the most relevant technical
-and tag data for video and audio files.
-
-What information can I get from MediaInfo?
-* General: title, author, director, album, track number, date, duration...
-* Video: codec, aspect, fps, bitrate...
-* Audio: codec, sample rate, channels, language, bitrate...
-* Text: language of subtitle
-* Chapters: number of chapters, list of chapters
-
-DivX, XviD, H263, H.263, H264, x264, ASP, AVC, iTunes, MPEG-1,
-MPEG1, MPEG-2, MPEG2, MPEG-4, MPEG4, MP4, M4A, M4V, QuickTime,
-RealVideo, RealAudio, RA, RM, MSMPEG4v1, MSMPEG4v2, MSMPEG4v3,
-VOB, DVD, WMA, VMW, ASF, 3GP, 3GPP, 3GP2
-
-What format (container) does MediaInfo support?
-* Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
-  MPEG-2, MPEG-4, DVD (VOB) (Codecs: DivX, XviD, MSMPEG4, ASP,
-  H.264, AVC...)
-* Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF
-* Subtitles: SRT, SSA, ASS, SAMI
-
-%package -n %{name}0
 Summary:        Most relevant technical and tag data for video and audio files -- runtime
 Group:          System/Libraries
+Obsoletes:      %{name}0 <= 0.7.63

-%description -n %{name}0
+%description
 MediaInfo is a convenient unified display of the most relevant technical
 and tag data for video and audio files.

@@ -77,7 +55,7 @@
 %package        doc
 Summary:        Most relevant technical and tag data for video and audio files -- documentation
 Group:          Development/Libraries
-Requires:       %{name}0 = %{version}
+Requires:       %{name} = %{version}

 %description    doc
 MediaInfo is a convenient unified display of the most relevant technical
@@ -107,7 +85,7 @@
 %package        devel
 Summary:        Most relevant technical and tag data for video and audio files -- development
 Group:          Development/Libraries
-Requires:       %{name}0%{?_isa} = %{version}
+Requires:       %{name}%{?_isa} = %{version}
 Requires:       libzen-devel%{?_isa} >= %{libzen_version}

 %description    devel
@@ -192,11 +170,11 @@
 rm -f %{buildroot}%{_libdir}/%{name}.la

-%post -n %{name}0 -p /sbin/ldconfig
+%post -p /sbin/ldconfig

-%postun -n %{name}0 -p /sbin/ldconfig
+%postun -p /sbin/ldconfig

-%files -n %{name}0
+%files
 %defattr(-,root,root,-)
 %doc History.txt License.html ReadMe.txt
 %{_libdir}/%{name}.so.*

Index: MediaInfo/Project/GNU/mediainfo.spec
===================================================================
--- MediaInfo/Project/GNU/mediainfo.spec    (revision 5570)
+++ MediaInfo/Project/GNU/mediainfo.spec    (working copy)
@@ -75,8 +75,10 @@
 %package gui
 Summary:    Supplies technical and tag information about a video or audio file (GUI)
 Group:      Applications/Multimedia
-Requires:   libzen >= %{libzen_version}
-Requires:   libmediainfo >= %{libmediainfo_version}
+BuildRequires:  libzen-devel >= %{libzen_version}
+BuildRequires:  libmediainfo-devel >= %{libmediainfo_version}
+Requires:       libzen >= %{libzen_version}
+Requires:       libmediainfo >= %{libmediainfo_version}
 %if %{undefined rhel_version} || 0%{?rhel_version} < 600
 %if 0%{?mandriva_version}
 %ifarch x86_64
1 Attachments

Discussion