Geoffroy,

Looking a all spec files for oscar let me think that using 
/etc/rpm/macros.oscar could greatly easy oscar rpm packaging.

I mean, we could have some macros defined here once for all instead of having 
those defined from time to time in different package.

We could also use an oscar_home macro pointing to /opt.
Thus, if one need another place, no need to edit all the spec files.

for example, python_sitedir is defined in RHEL 6 but not in previous releases, 
thus, for now, we have stuffs like this:

%{expand:%%define py_ver %(python -V 2>&1| awk '{print $2}')}
%{expand:%%define py_libver %(python -V 2>&1| awk '{print $2}'|cut -d. -f1-2)}

...
%files
%defattr(-,root,root)
%dir /usr/%{_lib}/python%{py_libver}/site-packages/libapitest
/usr/%{_lib}/python%{py_libver}/site-packages/libapitest/*
...

while we could have:(provided a /etc/rpm/macros.oscar is part of oscar-devel)

# no macro defs in spec

...

%files
%defattr(-,root,root)
%dir %{python_sitelib}/libapitest
%{python_sitelib}/libapitest/*
...

I've attached a file that could be used as a start base.
I think it could be generated from a skeleton in the oscar-base build.

The big advantage of such an aproach is that it would be compatible with 
curret spec files that (re)define values, so the port to simplified rpm 
architecture would be easy and could be done spec by spec.

Do you agree for such a mod?

-- 
   Olivier LAHAYE
   Responsable calcul scientifique
   CEA DRT/LIST
   +33 1 69 08 13 25

# Root of oscar RPMS.
oscar_home      /opt
oscar_version_major     6
oscar_version_minor     1
oscar_version_release   1

manpref         /usr/local/man/man1

# Macro distro checks.
is_fc   %(test -e /etc/fedora-release && echo 1 || echo 0)
is_rh   %(test -e /etc/redhat-release && echo 1 || echo 0)
is_mdk  %(test -e /etc/mandrake-release && echo 1 || echo 0)
is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)

# Macros for python if not defined
__python   /usr/bin/python
python_sitearch    %(%{__python} -c "from distutils.sysconfig import 
get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
python_sitelib     %(%{__python} -c "from distutils.sysconfig import 
get_python_lib; import sys; sys.stdout.write(get_python_lib())")
python_version     %(%{__python} -c "import sys; 
sys.stdout.write(sys.version[:3])")


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to