[opensuse-programming] RPM spec macro for distribution
SGkNCg0KSXMgdGhlcmUgYSBycG0gc3BlYyBtYWNybyB3aGljaCB0ZWxscyB1cyB3aGljaCBkaXN0cm8gd2UgcnVuPw0KbGlrZSAlaWZvcyBhbmQgJWlmYXJjaC4gSSBuZWVkIHRvIHNlcGFyYXRlIGJldHdlZW4gdmFyaW91cyBkaXN0cm9zLCBiZWNhdXNlDQpzZXR1cCBhbmQgY29uZmlnIGRpZmZlciBzbGlnaHRseS4NCg0KQ3VycmVudGx5IEkgdXNlIGluIHNwZWMgZmlsZToNCiANCiVkZWZpbmUgZGlzdHJvIHNsZXMNCg0KYW5kIA0KaWYgWyAle2Rpc3Ryb30gLWVxICdzbGVzJyBdOyB0aGVuDQogI2RvIHNsZXMgc3R1ZmYNCmVsc2UgaWYgWyAle2Rpc3Ryb30gLWVxICdyaGVsJyBdOyB0aGVuDQogI2RvIHJoZWwgc3R1ZmYNCmZpDQoNClRoZSBwcm9ibGVtIGlzIHRoYXQgdGhpcyBuZWVkcyBtYW51YWwgY2hhbmdpbmcgb2YgKi5zcGVjIGZpbGUNCldoaWNoIG1lYW5zIGEgYnVpbGQgc2NyaXB0IHRvIGJ1aWxkIHRoZSAqLnNwZWMgZmlsZSBiZWZvcmUgcnVubmluZyBycG1idWlsZCA6LSgNCg0KVGhhbmtzDQoNCi0tDQpNb3J0ZW4gQmrDuHJuc3ZpayANClNvZnR3YXJlIERldmVsb3Blcg0KKzQ3IDIxIDUyIDEyIDY1IChvZmZpY2UpDQorNDcgOTIgNDQgODMgMDIgKG1vYikNCm1vcnRlbi5iam9ybnN2aWtAZXhwZXJpYW4tc2NvcmV4Lm5vDQpFeHBlcmlhbiBEZWNpc2lvbiBBbmFseXRpY3MsIFBCIDEyMSwgMDEwMiBPc2xvLCBOb3J3YXkNCg0K---------------------------------------------------------------------To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.orgFor additional commands, e-mail: opensuse-programming+help@opensuse.org
Hi there, On Wed, 12 Sep 2007, 11:37:44 +0200, Morten Bjørnsvik wrote:
Hi
Is there a rpm spec macro which tells us which distro we run? like %ifos and %ifarch. I need to separate between various distros, because setup and config differ slightly.
Currently I use in spec file:
%define distro sles
and if [ %{distro} -eq 'sles' ]; then #do sles stuff else if [ %{distro} -eq 'rhel' ]; then #do rhel stuff fi
The problem is that this needs manual changing of *.spec file Which means a build script to build the *.spec file before running rpmbuild :-(
You find such macros near the end of /usr/lib/rpm/suse_macros; this is what my SLES 10 SP1 system shows: %suse_version 1010 %sles_version 10 %ul_version 0
Thanks
HTH, cheers. l8er manfred --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Wed, 12 Sep 2007 12:01:31 +0200, Manfred Hollstein wrote:
%suse_version 1010 %sles_version 10 %ul_version 0
It should also be noted that for different distributions like ubuntu or fedora you'd need different variables. See http://en.opensuse.org/Build_Service/cross_distribution_package_how_to#Detec... for how to check. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
participants (3)
-
Manfred Hollstein
-
Morten Bjørnsvik
-
Philipp Thomas