File tilp2.spec of Package tilp2
#
# spec file for package tilp2
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Malcolm Lewis malcolmlewis@opensuse.org
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: tilp2
Version: 1.16
Release: 0
License: GPL-2.0+
Summary: Tilp is a Linking Program
Url: http://lpg.ticalc.org/prj_tilp/
Group: Hardware/Other
Source0: http://voxel.dl.sourceforge.net/project/tilp/tilp2-linux/tilp2-1.16/tilp2-1.16.tar.bz2
# PATCH-FIX-UPSTREAM tilp2-fix-desktop-file.patch sf#3491673 malcolmlewis@opensuse.org -- Fix Categories and mime type errors.
Patch0: tilp2-fix-desktop-file.patch
# PATCH-FIX-UPSTREAM tilp2-add-optflags.patch sf#3491681 malcolmlewis@opensuse.org -- Add optflags to man page build.
Patch1: tilp2-add-optflags.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gtk2-devel
BuildRequires: libglade2-devel
BuildRequires: libticables2-devel
BuildRequires: libticalcs2-devel
BuildRequires: libticonv-devel
BuildRequires: libtifiles2-devel
BuildRequires: libtool
BuildRequires: update-desktop-files
%if 0%{?sles_version}
BuildRequires: glib2-devel
%else
BuildRequires: pkgconfig(glib-2.0)
%endif
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
TiLP is a linking program for Texas Instruments' graphing calculators.
TiLP works on several platforms (UNIX, Windows, Macintosh). It can handle
any TI calculator (from TI73 to V200) with any link cable. TiLP has all
the functions of a linking program and even more.
%lang_package
%prep
%setup -q
%patch0 -p1
%patch1 -p1
# Fix end of line encoding warning
find . -type f -exec sed -i 's/\r//' {} \;
# Fix "Your file uses __DATE and __TIME__ this causes the package to rebuild when not needed warning"
# We use the date from the changes file
set_date_time=`date --date "@\`stat --format %Y %{_sourcedir}/%{name}.changes\`" +"%B %Y %H:%M"`
sed -i 's/\%s \%s\\n\")\, \_\_DATE\_\_\, \_\_TIME\_\_/'"$set_date_time"'\\n\")/g' src/tilp_cmdline.c
%build
# Reconfig required due to patch 1
autoreconf -fi
%configure
make %{?_smp_mflags}
%install
%makeinstall
# Remove files as we will install with rpm doc.
rm %{buildroot}%{_datadir}/%{name}/COPYING
rm %{buildroot}%{_datadir}/%{name}/RELEASE
%suse_update_desktop_file tilp
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}
%if !0%{?sles_version}
%post
%desktop_database_post
%mime_database_post
%postun
%desktop_database_postun
%mime_database_postun
%endif
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS RELEASE TODO
%{_bindir}/tilp
%{_datadir}/applications/tilp.desktop
%{_datadir}/mime/packages/tilp.xml
%{_datadir}/%{name}
%if 0%{?suse_version} < 1230
%{_mandir}/man1/tilp.1%{?ext_man}
%endif
%files lang -f %{name}.lang
%changelog