Discussion:
spec file, with multiple architectures
Richard Shade
2008-03-17 19:53:38 UTC
Permalink
I want to use one spec file for multiple architectures. However there is the
following line in my spec file:
on i386
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
on x86_64
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod

is there a way to make this architecture independent like:
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/%{_architecture}-linux-thread-multi/perllocal.pod
--
Thanks,

Richard Shade
RightScale
http://www.rightscale.com/
Tim Mooney
2008-03-17 21:03:55 UTC
Permalink
Post by Richard Shade
I want to use one spec file for multiple architectures. However there is the
on i386
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
on x86_64
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
You don't say what version of RPM you're using, or what distributions you
want to package for, but the easiest way to accomplish what you're asking
is just using globbing:

%{_libdir}/perl5/5.8.8/*-linux-thread-multi/perllocal.pod

Some versions of RPM include pre-defined macros for some of perl's
directories. In those cases, %{perl_sitearch} is what you're looking for.

%{_libdir}/perl5/5.8.8/%{perl_sitearch}/perllocal.pod

If your distribution doesn't define it, you can define it yourself,
assuming your version of RPM is new enough to handle this type of macro:

%define perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib)

However, packaging the perllocal.pod is (I think) a bad idea. You're
better off just skipping that file.

Tim
--
Tim Mooney ***@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
Richard Shade
2008-03-17 21:17:58 UTC
Permalink
Tim, Thanks
Post by Richard Shade
I want to use one spec file for multiple architectures. However there is the
Post by Richard Shade
on i386
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
on x86_64
%attr(0644,root,root)
%{_libdir}/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
You don't say what version of RPM you're using, or what distributions you
want to package for, but the easiest way to accomplish what you're asking
I am on 4.4.2 CentOS 5.

%{_libdir}/perl5/5.8.8/*-linux-thread-multi/perllocal.pod
Post by Richard Shade
Some versions of RPM include pre-defined macros for some of perl's
directories. In those cases, %{perl_sitearch} is what you're looking for.
%{_libdir}/perl5/5.8.8/%{perl_sitearch}/perllocal.pod
If your distribution doesn't define it, you can define it yourself,
%define perl_archlib %(eval "`perl -V:installarchlib`"; echo
$installarchlib)
However, packaging the perllocal.pod is (I think) a bad idea. You're
better off just skipping that file
Is this what you mean by skipping it?
%exclude %{_libdir}/perl5/5.8.8/%{_arch}-linux-thread-multi/perllocal.pod

Tim
Post by Richard Shade
--
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
--
Thanks,

Richard Shade
RightScale
http://www.rightscale.com/
Tim Mooney
2008-03-17 21:41:30 UTC
Permalink
Post by Richard Shade
Post by Tim Mooney
However, packaging the perllocal.pod is (I think) a bad idea. You're
better off just skipping that file
Is this what you mean by skipping it?
%exclude %{_libdir}/perl5/5.8.8/%{_arch}-linux-thread-multi/perllocal.pod
I've never used %exclude, but I assume that would work. We typically
just do this in the %install section:

find $RPM_BUILD_ROOT -name perllocal.pod -type f -exec rm -f {} \;

and then just don't even mention that file in the %files section.

Tim
--
Tim Mooney ***@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
Loading...