Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So, I'm trying to fix a spec file right now for rpmbuild.

On Suse, it looks like the X11 library development package is named "xorg-x11-libX11-devel" while on CentOS it seems to be named "libX11-devel". In an ideal universe, I could just use some magical binary operator to require one or the other. Something like:

BuildRequires:  xorg-x11-libX11-devel || libX11-devel

Does something like that exist, or do I need to script some sort of zainy thing to get this to work?

share|improve this question

2 Answers 2

You'll need to use a conditional for this.

%if 0%{?suse_version}      # any version of SuSE
BuildRequires: libX11-devel
%else
BuildRequires: xorg-x11-libX11-devel
%endif

Further information can be found from OpenSUSE and Fedora wikis respectively.

share|improve this answer

Is there a specific header file, e.g. /usr/include/X11/X11.h, that you can require instead?

share|improve this answer
    
RPM spec files are distribution dependent, no way around it. RPMs for one distribution are extremely unlikely to work on another one. Just write SPECs for each distribution, and be done. –  vonbrand Apr 26 '13 at 1:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.