Hallo.
I collected several issues you may find during the prefix move to /usr.
Contents
General rules
Files which require special care
Obsolete package
Obsolete directories
Files which should not appear in file list
Multiple directory ownership and unowned directories
libtool error /opt/gnome/lib/libfoo.la not found
Missing icon error
General rules
You can consult any core GNOME package, if you need an example of a
simple spec file.
Use as small BuildRequires as possible
Watch pc and libtool linking and add correct -devel dependencies.
Split out gtk-doc developer documentation to -doc subpackage.
Prefer %configure, which already covers many path specifiers and also
includes basic CFLAGS and CXXFLAGS.
Remove all obsolete configure options.
Prevent all force actions (e. g. rm -rf). These actions never fail and
probably will remain in the spec file years after they become obsolete.
Use %suse_update_desktop_file for all installed icons to allow in-house
translation (Factory packages only).
Do not use rm -rf $RPM_BUILD_ROOT in install, it opens a security hole.
If your patch contains new strings, ask for including to
gnome-patch-translation project.
Watch carefully, whether the Norwegian hack does not overwrite
up-to-date nb.po by outdated no.po.
Files which require special care
%{_datadir}/mime/packages/*.xml
Following scriptlets are needed:
%post
if test -x usr/bin/update-mime-database ; then
usr/bin/update-mime-database usr/share/mime >/dev/null
fi
%postun
if test -x usr/bin/update-mime-database ; then
usr/bin/update-mime-database usr/share/mime >/dev/null
fi
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/gnome/help/*
Following modification are needed:
%install
...
%find_lang foo
%files -f foo.lang
and exclude files from explicitly listed files
Where foo is %{name} or other string depending on base name.
For more base names:
%find_lang foo
%find_lang foo2 foo.lang
%{_sysconfdir}/gconf/schemas/*.schemas
Following modification are needed:
Build system requires: gconf2-devel
Preamble:
%gconf_schemas_prereq
%install
...
%find_gconf_schemas
or
%def_gconf_schemas subpackage1
%add_gconf_schemas schemas_name1
%add_gconf_schemas schemas_name2
%def_gconf_schemas subpackage2
%add_gconf_schemas schemas_name3
%add_gconf_schemas schemas_name4
%end_gconf_schemas
schemas names are without path and suffix
%pre -f %{name}.schemas_pre
%preun -f %{name}.schemas_preun
%posttrans -f %{name}.schemas_posttrans
%files -f %{name}.schemas_list
or
%files -f subpackage.schemas_list
and exclude files from explicitly listed files
In case of more -f needed for one %files:
%install
...
%find_gconf_schemas
%find_lang %{name}
cat %{name}.schemas_list %{name}.lang >%{name}.lst
...
%files -f %{name}.lst
Obsolete package
gnome-filesystem
This package will be dropped. Directories from it was moved to
filesystem or to the package, where it logically belongs. Later there
will be created compatibility package for third party packages
in /opt/gnome.
Obsolete directories
%{_datadir}/mime-info
%{_datadir}/application-registry
These directories are part of obsolete GNOME MIME Info used by GNOME1
and early GNOME2. You should covert it to shared mime info:
Consult /usr/share/mime/packages/freedesktop.org.xml. If your MIME type
is already there, delete these directories.
If not, you have to create MIME description. Call mime-info-to-mime and
the delete old contents. As an example see devhelp, gnome-pilot,...
Edit resulting xml file and attach it to the bug report to upstream
("Use Shared MIME Info instead of obsolete GNOME MIME Info"). I can send
you an automake templates for it.
%{_datadir}/gnome/apps
Part of GNOME1 menu system. Move it to %{_datadir}/applications, add
Categories entry and report to upstream.
%{_prefix}/lib/gnome-applets
Change it to --libexecdir=%{_prefix}/lib/gnome-panel, which better
fits to package name, where it technically belongs.
%{_datadir}/mime with exception of %{_datadir}/mime/packages/*.xml
These files are auto generated and created by mistake and must never
appear in file list. Use --disable-update-mimedb (if implemented) or
delete them. See "Special files which require scriptlets" above.
%{_libdir}/path/*.*a
If "path" is not listed in the *.pc or *-config file, these files are
most probably obsolete and should be removed.
%{_libdir}/executable or %{_libdir}/path/executable
These paths are bi-arch unaware and may cause bi-arch problems. If it is
not an upstream problem, you are probably missing --libexecdir.
Use --libexecdir=%{_prefix}/lib or --libexecdir=%{_prefix}/lib/%{name}
depending on installed path (choose the shortest one which does not
install executables directly to %{_prefix}/lib). For GNOME panel applets
you can use also --libexecdir=%{_prefix}/lib/gnome-panel.
Files which should not appear in file list
%{_sysconfdir}/gconf/schemas
Use %find_gconf_schemas instead of explicit listing
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/gnome/help/*
Use %find_lang
Multiple directory ownership and unowned directories
We are trying to avoid multiple directory ownership as much as possible.
Some directories were moved to particular packages. To fulfil directory
ownership requirement, you have to add this package to BuildRequires and
Requires. If you believe that it is not logical in your case, please
contact GNOME team or add "# FIXME: Strange directory ownership" comment
to your spec file. If you believe that your package is a good candidate
for multiple directory ownership (e. g. you provide branding or module
and not require package itself), include directory itself to ownership
and comment the reason in the spec file.
libtool error /opt/gnome/lib/libfoo.la not found
This error most probably means, that one of library providing package
was not properly recompiled with libraries in the new location. To find
the library,
grep /opt/gnome/lib/libfoo.la /usr/lib/*.la /opt/gnome/lib/*.la.
Missing icon error
If you get a missing icon error, you should most probably link icon from
%{_datadir}/icons to %{_datadir}/pixmaps. Choose 48x48, if not possible,
use largest smaller or svg file and link it to %{_datadir}/pixmaps.
mkdir $RPM_BUILD_ROOT/usr/share/pixmaps
ln -s ../icons/hicolor/48x48/apps/foo.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/
In case the path begins with icons/hicolor, it's OK and this hack should
disapper once we will be sure, that all desktop menu systems are aware
of icons.
In case the path does not begin with icons/hicolor (e. g. begins by
icons/gnome, report issue as an upstream bug.
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: [EMAIL PROTECTED]
Lihovarská 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]