# Basic Information
%define pkgname ffmpegthumbnailer
%define name    self-build-%{pkgname}
%define version 2.2.0
%define release 3%{?_dist_release}

#%define sourceurl0 http://gdurl.com/z9ne/download/%{pkgname}-%{version}.tar.gz
%define sourceurl0 https://github.com/dirkvdb/ffmpegthumbnailer/releases/download/%{version}/ffmpegthumbnailer-%{version}.tar.bz2

Name:           %{name}
Version:        %{version}
Release:        %{release}
# COPYING  などを参照して License を修正してください。
License:        GPLv2+
# /usr/share/doc/rpm-4.11.1/GROUPS_for_vine.txt を参照して Group を修正してください。
Group:          Restricted Software
Source0:        %{pkgname}-vl.spec
BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildArch:      noarch

Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       Shirow HIGA, iwaim

Summary:        Package to automatically build %{pkgname} rpm package
Summary(ja):    %{pkgname} の rpm パッケージを自動作成するパッケージ

Obsoletes:      ffmpegthumbnailer < %{version}
Obsoletes:	ffmpegthumbnailer-devel < %{version}
Obsoletes:      self-build-ffmpegthumbnailer < %{version}

# Dependency
# 以下に依存関係を記述してください 。
Requires(post):	self-build-setup >= 0.9.9

Requires(post):	libpng-devel
Requires(post):	libjpeg-turbo-devel
Requires(post):	chrpath
Requires(post):	cmake >= 2.8.5
Requires(post):	automake
Requires(post):	autoconf

Requires(post):	self-build-ffmpeg >= 2.3

#追加のソースファイル

#追加のパッチファイル

%description
This video thumbnailer can be used to create thumbnails for your video files.

[Note]
This package requires many other packages to compile
targetsoftware. So it consume more disk space than usual.

Also installation takes logner time because of compilation.
(This will take a few minutes to quarter or half of an hour,
depends on building environment)

[About self-build package]

For some kind of software, distributing of binary package
may viorate the patent or law. Therefore we chose self-build
packge, create binary package on your machine, for such kind
of softwares instead of distributing binary package.

Please obey the national law when you use the created binary
packages. And if you want to use the softwares using patented
thechnology, it may be required to get a permission, make an
agreement or purchas a license. Please consider it with your
purpose or way of use and take appropriate action.

#%description -l ja
#ここに日本語で詳細を記述してください。

%prep
[ "%{version}-%{release}" != $(rpm -q --queryformat "%%{version}-%%{release}\n" --specfile %{SOURCE0} | tail -1) ] && exit 1

%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__install} -d ${RPM_BUILD_ROOT}/%{_datadir}/%{name}
%{__install} -m 644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{_datadir}/%{name}

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%posttrans
/usr/lib/rpm/self-build-rpm.sh %{name} %{pkgname}-vl.spec %{sourceurl0} 9500

/usr/lib/rpm/pre-allocate-rpm.sh %{pkgname}-%{version}-%{release} \
                                 %{pkgname}-devel-%{version}-%{release}

%files
%defattr(-,root,root)
%{_datadir}/%{name}

%changelog
* Sun Jun 17 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 2.2.0-3
- add Packager
- update Requires(post)

* Tue Apr 24 2018 Shirow HIGA <shirowxxx@gmail.com> - 2.2.0-2
- Rebuild with ffmpeg 4.0

* Fri Mar 31 2017 Shirow HIGA <shirowxxx@gmail.com> - 2.2.0-1
- new upstream release

* Fri Aug 19 2016 Shirow HIGA <shirowxxx@gmail.com> - 2.1.2-1
- new upstream release

* Mon Feb 29 2016 Shirow HIGA <shirowxxx@gmail.com> - 2.1.1-1
- new upstream release

* Sat Nov  7 2015 Shirow HIGA <shirowxxx@gmail.com> - 2.1.0-1
- new upstream release

* Tue Jun 16 2015 Shirow HIGA <shirowxxx@gmail.com> - 2.0.10-1
- new upstream release
- update Source0
- change for URL (https://github.com/dirkvdb/ffmpegthumbnailer)

* Thu Jan 15 2015 Shirow HIGA <shirowxxx@gmail.com> 2.0.9-1
- initial build for Vine Linux