Skip to content

Instantly share code, notes, and snippets.

@armando-basile
Created October 19, 2015 15:22
Show Gist options
  • Save armando-basile/9e026b7988061690dd3f to your computer and use it in GitHub Desktop.
Save armando-basile/9e026b7988061690dd3f to your computer and use it in GitHub Desktop.
spec file for comex-qt
%define archivename comex-project
%define comexbase comex-base
%define comexfolder comex
Summary: Qt user interface for comex project
Name: comex-qt
Version: 0.1.9
Release: %mkrel 1
License: GPLv2
#ExcludeArch: ppc64
Group: Office/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 comex-project to comex-qt
URL: https://github.com/armando-basile/%archivename/
BuildArch: noarch
BuildRequires: mono-devel
BuildRequires: log4net-devel
BuildRequires: %{comexbase} >= 0.1.9
BuildRequires: qyoto-devel
BuildRequires: qyoto
#BuildRequires: pinentry-qt4
BuildRequires: pkgconfig
Requires: mono
Requires: log4net
Requires: %{comexbase} >= 0.1.9
Requires: qyoto
Requires: qyoto-devel
%description
Is QT user interface of a simple application that can be used to exchange
data with smartcards using PC/SC standard readers or smartmouse
phoenix serial reader.
%prep
%setup -q
%build
# build commands
cd %{_builddir}/%{name}-%{version}/build-linux
bash ./build-lnx-comex-qt.sh
%install
# create folders if not exists
mkdir -p %{buildroot}%{_prefix}/lib/%{comexfolder}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_docdir}/%{name}
# install commands
cp -f %{_builddir}/%{name}-%{version}/%{name}/bin/Debug/%{name}.exe* %{buildroot}%{_prefix}/lib/%{comexfolder}/
cp -f %{_builddir}/%{name}-%{version}/resources/Images/comex_48.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
cp -f %{_builddir}/%{name}-%{version}/%{name}/Resources/%{name} %{buildroot}%{_datadir}/applications/%{name}.desktop
# generate bin script
(
cat <<EOF
#!/bin/sh
exec mono "%{_prefix}/lib/%{comexfolder}/%{name}.exe" "\$@"
EOF
) >> %{buildroot}%{_bindir}/%{name}
chmod 775 %{buildroot}%{_bindir}/%{name}
%files
%doc copying.gpl %{name}/readme
%{_bindir}/%{name}
%_prefix/lib/%{comexfolder}/%{name}.exe*
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment