File jd.spec of Package jd-api

#  
# spec file for package jd  
#  
# # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.  
# #  
# # 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/  
# #  
#   
# # norootforbuild 

##########################################
# For using svn: do
# export SVNROOT="http://svn.sourceforge.jp/svnroot/jd4linux/jd"
# svn checkout $SVNROOT/trunk
# mv trunk jd-%%{main_ver}-%%{strtag}
# tar czf jd-%%{main_ver}-%%{strtag}.tgz jd-%%{main_ver}-%%{strtag}
##########################################

##########################################
# Defined by upsteam
#
%define         main_ver      2.8.9
%define         strtag        150226
%define         repoid        0
# Define this if this is pre-version
%define         pre_release   0
##########################################

##########################################
# Defined by vendor
#
%define         vendor_rel    1
# Tag name changed from vendor to vendorname so as not to
# overwrite Vendor entry in Summary
%define         vendorname    opensuse
%define         gtkmmdevel    gtkmm2-devel
%define         fontpackage   monapo-fonts
%define         icondir       %{_datadir}/icons/hicolor/96x96/apps/
##########################################

##########################################
%if %{pre_release}
%define         rel           0.%{vendor_rel}.%{strtag}%{?dist}
%else
%define         rel           %{vendor_rel}%{?dist}
%endif

# By default, Migemo support is disabled.
%if             0%{?fedora} >= 5
%define         _with_migemo  1
%endif
%define         migemo_dict   %{_datadir}/cmigemo/utf-8/migemo-dict
##########################################

Name:           jd
Version:        %{main_ver}.a171004
Release:        %{rel}
Summary:        A 2ch browser
Group:          Productivity/Networking/Web/Browsers
License:        GPLv2
URL:            http://jd4linux.sourceforge.jp/
Source0:        http://downloads.sourceforge.jp/jd4linux/%{repoid}/%{name}-%{main_ver}-%{strtag}.tgz
#Source0:	%{name}-%{main_ver}-%{strtag}.tgz
Patch0:         jd-desktop-file.patch
#Patch1:        2ch-hostname.patch
Patch1:         jd-2.8.9-150226-a171004.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  %{gtkmmdevel}
BuildRequires:  libtool automake
BuildRequires:  gnutls-devel
BuildRequires:  desktop-file-utils
BuildRequires:  xorg-x11-libSM-devel
BuildRequires:  gcc-c++
BuildRequires:  alsa-devel
BuildRequires:  libgcrypt-devel
%if 0%{?_with_migemo} >= 1
BuildRequires:  cmigemo-devel
%endif
#Requires:       %{fontpackage}


%description
JD is a 2ch/5ch browser based on gtkmm2. with 2ch-api support patch.

%prep
%setup -q -n %{name}-%{main_ver}-%{strtag}
%patch0
%patch1 -p1
#find . -name .svn | sort -r | xargs %{__rm} -rf

%build
sh autogen.sh

# set TZ for __TIME__
export TZ='Asia/Tokyo'

%configure \
   --with-alsa \
   --with-gthread \
%if 0%{?_with_migemo} >= 1
   --with-migemo \
   --with-migemodict=%{migemo_dict}
%endif

%{__make} %{?_smp_mflags}

%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT

%{__mkdir_p} $RPM_BUILD_ROOT%{icondir}
%{__install} -p -m 644 %{name}.png $RPM_BUILD_ROOT%{icondir}

desktop-file-install \
   --vendor %{vendorname} \
   --dir $RPM_BUILD_ROOT%{_datadir}/applications \
   --delete-original \
   $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

%clean
%{__rm} -rf $RPM_BUILD_ROOT

#%post
#touch --no-create #%{_datadir}/icons/hicolor || :
#%{_bindir}/gtk-update-icon-cache --#quiet %{_datadir}/icons/hicolor || :

#%postun
#touch --no-create #%{_datadir}/icons/hicolor || :
#%{_bindir}/gtk-update-icon-cache --#quiet %{_datadir}/icons/hicolor || :

%files
%defattr(-,root,root,-)
%doc COPYING ChangeLog README
%{_bindir}/%{name}
%{_datadir}/applications/%{vendorname}-%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{icondir}/%{name}.png

%changelog
* Sat May 14 2016 y.kobayashi
- Updated to version 2.8.9a

* Tue Sep 10 2015 y.kobayashi
- Updated to version 2.8.9

* Mon Jun 01 2014 y.kobayashi
- Updated to version 2.8.8

* Sat Apr 07 2012 ykoba <ykoba@opensuse.org>
- Updated to version 2.8.5-beta

* Mon Aug 08 2011 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.8.2

* Thu Apr 03 2011 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.8.1

* Thu Feb 03 2011 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.8.0

* Wed Dec 30 2010 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.7.5

* Wed Aug 25 2010 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.7.0

* Tue Apr 27 2010 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.6.5

* Tue Feb 09 2010 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.6.0

* Tue Dec 29 2009 HeliosReds <HeliosReds@opensuse.org>
- Updated to version 2.5.5

* Fri Jul 24 2009 HeliosReds <HeliosReds@opensuse.org>
- Include alsa support.

* Thu Jul 23 2009 HeliosReds <HeliosReds@opensuse.org>
- First release in OBS.

* Sun Mar  9 2006 Houritsuchu <houritsuchu@hotmail.com>
- Version up.
- add icon

* Sat Feb 25 2006 Houritsuchu <houritsuchu@hotmail.com>
- first