2aeaebb
Name:           bibus
2aeaebb
Version:        1.4.1
2aeaebb
Release:        4%{?dist}
2aeaebb
Summary:        Bibliographic and reference management software
2aeaebb
2aeaebb
Group:          Applications/Publishing
2aeaebb
License:        GPLv2+
2aeaebb
URL:            http://bibus-biblio.sourceforge.net/
2aeaebb
Source0:        http://downloads.sourceforge.net/bibus-biblio/%{name}_%{version}-1.tar.gz
2aeaebb
2aeaebb
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2aeaebb
BuildArch:      noarch
2aeaebb
2aeaebb
BuildRequires:  python-devel
2aeaebb
BuildRequires:  desktop-file-utils
2aeaebb
BuildRequires:  gettext
2aeaebb
Requires:       wxPython > 2.6
2aeaebb
Requires:       MySQL-python
2aeaebb
Requires:       python-sqlite2
2aeaebb
Requires:       openoffice.org-writer
2aeaebb
Requires:       openoffice.org-pyuno
2aeaebb
2aeaebb
2aeaebb
%description
2aeaebb
Bibus is a bibliographic database. It uses a MySQL or SQLite database
2aeaebb
to store references. It can directly insert references in
2aeaebb
OpenOffice.org and MS Word and generate the bibliographic index.
2aeaebb
2aeaebb
2aeaebb
%prep
2aeaebb
%setup -q -n %{name}-%{version}
2aeaebb
2aeaebb
## make files UTF-8 
2aeaebb
for i in bibMSW.htm eTBlast\ Interface\ to\ Bibus.htm
2aeaebb
do
2aeaebb
  /usr/bin/iconv -f iso8859-1 -t utf-8 "Docs/html/en/${i}" > "Docs/html/en/${i}.conv" && /bin/mv -f "Docs/html/en/${i}.conv" "Docs/html/en/${i}"
2aeaebb
done
2aeaebb
2aeaebb
##  fix line endings
2aeaebb
find Docs -type f -exec sed -i 's/\r//' {} 2>/dev/null ';'
2aeaebb
2aeaebb
## remove she-bang lines in .py files to keep rpmlint happy
2aeaebb
find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'
2aeaebb
2aeaebb
## restore she-bang line for bibusStart.py
2aeaebb
sed -i '1i #!/usr/bin/env python' bibusStart.py
2aeaebb
2aeaebb
## remove non-standard zh_cn locale directory
2aeaebb
rm -r locale/zh_cn
2aeaebb
2aeaebb
%build
2aeaebb
2aeaebb
%install
2aeaebb
rm -rf $RPM_BUILD_ROOT
2aeaebb
make DESTDIR=$RPM_BUILD_ROOT/%{_prefix} sysconfdir=$RPM_BUILD_ROOT/etc oopath=%{_libdir}/openoffice.org/program/ install
2aeaebb
2aeaebb
## fix symlink
2aeaebb
rm $RPM_BUILD_ROOT%{_bindir}/bibus
2aeaebb
ln -s %{_datadir}/%{name}/bibusStart.py $RPM_BUILD_ROOT%{_bindir}/bibus
2aeaebb
2aeaebb
## fix location of doc directory to include version
2aeaebb
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}
2aeaebb
2aeaebb
## fix bibus.cfg to remove $RPM_BUILD_ROOT
2aeaebb
sed -i "s:$RPM_BUILD_ROOT::" $RPM_BUILD_ROOT%{_datadir}/%{name}/bibus.cfg
2aeaebb
2aeaebb
## fix bibus.cfg to fix documentation location
2aeaebb
sed -i "s:doc/bibus:doc/bibus-%{version}:" $RPM_BUILD_ROOT%{_datadir}/%{name}/bibus.cfg
2aeaebb
2aeaebb
## remove uninstall program, not necessary for RPM package
2aeaebb
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/Setup/uninstall.sh
2aeaebb
2aeaebb
## fix bibus.desktop to fix binary and icon locations
2aeaebb
sed -i "s:$RPM_BUILD_ROOT::" $RPM_BUILD_ROOT%{_datadir}/applications/bibus.desktop
2aeaebb
2aeaebb
## remove localization from generic name
2aeaebb
sed -i 's/GenericName\[fr_FR\]/GenericName/' $RPM_BUILD_ROOT%{_datadir}/applications/bibus.desktop
2aeaebb
2aeaebb
desktop-file-install --vendor="fedora"               \
2aeaebb
     --delete-original                               \
2aeaebb
     --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
2aeaebb
     --remove-category="Application"                 \
2aeaebb
     ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
2aeaebb
2aeaebb
%{find_lang} %{name}
2aeaebb
2aeaebb
%clean
2aeaebb
rm -rf $RPM_BUILD_ROOT
2aeaebb
2aeaebb
%files -f %{name}.lang
2aeaebb
%defattr(-,root,root,-)
2aeaebb
%doc %{_datadir}/doc/%{name}-%{version}
2aeaebb
%{_bindir}/bibus
2aeaebb
%{_datadir}/%{name}
2aeaebb
%{_datadir}/applications/*
2aeaebb
%{_datadir}/icons/hicolor/48x48/apps/*
2aeaebb
%{_mandir}/man1/*
2aeaebb
%config(noreplace) %{_sysconfdir}/*
2aeaebb
2aeaebb
2aeaebb
%changelog
2aeaebb
* Thu Mar 13 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-4
2aeaebb
- Require python-sqlite2, not sqlite
2aeaebb
2aeaebb
* Thu Mar 13 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-3
2aeaebb
- Fix desktop-file-install as per review (#436619)
2aeaebb
2aeaebb
* Wed Mar 11 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-2
2aeaebb
- Require sqlite for sqlite backend
2aeaebb
2aeaebb
* Sat Mar  8 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-1
2aeaebb
- Initial Fedora package
2aeaebb