File popcorn-time.spec of Package popcorn-time
%define popcorn_version 0.4.4
Name: popcorn-time
Version: 0.4.4
Release: 0
Url: https://github.com/popcorn-official/popcorn-desktop
Summary: Watch Free Movies and TV Shows instantly online
Group: Multimedia/Video/Players
BuildRequires: xz
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: -post-build-checks
License: GPL-3.0
Source1: Popcorn-Time-%{popcorn_version}-Linux-64.tar.xz
Source2: popcorn-time.tar.xz
Requires: xz
Requires: unzip
Requires: libmpv1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Popcorn Time streams free movies and TV shows from torrents.
%build
%install
mkdir -p %buildroot/opt/popcorn-time/
cp -f %{SOURCE1} %{buildroot}/opt/popcorn-time/Popcorn-Time-%{popcorn_version}-Linux-64.tar.xz
cp -f %{SOURCE2} %{buildroot}/opt/popcorn-time/popcorn-time.tar.xz
%post
if test -e /opt/popcorn-time/Popcorn-Time-%{popcorn_version}-Linux-64.tar.xz ; then
cd /opt/popcorn-time/
tar xf Popcorn-Time-%{popcorn_version}-Linux-64.tar.xz
tar xf popcorn-time.tar.xz -C /
fi
update-desktop-database
%preun
if [ "$1" = 0 ]; then
rm -f "/usr/share/applications/popcorn-time.desktop"
rm -rf "/opt/popcorn-time/"
update-desktop-database
fi
%clean
%files
%defattr(-,root,root)
/opt/popcorn-time/
/opt/popcorn-time/popcorn-time.tar.xz
/opt/popcorn-time/Popcorn-Time-%{popcorn_version}-Linux-64.tar.xz
%changelog