I have a couple RPM packages I've made which I have to rebuild for for
CentOS 3/4/5, i386 and 64 bit versions (free RedHat clones). They
rebuild fine on the different OS's, but all i386 RPMs end up being named
the same thing, same with all x86_64 RPMs. There is nothing in the RPM
name to signify what OS it has been built for.

 

In other words, currently when I rebuild my source RPM on the different
OS's I end up with just two unique filenames, package-1.0-1.i386.rpm and
package-1.0-1.x86_64.rpm. I'd like it to be more like
package-1.0-1.el3.i386.rpm, package-1.0-1.el3.x86_64.rpm,
package-1.0-1.el4.i386.rpm, package-1.0-1.el4.x86_64.rpm,
package-1.0-1.el5.i386.rpm, package-1.0-1.el5.x86_64.rpm. 

 

Currently I'm just manually renaming the RPMs after they are built but
I'm sure there is an easier way to do this in the spec file. Is there a
macro available for this? %{_os} just comes back as linux, same with
%{_target_os}, and %{_arch} is i386/x86_64. I'm not spotting anything
else in the /usr/lib/rpm/macros and /usr/lib/rpm/redhat/macros files.

 

As a workaround, this seems to do the trick, but of course this will
only let me build the RPM on a CentOS server, not Fedora or an official
Redhat server:

 

%define osversion %(rpm -q --queryformat='%{VERSION}' centos-release|cut
-d. -f1)

Release: 1.el%{osversion}

 

Thanks!

_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to