25c23e8
%{!?ruby_sitelib:	%define ruby_sitelib	%(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
25c23e8
%define		rubyabi		1.8
25c23e8
25c23e8
Name:		alexandria
25c23e8
Version:	0.6.1
25c23e8
Release:	3%{?dist}
25c23e8
Summary:	Book collection manager
25c23e8
25c23e8
Group:		Applications/Productivity
25c23e8
License:	GPL
25c23e8
URL:		http://alexandria.rubyforge.org/
25c23e8
Source0:	http://rubyforge.org/frs/download.php/6308/%{name}-%{version}.tar.gz
25c23e8
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
25c23e8
25c23e8
BuildArch:	noarch
25c23e8
BuildRequires:	ruby
25c23e8
BuildRequires:	ruby-devel
25c23e8
BuildRequires:	ruby(abi) = %{rubyabi}
25c23e8
BuildRequires:	desktop-file-utils
25c23e8
BuildRequires:	gettext
25c23e8
BuildRequires:	intltool
25c23e8
BuildRequires:	scrollkeeper
25c23e8
25c23e8
BuildRequires:	ImageMagick
25c23e8
25c23e8
Requires:	ruby
25c23e8
Requires:	ruby(abi) = %{rubyabi}
25c23e8
25c23e8
Requires:	ruby(amazon)
25c23e8
Requires:	ruby(gettext-package)
25c23e8
Requires:	ruby(zoom)
25c23e8
25c23e8
Requires:	ruby(gconf2)
25c23e8
Requires:	ruby(gdkpixbuf2)
25c23e8
Requires:	ruby(glib2)
25c23e8
Requires:	ruby(gnome2)
25c23e8
Requires:	ruby(libglade2)
25c23e8
25c23e8
Requires(post):		scrollkeeper
25c23e8
Requires(postun):	scrollkeeper
25c23e8
Requires(pre):		GConf2
25c23e8
Requires(post):		GConf2
25c23e8
Requires(preun):	GConf2
25c23e8
25c23e8
%description
25c23e8
Alexandria is a GNOME application to help you manage your book collection.
25c23e8
25c23e8
%prep
25c23e8
%setup -q
25c23e8
25c23e8
%build
25c23e8
ruby install.rb config
25c23e8
ruby install.rb setup
25c23e8
25c23e8
%install
25c23e8
%{__rm} -rf $RPM_BUILD_ROOT
25c23e8
25c23e8
# disable scrollkeeper
25c23e8
%{__mkdir} tmpbin
25c23e8
%{__ln_s} -f /bin/true tmpbin/scrollkeeper-update
25c23e8
export PATH="$(pwd)/tmpbin:$PATH"
25c23e8
25c23e8
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
25c23e8
ruby install.rb install --prefix=$RPM_BUILD_ROOT
25c23e8
25c23e8
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/applications/
25c23e8
desktop-file-install \
25c23e8
	--vendor fedora \
25c23e8
	--remove-category Application \
25c23e8
	--dir $RPM_BUILD_ROOT%{_datadir}/applications/ \
25c23e8
	%{name}.desktop
25c23e8
25c23e8
# create 64x64, 128x128 icon
25c23e8
for s in 64 128 ; do
25c23e8
	%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/
25c23e8
	convert -scale ${s}x${s} \
25c23e8
		data/alexandria/icons/%{name}.png \
25c23e8
		$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/%{name}.png
25c23e8
done
25c23e8
25c23e8
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/gconf/schemas/
25c23e8
%{__install} -c -p -m 0644 schemas/%{name}.schemas \
25c23e8
	$RPM_BUILD_ROOT%{_sysconfdir}/gconf/schemas/
25c23e8
25c23e8
%find_lang %{name}
25c23e8
25c23e8
%clean
25c23e8
%{__rm} -rf $RPM_BUILD_ROOT
25c23e8
25c23e8
%pre
25c23e8
if [ "$1" -gt 1 ]; then
25c23e8
	export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
25c23e8
	gconftool-2 --makefile-uninstall-rule \
25c23e8
		%{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || :
25c23e8
fi
25c23e8
25c23e8
%post
25c23e8
touch --no-create %{_datadir}/icons/hicolor/ || :
25c23e8
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
25c23e8
25c23e8
%{_bindir}/scrollkeeper-update -q -o %{_datadir}/omf/%{name} || :
25c23e8
25c23e8
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
25c23e8
gconftool-2 --makefile-install-rule \
25c23e8
	%{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
25c23e8
25c23e8
%preun
25c23e8
if [ "$1" -eq 0 ]; then
25c23e8
	export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
25c23e8
	gconftool-2 --makefile-uninstall-rule \
25c23e8
		%{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
25c23e8
fi
25c23e8
25c23e8
%postun
25c23e8
touch --no-create %{_datadir}/icons/hicolor/ || :
25c23e8
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
25c23e8
25c23e8
%{_bindir}/scrollkeeper-update -q || :
25c23e8
25c23e8
%files -f %{name}.lang
25c23e8
%defattr(-,root,root,-)
25c23e8
%doc AUTHORS COPYING ChangeLog NEWS README TODO
25c23e8
%{_bindir}/%{name}
25c23e8
%{ruby_sitelib}/%{name}.rb
25c23e8
%{ruby_sitelib}/%{name}/
25c23e8
25c23e8
%{_sysconfdir}/gconf/schemas/%{name}.schemas
25c23e8
25c23e8
%{_datadir}/%{name}/
25c23e8
%{_datadir}/gnome/help/%{name}/
25c23e8
%{_datadir}/omf/%{name}/
25c23e8
25c23e8
%{_datadir}/applications/fedora-%{name}.desktop
25c23e8
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
25c23e8
25c23e8
%changelog
25c23e8
* Fri May 11 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.6.1-3
25c23e8
- This time completely disable scrollkeeper-update
25c23e8
- Create 128x128 icon also
25c23e8
25c23e8
* Tue May  1 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.6.1-2
25c23e8
- Fix scriptlets typo
25c23e8
25c23e8
* Sun Apr 22 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.6.1-1
25c23e8
- Initial packaging
25c23e8