2

I'm writing a RPM spec file for building my software. The software depends on Crypto++. Crypto++ is named differently on different distributions, for example, on OpenSUSE, I should write

BuildRequires: libcryptopp-devel

But on Fedora, it should be

BuildRequires: cryptopp-devel

Now, how can I unify the two in a single spec file?

1 Answer 1

2

In this case you should be able to use pkgconfig(cryptopp). Packages that use pkg-config can use this syntax in both Fedora and SUSE, but this is a special case with pkgconfig, in other cases you'll need to use conditionals:

%if 0%{?fedora}
BuildRequires: cryptopp-devel
%endif

%if 0%{?suse_version}
BuildRequires: libcryptopp-devel
%endif

%if 0%{?mageia}
BuildRequires: lib64cryptopp-devel
%endif

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .