Skip to content

Instantly share code, notes, and snippets.

@armando-basile
Last active October 22, 2015 10:17
Show Gist options
  • Save armando-basile/423710bb667e09407954 to your computer and use it in GitHub Desktop.
Save armando-basile/423710bb667e09407954 to your computer and use it in GitHub Desktop.
%define archivename themonospot
%define basefolder themonospot
Summary: Console application to use themonospot (multimedia files parser/editor)
Name: themonospot-console
Version: 0.9.0
Release: %mkrel 1
License: GPLv2
#ExcludeArch: ppc64
Group: Video/Utilities
Source: https://github.com/armando-basile/%archivename/archive/%{name}-%{version}.tar.gz
# get sources from https://github.com/armando-basile/%archivename/archive/%{version}.tar.gz
# and rename folder from themonospot to themonospot-console
URL: https://github.com/armando-basile/%archivename/
BuildArch: noarch
BuildRequires: mono-devel
BuildRequires: log4net-devel
BuildRequires: pkgconfig
Requires: mono
Requires: log4net
Obsoletes: themonospot-base
Obsoletes: themonospot-base-devel
Obsoletes: themonospot-plugin-avi
Obsoletes: themonospot-plugin-mkv
%description
themonospot-console is a mono console application to scan multimedia files
using themonospot base component and his plugins.
%prep
%setup -q
%build
# build commands
cd %{_builddir}/%{name}-%{version}/build-linux
bash ./build-lnx-%archivename.sh
%install
# create folders if not exists
mkdir -p %{buildroot}%{_prefix}/lib/%{basefolder}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/%{basefolder}
mkdir -p %{buildroot}%{_docdir}/%{name}
# install commands
cp -f %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/%{archivename}-base.* %{buildroot}%{_prefix}/lib/%{basefolder}/
cp -f %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/%{archivename}-components.* %{buildroot}%{_prefix}/lib/%{basefolder}/
cp -f %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/%{archivename}-plugin-manager.* %{buildroot}%{_prefix}/lib/%{basefolder}/
cp -f %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/%{name}.* %{buildroot}%{_prefix}/lib/%{basefolder}/
cp -rf %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/languages %{buildroot}%{_datadir}/%{basefolder}/
cp -rf %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/plugins %{buildroot}%{_datadir}/%{basefolder}/
# generate bin script
(
cat <<EOF
#!/bin/sh
exec mono "%{_prefix}/lib/%{basefolder}/%{name}.exe" "\$@"
EOF
) >> %{buildroot}%{_bindir}/%{name}
chmod 775 %{buildroot}%{_bindir}/%{name}
%files
%doc %{name}/copying.gpl
%{_bindir}/%{name}
%_prefix/lib/%{basefolder}/%{archivename}-base.*
%_prefix/lib/%{basefolder}/%{archivename}-components.*
%_prefix/lib/%{basefolder}/%{archivename}-plugin-manager.*
%_prefix/lib/%{basefolder}/%{name}.*
%_datadir/%{basefolder}/languages/*
%_datadir/%{basefolder}/plugins/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment