Last active
November 9, 2015 21:56
-
-
Save armando-basile/c401f60a2cb15253bb08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable build of Gtk gui | |
%define with_gtk 1 | |
# enable build of Qt gui | |
%define with_qt 1 | |
%define g_gtk %{name}-gtk | |
%define g_qt %{name}-qt | |
%define min_ver 2.0.1 | |
%define name_ver %{name}-%{version} | |
%define comexbase comex-base | |
%define comexfolder comex | |
Summary: Application to manage sim card contacts | |
Name: monosim | |
Version: 2.0.1 | |
Release: %mkrel 2 | |
License: GPLv2 | |
#ExcludeArch: ppc64 | |
Group: Communications/Mobile | |
Source: https://github.com/armando-basile/%name/archive/%{name}-%{version}.tar.gz | |
# get sources from https://github.com/armando-basile/monosim/archive/%{version}.tar.gz | |
URL: https://github.com/armando-basile/%name/ | |
BuildArch: noarch | |
BuildRequires: mono-devel | |
BuildRequires: log4net-devel | |
BuildRequires: %{comexbase} >= 0.1.9 | |
BuildRequires: pkgconfig | |
# for Gtk gui | |
%if %{with_gtk} | |
BuildRequires: gtk-sharp2-devel | |
BuildRequires: glade-sharp2 | |
Provides: monosim-gtk | |
%endif | |
# for Qt gui | |
%if %{with_qt} | |
BuildRequires: qyoto-devel | |
BuildRequires: qyoto | |
Provides: monosim-qt | |
%endif | |
Requires: mono | |
Requires: log4net | |
Requires: %{comexbase} >= 0.1.9 | |
Obsoletes: monosim-gtk < %{min_ver} | |
Obsoletes: monosim-qt < %{min_ver} | |
%description | |
Simple application that can be used to manage sim card | |
contacts using PC/SC standard readers or smartmouse | |
phoenix serial reader. | |
# for Gtk gui | |
%if %{with_gtk} | |
%package gtk | |
Summary: Gtk application to use monosim | |
Group: Communications/Mobile | |
Requires: %{name} = %{version} | |
%description gtk | |
Simple application that can be used to manage sim card | |
contacts using PC/SC standard readers or smartmouse | |
phoenix serial reader. | |
%endif | |
# for Qt gui | |
%if %{with_qt} | |
%package qt | |
Summary: Qt application to use monosim | |
Group: Communications/Mobile | |
Requires: %{name} = %{version} | |
Requires: qyoto-devel | |
%description qt | |
Simple application that can be used to manage sim card | |
contacts using PC/SC standard readers or smartmouse | |
phoenix serial reader. | |
%endif | |
%prep | |
%setup -q | |
%build | |
# build commands | |
cd %{_builddir}/%{name}-%{version}/build-linux | |
ln -s %{_prefix}/lib/%{comexfolder}/%comexbase.dll %{_builddir}/%{name}-%{version}/%comexbase.dll | |
%if %{with_gtk} | |
bash ./build-lnx-%{g_gtk}.sh | |
%endif | |
%if %{with_qt} | |
bash ./build-lnx-%{g_qt}.sh | |
%endif | |
%install | |
# create folders if not exists | |
mkdir -p %{buildroot}%{_prefix}/lib/%{name} | |
mkdir -p %{buildroot}%{_bindir} | |
mkdir -p %{buildroot}%{_datadir}/pixmaps | |
mkdir -p %{buildroot}%{_datadir}/applications | |
ln -s %{_prefix}/lib/%{comexfolder}/%comexbase.dll %{buildroot}%{_prefix}/lib/%{name}/%comexbase.dll | |
%if %{with_gtk} | |
mkdir -p %{buildroot}%{_datadir}/%{g_gtk} | |
mkdir -p %{buildroot}%{_docdir}/%{g_gtk} | |
# install commands for gtk | |
cp -rf %{_builddir}/%{name_ver}/Languages %{buildroot}%{_datadir}/%{g_gtk}/ | |
cp -f %{_builddir}/%{name_ver}/%{g_gtk}/bin/Debug/%{g_gtk}.exe* %{buildroot}%{_prefix}/lib/%{name}/ | |
cp -f %{_builddir}/%{name_ver}/resources/monosim_48.png %{buildroot}%{_datadir}/pixmaps/%{g_gtk}.png | |
cp -f %{_builddir}/%{name_ver}/%{g_gtk}/Resources/%{g_gtk} %{buildroot}%{_datadir}/applications/%{g_gtk}.desktop | |
# generate bin script | |
( | |
cat <<EOF | |
#!/bin/sh | |
exec mono "%{_prefix}/lib/%{name}/%{g_gtk}.exe" "\$@" | |
EOF | |
) >> %{buildroot}%{_bindir}/%{g_gtk} | |
chmod 775 %{buildroot}%{_bindir}/%{g_gtk} | |
%endif | |
%if %{with_qt} | |
mkdir -p %{buildroot}%{_datadir}/%{g_qt} | |
mkdir -p %{buildroot}%{_docdir}/%{g_qt} | |
# install commands for qt | |
cp -rf %{_builddir}/%{name_ver}/Languages %{buildroot}%{_datadir}/%{g_qt}/ | |
cp -f %{_builddir}/%{name_ver}/%{g_qt}/bin/Debug/%{g_qt}.exe* %{buildroot}%{_prefix}/lib/%{name}/ | |
cp -f %{_builddir}/%{name_ver}/resources/monosim_48.png %{buildroot}%{_datadir}/pixmaps/%{g_qt}.png | |
cp -f %{_builddir}/%{name_ver}/%{g_qt}/Resources/%{g_qt} %{buildroot}%{_datadir}/applications/%{g_qt}.desktop | |
# generate bin script | |
( | |
cat <<EOF | |
#!/bin/sh | |
exec mono "%{_prefix}/lib/%{name}/%{g_qt}.exe" "\$@" | |
EOF | |
) >> %{buildroot}%{_bindir}/%{g_qt} | |
chmod 775 %{buildroot}%{_bindir}/%{g_qt} | |
%endif | |
%files | |
%_prefix/lib/%{name}/%comexbase.dll | |
%if %{with_gtk} | |
%files gtk | |
%doc copying.gpl %{g_gtk}/readme | |
%{_bindir}/%{g_gtk} | |
%_prefix/lib/%{name}/%{g_gtk}.exe* | |
%{_datadir}/%{g_gtk}/Languages/* | |
%{_datadir}/pixmaps/%{g_gtk}.png | |
%{_datadir}/applications/%{g_gtk}.desktop | |
%endif | |
%if %{with_qt} | |
%files qt | |
%doc copying.gpl %{g_qt}/readme | |
%{_bindir}/%{g_qt} | |
%_prefix/lib/%{name}/%{g_qt}.exe* | |
%{_datadir}/%{g_qt}/Languages/* | |
%{_datadir}/pixmaps/%{g_qt}.png | |
%{_datadir}/applications/%{g_qt}.desktop | |
%endif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment