Re: Creating .spec files



On Mon, 2003-12-08 at 12:56, Christian Lohmaier wrote:
> Hi James,
> 
> On Mon, Dec 08, 2003 at 11:12:31AM -0600, James Richardson wrote:
> > I'm in the process of putting together some spec files for some gnome 
> > apps, but i'm curious on how to handle the scrollkeeper documentation.
> 
> Scrollkeeper is a beast ;->
> You should make sure that you did specify you omf-file (if it's not in the
> default list)
> --with-omfdirs=/usr/share/omf:/usr/local/share/omf:/opt/gnome2/share/omf:/opt/gnome/share/omf:/opt/kde/omf
> 
> You have to specify all omf-dirs you want, the internal lists gets overvritten
> with that flag.
> (You can of course edit %sysconfdir/scrollkeeper.conf afterwards as well)

You also should use the %lang feature when applicable.
Some of it may need to be manually done.

Attached is a spec file I wrote for gnome-terminal 2.2 showing how I
dealt with scrollkeeper - including the %lang stuff (I had to manually
create a file for the omf lang stuff - that isn't built into rpm's
find_lang yet - or at least wasn't)

notice the following -

%define __gconftool_2 %_bindir/gconftool-2
%define __scrollkeeper_update %_bindir/scrollkeeper-update

# prevent creation of package if unpackaged files
%define _unpackaged_files_terminate_build 1

-=-
Source1: %{name}.omf.lang

-=-

export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%makeinstall
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
%__rm -rf %buildroot%_localstatedir/scrollkeeper

-=-

%find_lang %{name} --with-gnome
cat %{SOURCE1} >> %{name}.lang

-=-

%post
export GCONF_CONFIG_SOURCE=`%__gconftool_2 --get-default-source`
%__gconftool_2 --makefile-install-rule
%_sysconfdir/gconf/schemas/%{name}.schema
s > /dev/null
%__scrollkeeper_update

%postun
%__scrollkeeper_update

-=-=-=-=-=-

This was for an internal (not public) linux distribution - but these
techniques should work with any linux distro.
%define name gnome-terminal
%define ver 2.2.2
%define rel yjl1

%define __gconftool_2 %_bindir/gconftool-2
%define __scrollkeeper_update %_bindir/scrollkeeper-update

# prevent creation of package if unpackaged files
%define _unpackaged_files_terminate_build 1

Name: %{name}
Version: %{ver}
Release: %{rel}
Summary: Provides a Terminal Emulator
License: OSI Approved
Group: Gnome/Utilities
Packager: Michael A. Peters <mpeters mac com>
Url: http://www.gnome.org/
Source0: %{name}-%{ver}.tar.bz2
Source1: %{name}.omf.lang
# above really should be generated from find_lang - but isn't
BuildRoot: %_tmppath/%{name}-%{ver}-root

Requires: %__gconftool_2
Requires: %__scrollkeeper_update

%description
Provides a Terminal Emulator for use within the X11 environment.

%prep
%__rm -rf %buildroot && %__mkdir_p %buildroot

%setup -q

%build
%configure
%__make

%install
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%makeinstall
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
%__rm -rf %buildroot%_localstatedir/scrollkeeper
echo "%defattr(-,root,root)" > %_tmppath/%{name}.partial
for a in `find %buildroot%_datadir/gnome -type f |%__sed -e s?"^%buildroot"?""?`; do
    echo "$a" >> %_tmppath/%{name}.partial
done;

%__strip --strip-all %buildroot%_bindir/gnome-terminal

%find_lang %{name} --with-gnome
cat %{SOURCE1} >> %{name}.lang

%clean
%__rm -rf %buildroot

%files -f %{name}.lang 
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%config %_sysconfdir/gconf/schemas/%{name}.schemas
%_bindir/gnome-terminal
%_libdir/bonobo/servers/%{name}.server
%_datadir/applications/%{name}.desktop
%_datadir/%{name}
%_datadir/pixmaps/*.png

%post
export GCONF_CONFIG_SOURCE=`%__gconftool_2 --get-default-source`
%__gconftool_2 --makefile-install-rule %_sysconfdir/gconf/schemas/%{name}.schemas > /dev/null
%__scrollkeeper_update

%postun
%__scrollkeeper_update


%changelog
* Sat Sep 27 2003 Michael A. Peters <mpeters mac com>
- spec file cleanup

* Fri Jul 11 2003 Michael A. Peters <mpeters mac com>
- updated to 2.2.2

* Wed May 14 2003 Michael A. Peters <mpeters mac com>
- Created initial spec file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]