diff --git a/bbkeys.spec b/bbkeys.spec
index 7704d33..d38e293 100644
--- a/bbkeys.spec
+++ b/bbkeys.spec
@@ -1,11 +1,11 @@
Summary: Completely configurable key-combo grabber for blackbox
Name: bbkeys
Version: 0.9.0
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPL
Group: User Interface/Desktops
URL: http://bbkeys.sourceforge.net/
-Source: http://dl.sf.net/bbkeys/bbkeys-%{version}.tar.gz
+Source: http://downloads.sf.net/bbkeys/bbkeys-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: blackbox-devel
# Use monolithic X up to FC4, and modular X for FC5+ and non-Fedora
@@ -24,11 +24,11 @@ as well. bbkeys is easily configurable via directly hand-editing the user's
%prep
-%setup
+%setup -q
%build
-%configure
+%configure --datadir=%{_sysconfdir}
%{__make} %{?_smp_mflags}
@@ -36,7 +36,8 @@ as well. bbkeys is easily configurable via directly hand-editing the user's
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
# Clean this up, we package the exact same files cleanly in %%doc
-%{__rm} -rf %{buildroot}%{_datadir}/doc/bbkeys/
+# and it ends up in the wrong place with our override anyway
+%{__rm} -rf %{buildroot}%{_sysconfdir}/doc/
%clean
@@ -44,16 +45,25 @@ as well. bbkeys is easily configurable via directly hand-editing the user's
%files
-%defattr(-, root, root, 0755)
+%defattr(-,root,root,-)
%doc AUTHORS BUGS ChangeLog LICENSE NEWS README TODO
+%dir %{_sysconfdir}/bbkeys/
+%config(noreplace) %{_sysconfdir}/bbkeys/bbkeysrc
+%config(noreplace) %{_sysconfdir}/bbkeys/defaultStyle
%{_bindir}/bbkeys
-%dir %{_datadir}/bbkeys/
-%config %{_datadir}/bbkeys/bbkeysrc
-%config %{_datadir}/bbkeys/defaultStyle
-%{_mandir}/man?/*
+%{_mandir}/man1/bbkeys.1*
+%{_mandir}/man5/bbkeysrc.5*
%changelog
+* Thu Mar 29 2007 Matthias Saou 0.9.0-6
+- Override _datadir as _sysconfdir to get config files in /etc.
+- Mark config files as noreplace.
+- Rebuild against new shared libbt from blackbox.
+- Switch to use downloads.sf.net source URL.
+- Tweak defattr, silence %%setup.
+- Escape macros in %%changelog.
+
* Mon Aug 28 2006 Matthias Saou 0.9.0-5
- FC6 rebuild.
@@ -101,10 +111,10 @@ as well. bbkeys is easily configurable via directly hand-editing the user's
* Sun Aug 5 2001 Jason Kasper
- added to file list for newly included files (docs and man pages)
-- install to %{prefix} instead of /usr
+- install to %%{prefix} instead of /usr
* Sun May 6 2001 Hollis Blanchard
-- removed file list in favor of explicit %files section
+- removed file list in favor of explicit %%files section
- install to /usr instead of /usr/local
- buildroot = /var/tmp/bbkeys-buildroot instead of /tmp/buildroot