LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-30-2007, 11:30 AM   #1
Luminoth
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Rep: Reputation: 0
RPM dependency question


We have an RPM here we create here for RedHat 8 that we'd like to use on RHEL4 as well. Everything's worked great except for the compat-libstdc++ dependency in the spec file:

Requires: compat-libstdc++

It looks like the package was renamed for RHEL4 (the files from the RH8 compat-libstdc++ package are installed by compat-libstdc++-296-2.96-132.7.2 in RHEL4). Is there any way I can change the dependency to work with both? Or is it at all possible to fix this without having to create two separate spec files? Thanks in advance for any advice on this.
 
Old 08-30-2007, 11:35 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Hi and welcome to LQ.

You can edit the spec file and change the compat-libstdc++ dependency to compat-libstdc++-296 and then rebuild the rpm.
 
Old 08-30-2007, 11:37 AM   #3
Luminoth
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Wouldn't that break it on RH8?
 
Old 08-30-2007, 04:43 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Sorry, I missed the part where you said you want the rpm to work on both distros. The only possible solution that I can see is to build two separate rpms, one for each distro.
 
Old 08-31-2007, 08:12 AM   #5
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
If you edit the spec file correctly then it should work on either, see this example spec file;

Code:

## distro/release specific support
%if 0%{?fedora} > 4 || 0%{?rhel} > 4
%define _with_hal --with-hal
%endif


Name:    k3b
Summary: CD/DVD burning application for KDE
Epoch:   0
Version: 1.0.3
Release: 1%{?dist}

Group:   Applications/Archiving
License: GPL
URL:     http://www.k3b.org
Source0: http://dl.sf.net/k3b/k3b-%{version}.tar.bz2
Source1: http://dl.sf.net/k3b/k3b-i18n-%{version}.tar.bz2
Source2: k3brc

Patch1: k3b-i18n-0.12.17-rellink.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# TODO: bugzilla/document
ExcludeArch: s390 s390x

BuildRequires: kdelibs-devel 
BuildRequires: desktop-file-utils
BuildRequires: automake
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel


%{?_with_hal:BuildRequires: dbus-qt-devel hal-devel}


BuildRequires: flac-devel
BuildRequires: gettext
BuildRequires: libdvdread-devel
BuildRequires: libmpcdec-devel
BuildRequires: libmusicbrainz-devel
BuildRequires: libsamplerate-devel
BuildRequires: libsndfile-devel
BuildRequires: libvorbis-devel
BuildRequires: taglib-devel
BuildRequires: zlib-devel

Obsoletes: k3b-extras < %{epoch}:%{version}-%{release}
Provides:  k3b-extras = %{epoch}:%{version}-%{release} 
# imo, should be packaged separately, tis a shame to duplicate all this noarch
# build/data on *every* arch.  -- Rex
Obsoletes: %{name}-i18n < %{epoch}:%{version}-%{release}
Provides: %{name}-i18n = %{epoch}:%{version}-%{release}

Requires: cdrecord mkisofs
%if 0%{?fedora} > 3
Requires(hint): cdrdao
Requires(hint): dvd+rw-tools
%endif

%description
K3b provides a comfortable user interface to perform most CD/DVD
burning tasks. While the experienced user can take influence in all
steps of the burning process the beginner may find comfort in the
automatic settings and the reasonable k3b defaults which allow a quick
start.

%package devel
Summary: Files for the development of applications which will use k3b
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}

%description devel
Files for the development of applications, which will use k3b.


%prep
%setup -q -a 1 -n %{name}-%{version}

pushd %{name}-i18n-%{version}
%patch1 -p2 -b .lns
#aclocal
#autoconf
make -f admin/Makefile.common
popd


%build
unset QTDIR || : ; . /etc/profile.d/qt.sh

%configure \
  --includedir=%{_includedir}/k3b \
  --disable-rpath \
  --enable-new-ldflags \
  --enable-debug --disable-warnings \
  --disable-dependency-tracking --disable-final \
  --with-k3bsetup=no \
  --with-arts \
  --with-oggvorbis \
  --with-flac \
  --with-external-libsamplerate \
  --with-musicbrainz \
  --with-sndfile \
  --without-ffmpeg \
  --with-libmad \
  --with-lame \
  --with-musepack \
  %{?_with_hal} %{!?_with_hal:--without-hal} 

make %{?_smp_mflags}

# Build for i18n tarball
pushd %{name}-i18n-%{version}
%configure
make %{?_smp_mflags}
popd


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# Install for i18n tarball
pushd %{name}-i18n-%{version}
make install DESTDIR=$RPM_BUILD_ROOT
popd

%{__install} -D -m 644 -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/config/k3brc

desktop-file-install --vendor="" \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications/kde \
  $RPM_BUILD_ROOT%{_datadir}/applications/kde/*.desktop

# remove the .la files
rm -f $RPM_BUILD_ROOT%{_libdir}/libk3b*.la 

# remove i18n for Plattdeutsch (Low Saxon)
rm -fr $RPM_BUILD_ROOT%{_datadir}/locale/nds

rm -f $RPM_BUILD_ROOT%{_docdir}/HTML/en/k3b/common 
ln -s ../common $RPM_BUILD_ROOT%{_docdir}/HTML/en/k3b/common

pushd $RPM_BUILD_ROOT%{_datadir}/doc/HTML
for i in *; do
	test -d $i && mkdir $i/common 2>/dev/null
done
popd

%find_lang %{name} 
%find_lang k3bsetup
%find_lang libk3b
%find_lang libk3bdevice

cat k3bsetup.lang libk3b.lang libk3bdevice.lang >> %{name}.lang


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 ||:

%postun
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 ||:


%files -f %{name}.lang
%defattr(-,root,root,755)
%doc AUTHORS README COPYING TODO ChangeLog
%{_bindir}/k3b
%{_datadir}/applications/kde/*.desktop
%{_datadir}/applnk/.hidden/*.desktop
%{_datadir}/mimelnk/application/x-k3b.desktop
%{_libdir}/libk3b*.so.*

%{_libdir}/kde3/*.so
%{_libdir}/kde3/*.la
%{_datadir}/apps/konqsidebartng/virtual_folders/services/videodvd.desktop
%{_datadir}/services/kfile_k3b.desktop
%{_datadir}/services/videodvd.protocol

%{_datadir}/apps/k3b/
%{_datadir}/apps/konqueror/servicemenus/*
%{_datadir}/config/*
%{_datadir}/sounds/*
%{_datadir}/icons/hicolor/*/*/*
%doc %{_docdir}/HTML/en/*

# files from i18n
%lang(da) %doc %{_docdir}/HTML/da/*
%lang(de) %doc %{_docdir}/HTML/de/*
%lang(en) %doc %{_docdir}/HTML/en/*
%lang(es) %doc %{_docdir}/HTML/es/*
%lang(et) %doc %{_docdir}/HTML/et/*
%lang(fr) %doc %{_docdir}/HTML/fr/*
%lang(it) %doc %{_docdir}/HTML/it/*
%lang(nl) %doc %{_docdir}/HTML/nl/*
%lang(pt) %doc %{_docdir}/HTML/pt/*
%lang(pt_BR) %doc %{_docdir}/HTML/pt_BR/*
%lang(ru) %doc %{_docdir}/HTML/ru/*
%lang(sv) %doc %{_docdir}/HTML/sv/*
%lang(uk) %doc %{_docdir}/HTML/uk/*
%lang(pl) %doc %{_docdir}/HTML/pl/*

# devel subpackage
%files devel
%defattr(-,root,root,755)
%doc %{name}-i18n-%{version}/README 
%doc %{name}-i18n-%{version}/COPYING 
%{_includedir}/k3b/
%{_libdir}/libk3b*.so

%changelog
<snipped>
 
Old 09-01-2007, 10:06 AM   #6
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Quote:
Originally Posted by Luminoth View Post
Requires: compat-libstdc++
Don't put such hardcoded dependencies on package names into your spec files. Instead, let rpm-build do its job. It creates automatic dependencies on libraries by examining executable files in the buildroot. For your software you should see automatic dependencies on the needed library sonames, which is tons better than hardcoding package names.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
building rpm dependency question Neruocomp Red Hat 2 09-14-2005 09:50 PM
RPM dependency help (apt 4 rpm) Cubsy Linux - Software 4 10-08-2004 04:15 PM
RPM Dependency Question cmpaul Linux - Software 4 08-13-2003 06:16 PM
RPM dependency question tarballed Linux - Software 5 05-13-2003 11:11 AM
Help : rpm dependency error when install video driver rpm ymdwxm Linux - Software 1 04-04-2003 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration