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