cf54202
Name:           bibus
4b176a0
Version:        1.4.3
4b176a0
Release:        1%{?dist}
cf54202
Summary:        Bibliographic and reference management software
cf54202
cf54202
Group:          Applications/Publishing
cf54202
License:        GPLv2+
cf54202
URL:            http://bibus-biblio.sourceforge.net/
4b176a0
Source0:        http://downloads.sourceforge.net/bibus-biblio/%{name}_%{version}-2.tar.gz
cf54202
cf54202
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
4b176a0
## temporarily removing noarch to workaround this bug:
4b176a0
##  https://bugzilla.redhat.com/show_bug.cgi?id=438527
4b176a0
## also filed with bibus upstream: 
4b176a0
##  http://sourceforge.net/tracker/index.php?func=detail&aid=1989580&group_id=110943&atid=657832
4b176a0
##BuildArch:      noarch
cf54202
cf54202
BuildRequires:  python-devel
cf54202
BuildRequires:  desktop-file-utils
cf54202
BuildRequires:  gettext
cf54202
Requires:       wxPython > 2.6
cf54202
Requires:       MySQL-python
cf54202
Requires:       python-sqlite2
cf54202
Requires:       openoffice.org-writer
cf54202
Requires:       openoffice.org-pyuno
cf54202
cf54202
cf54202
%description
cf54202
Bibus is a bibliographic database. It uses a MySQL or SQLite database
cf54202
to store references. It can directly insert references in
cf54202
OpenOffice.org and MS Word and generate the bibliographic index.
cf54202
cf54202
cf54202
%prep
4b176a0
%setup -q -n %{name}1.4
cf54202
cf54202
## make files UTF-8 
cf54202
for i in bibMSW.htm eTBlast\ Interface\ to\ Bibus.htm
cf54202
do
cf54202
  /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}"
cf54202
done
cf54202
4b176a0
## remove all CVS version control files
4b176a0
find . -type d -name CVS -print0 | xargs --null rm -rf
4b176a0
cf54202
##  fix line endings
4b176a0
##find Docs -type f -exec sed -i 's/\r//' {} 2>/dev/null ';'
4b176a0
find Docs -type f -name '*ml' -exec sed -i 's/\r//' {} 2>/dev/null ';'
cf54202
cf54202
## remove she-bang lines in .py files to keep rpmlint happy
cf54202
find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'
cf54202
cf54202
## restore she-bang line for bibusStart.py
cf54202
sed -i '1i #!/usr/bin/env python' bibusStart.py
cf54202
cf54202
## remove non-standard zh_cn locale directory
cf54202
rm -r locale/zh_cn
cf54202
cf54202
%build
cf54202
cf54202
%install
cf54202
rm -rf $RPM_BUILD_ROOT
cf54202
make DESTDIR=$RPM_BUILD_ROOT/%{_prefix} sysconfdir=$RPM_BUILD_ROOT/etc oopath=%{_libdir}/openoffice.org/program/ install
cf54202
cf54202
## fix symlink
cf54202
rm $RPM_BUILD_ROOT%{_bindir}/bibus
cf54202
ln -s %{_datadir}/%{name}/bibusStart.py $RPM_BUILD_ROOT%{_bindir}/bibus
cf54202
cf54202
## fix location of doc directory to include version
cf54202
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}
cf54202
4b176a0
## also install ScreenShots subdirectory, missed by Makefile
4b176a0
install -d $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}/html/ScreenShots/
4b176a0
install -m644 Docs/html/ScreenShots/*.png $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}/html/ScreenShots/
4b176a0
cf54202
## fix bibus.cfg to remove $RPM_BUILD_ROOT
cf54202
sed -i "s:$RPM_BUILD_ROOT::" $RPM_BUILD_ROOT%{_datadir}/%{name}/bibus.cfg
cf54202
cf54202
## fix bibus.cfg to fix documentation location
cf54202
sed -i "s:doc/bibus:doc/bibus-%{version}:" $RPM_BUILD_ROOT%{_datadir}/%{name}/bibus.cfg
cf54202
cf54202
## remove uninstall program, not necessary for RPM package
cf54202
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/Setup/uninstall.sh
cf54202
cf54202
## fix bibus.desktop to fix binary and icon locations
cf54202
sed -i "s:$RPM_BUILD_ROOT::" $RPM_BUILD_ROOT%{_datadir}/applications/bibus.desktop
cf54202
cf54202
## remove localization from generic name
cf54202
sed -i 's/GenericName\[fr_FR\]/GenericName/' $RPM_BUILD_ROOT%{_datadir}/applications/bibus.desktop
cf54202
cf54202
desktop-file-install --vendor="fedora"               \
cf54202
     --delete-original                               \
cf54202
     --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
cf54202
     --remove-category="Application"                 \
cf54202
     ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
cf54202
cf54202
%{find_lang} %{name}
cf54202
cf54202
%clean
cf54202
rm -rf $RPM_BUILD_ROOT
cf54202
cf54202
%files -f %{name}.lang
cf54202
%defattr(-,root,root,-)
cf54202
%doc %{_datadir}/doc/%{name}-%{version}
cf54202
%{_bindir}/bibus
cf54202
%{_datadir}/%{name}
cf54202
%{_datadir}/applications/*
cf54202
%{_datadir}/icons/hicolor/48x48/apps/*
cf54202
%{_mandir}/man1/*
cf54202
%config(noreplace) %{_sysconfdir}/*
cf54202
cf54202
cf54202
%changelog
4b176a0
* Tue Jun 10 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.3-1
4b176a0
- Update to latest upstream (1.4.3)
4b176a0
- Make package arch-specific to allow package to find appropriate location
4b176a0
  for x86_64 (#438527)
4b176a0
- Fix PNG corruption introduced by fixing line-feeds, patch thanks to 
4b176a0
  Nicolas Thierry-Mieg (#448483)
4b176a0
- Add missing images to doc
4b176a0
cf54202
* Thu Mar 13 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-4
cf54202
- Require python-sqlite2, not sqlite
cf54202
cf54202
* Thu Mar 13 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-3
cf54202
- Fix desktop-file-install as per review (#436619)
cf54202
cf54202
* Wed Mar 11 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-2
cf54202
- Require sqlite for sqlite backend
cf54202
cf54202
* Sat Mar  8 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.1-1
cf54202
- Initial Fedora package
cf54202