-Summary: Jpilot - Palm Pilot desktop software
-Summary(pl): Program do zarz±dzania Palm Pilotem
-Summary(pt_BR): Software para interação com o Pilot
+#
+# Conditional build:
+%bcond_with gtk1 # use GTK+ 1.2 instead of GTK+2
+#
+Summary: Desktop organizer application for PalmOS devices
+Summary(pl.UTF-8): Organizer dla urządzeń PalmOS
+Summary(pt_BR.UTF-8): Software para interação com o Pilot
Name: jpilot
-Version: 0.99.3
-Release: 1
+Version: 0.99.9
+Release: 3
License: GPL
Group: X11/Applications
-Source0: http://jpilot.org/%{name}-%{version}.tar.gz
+# wget is banned, so use our df.
+# Source0Download: http://jpilot.org/%{name}-%{version}.tar.gz
+Source0: %{name}-%{version}.tar.gz
+# Source0-md5: c39df29aeed57b84a674524856ebc290
Source1: %{name}.desktop
Source2: %{name}.png
-Patch0: %{name}-configure.patch
-Patch1: %{name}-makefile.patch
+Patch0: %{name}-locale-names.patch
+#PatchX: %{name}_other.v0_99_7.diff
URL: http://jpilot.org/
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: gettext-devel
-BuildRequires: gtk+-devel >= 1.2.0
+BuildRequires: gettext-tools >= 0.16.1
+%{?with_gtk1:BuildRequires: gtk+-devel >= 1.2.0}
+%{!?with_gtk1:BuildRequires: gtk+2-devel >= 1:2.0.3}
+BuildRequires: intltool
BuildRequires: libtool
-BuildRequires: pilot-link-devel >= 0.11.5
+BuildRequires: openssl-devel >= 0.9.7d
+BuildRequires: pilot-link-devel >= 0.11.2
+BuildRequires: pkgconfig
+BuildRequires: readline-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _prefix /usr/X11R6
-%define _mandir %{_prefix}/man
-
%description
-J-Pilot is a desktop organizer application for the palm pilot that
-runs under Linux. t is similar in functionality to the one that 3com
-distributes for a well known rampant legacy operating system.
+J-Pilot is a desktop organizer application for the PalmOS devices that
+runs under Linux with plugins support. It is similar in functionality
+to the original Palm Desktop software.
-%description -l pl
-J-Pilot jest programem do zarz±dzania organizerami typu Palm Pilot dla
-Linuksa z mo¿liwo¶ci± dodawania wtyczek. Posiada zbli¿on±
-funkcjonalno¶æ do oryginalnego oprogramowania 3coma dla Palm Pilota.
+%description -l pl.UTF-8
+J-Pilot jest programem do zarządzania urządzeniami PalmOS dla Linuksa
+z możliwością dodawania wtyczek. Posiada zbliżoną funkcjonalność do
+oryginalnego oprogramowania Palm Desktop.
-%description -l pt_BR
-Um software para interação com o Pilot.
+%description -l pt_BR.UTF-8
+Um software para interação com o Pilot.
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
+#%patchX -p1 # UPDATE or DROP
+
+mv -f po/{no,nb}.po
+rm -f po/stamp-po
+
+%{__perl} -pi -e 's@pilot_prefix/lib /usr/lib@pilot_prefix/%{_lib} /usr/%{_lib}@' configure.in
+%{__perl} -pi -e 's@/lib/jpilot/plugins@/%{_lib}/jpilot/plugins@' */Makefile.am
%build
-rm -f missinf
%{__gettextize}
%{__libtoolize}
%{__aclocal}
%{__autoconf}
+%{__autoheader}
%{__automake}
-%configure
+%configure \
+ ABILIB="%{_lib}" \
+ %{?with_gtk1:--disable-gtk2}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_datadir},%{_mandir}/man1}
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
-install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/X11/applnk/Applications
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/Applications/jpilot.desktop
+install -D %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/jpilot.desktop
-#install man pages
-install docs/jpilot*.1 $RPM_BUILD_ROOT%{_mandir}/man1
+# plugins are dlopened by *.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la
%find_lang %{name}
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS BUGS UPGRADING README TODO icons docs/{*.png,*.jpg,*.html}
+%doc AUTHORS BUGS README TODO icons docs/{*.png,*.jpg,*.html}
%attr(755,root,root) %{_bindir}/*
+%dir %{_libdir}/%{name}
+%dir %{_libdir}/%{name}/plugins
+%attr(755,root,root) %{_libdir}/%{name}/plugins/*.so*
%{_datadir}/jpilot
%{_mandir}/man1/*
-%{_libdir}/%{name}
-%config(noreplace) %{_sysconfdir}/X11/applnk/Applications/jpilot.desktop
+%{_desktopdir}/jpilot.desktop