dd21fd7
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
7927b0f
%global debug_package %{nil}
7927b0f
2aeaebb
Name:           bibus
3e2f89d
Version:        1.5.1
dd21fd7
Release:        11%{?dist}
2aeaebb
Summary:        Bibliographic and reference management software
2aeaebb
2aeaebb
Group:          Applications/Publishing
2aeaebb
License:        GPLv2+
2aeaebb
URL:            http://bibus-biblio.sourceforge.net/
e08f2cc
Source0:        http://downloads.sourceforge.net/bibus-biblio/%{name}-%{version}.tar.gz
e08f2cc
7043865
Patch0:         %{name}-build-1.5.1.patch
2aeaebb
6de5d05
## temporarily removing noarch to workaround this bug:
6de5d05
##  https://bugzilla.redhat.com/show_bug.cgi?id=438527
6de5d05
## also filed with bibus upstream: 
6de5d05
##  http://sourceforge.net/tracker/index.php?func=detail&aid=1989580&group_id=110943&atid=657832
6de5d05
##BuildArch:      noarch
2aeaebb
2aeaebb
BuildRequires:  python-devel
2aeaebb
BuildRequires:  desktop-file-utils
2aeaebb
BuildRequires:  gettext
2aeaebb
Requires:       wxPython > 2.6
2aeaebb
Requires:       MySQL-python
eded2f9
Requires:       libreoffice-writer
eded2f9
Requires:       libreoffice-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
eded2f9
LibreOffice and MS Word and generate the bibliographic index.
2aeaebb
2aeaebb
2aeaebb
%prep
e08f2cc
%setup -q -n %{name}-%{version}
e08f2cc
%patch0 -p0
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
6de5d05
## remove all CVS version control files
6de5d05
find . -type d -name CVS -print0 | xargs --null rm -rf
6de5d05
2aeaebb
##  fix line endings
6de5d05
##find Docs -type f -exec sed -i 's/\r//' {} 2>/dev/null ';'
6de5d05
find Docs -type f -name '*ml' -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
0f638ba
make DESTDIR=$RPM_BUILD_ROOT/%{_prefix} sysconfdir=$RPM_BUILD_ROOT/etc \
eded2f9
 oopath=%{_libdir}/libreoffice/program/ ooure=%{_libdir}/libreoffice/ure/lib \
eded2f9
 oobasis=%{_libdir}/libreoffice/basis-link/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
6de5d05
## also install ScreenShots subdirectory, missed by Makefile
dd21fd7
install -d $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/html/ScreenShots/
dd21fd7
install -m644 Docs/html/ScreenShots/*.png $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/html/ScreenShots/
dd21fd7
dd21fd7
if [ "%{_datadir}/doc/%{name}" != "%{_pkgdocdir}" ]; then
dd21fd7
    ## fix location of doc directory to include version
dd21fd7
    mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}
dd21fd7
dd21fd7
    ## fix bibus.cfg to fix documentation location
dd21fd7
    sed -i "s:doc/bibus:doc/bibus-%{version}:" $RPM_BUILD_ROOT%{_datadir}/%{name}/bibus.cfg
dd21fd7
fi
6de5d05
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
## remove uninstall program, not necessary for RPM package
2aeaebb
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/Setup/uninstall.sh
2aeaebb
7043865
desktop-file-install \
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
%files -f %{name}.lang
dd21fd7
%doc %{_pkgdocdir}
2aeaebb
%{_bindir}/bibus
2aeaebb
%{_datadir}/%{name}
2aeaebb
%{_datadir}/applications/*
2aeaebb
%{_datadir}/icons/hicolor/48x48/apps/*
2aeaebb
%{_mandir}/man1/*
2aeaebb
%config(noreplace) %{_sysconfdir}/*
2aeaebb
2aeaebb
%changelog
dd21fd7
* Sat Jan 18 2014 Ville Skyttä <ville.skytta@iki.fi> - 1.5.1-11
dd21fd7
- Adapt to unversioned docdirs where applicable (#993684).
dd21fd7
- Fix bogus date in %%changelog.
dd21fd7
e06a64a
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-10
e06a64a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e06a64a
7043865
* Mon Feb 11 2013 Rahul Sundaram <sundaram@fedoraproject.org> - 1.5.1-9
7043865
- remove vendor tag from desktop file. https://fedorahosted.org/fpc/ticket/247
7043865
- clean up spec to follow current guidelines
7043865
901ae75
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-8
901ae75
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
901ae75
9a79301
* Wed Feb  8 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.5.1-7
9a79301
- Remove python-sqlite2 dep as bibus can use the sqlite3 module from the stdlib
9a79301
adfd1a2
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-6
adfd1a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
adfd1a2
e8eb316
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-5
e8eb316
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e8eb316
eded2f9
* Sat Oct 30 2010 Caolán McNamara <caolanm@redhat.com> - 1.5.1-4
eded2f9
- rebuild against LibreOffice
eded2f9
a745741
* Wed Aug 11 2010 David Malcolm <dmalcolm@redhat.com> - 1.5.1-3
a745741
- recompiling .py files against Python 2.7 (rhbz#623278)
a745741
7927b0f
* Mon Mar  8 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.5.1-2
7927b0f
- Disable debuginfo package (#547493)
7927b0f
3e2f89d
* Wed Dec  9 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.5.1-1
3e2f89d
- Update to latest upstream (1.5.1)
3e2f89d
- Should fix connection problem with newer OpenOffice.org (#545809)
3e2f89d
15909e7
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3.1-4
15909e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
15909e7
e6e5b56
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3.1-3
e6e5b56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
e6e5b56
0f638ba
* Mon Jan 12 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.3.1-2
0f638ba
- Fix paths to openoffice (#479099)
0f638ba
e08f2cc
* Mon Dec  1 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.3.1-1
e08f2cc
- Updating to new upstream (1.4.3.1)
e08f2cc
- Adds support for OpenOffice 3.x
e08f2cc
- Add patch to fix broken Makefile and desktop file
e08f2cc
- Cleanup .spec
e08f2cc
3e86d10
* Mon Dec 01 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.4.3-2
3e86d10
- Rebuild for Python 2.6
3e86d10
6de5d05
* Tue Jun 10 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 1.4.3-1
6de5d05
- Update to latest upstream (1.4.3)
6de5d05
- Make package arch-specific to allow package to find appropriate location
6de5d05
  for x86_64 (#438527)
6de5d05
- Fix PNG corruption introduced by fixing line-feeds, patch thanks to 
6de5d05
  Nicolas Thierry-Mieg (#448483)
6de5d05
- Add missing images to doc
6de5d05
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
dd21fd7
* Tue 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