Skip to content

Commit

Permalink
Merge pull request #444 from Thaodan/only_bundle_forharbour
Browse files Browse the repository at this point in the history
Only bundle libraries for Jolla Harbour and cleanup spec file
  • Loading branch information
rinigus authored Feb 20, 2024
2 parents feeecc3 + 1c75787 commit 1a9f74c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions rpm/harbour-osmscout-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
%if !0%{?fedora}
%define sailfishos 1
%endif
%bcond_with jollaharbour


%if 0%{?sailfishos}
Expand All @@ -10,7 +11,7 @@ Name: harbour-osmscout-server
Name: osmscout-server
%endif

%if 0%{?sailfishos}
%if %{with jollaharbour}
%define __provides_exclude_from ^%{_datadir}/.*$
%define __requires_exclude ^libboost_filesystem|libboost_regex|libboost_system|libboost_iostreams|libboost_chrono|libboost_thread|libboost_date_time|libpostal|libprotobuf|liblz4|libfreetype|libharfbuzz|libjpeg|libmapnik|libproj|libtiff.*$
%endif
Expand Down Expand Up @@ -55,14 +56,14 @@ BuildRequires: boost-system >= 1.51
BuildRequires: lz4-devel
BuildRequires: desktop-file-utils

BuildRequires: pkgconfig(libsystemd)
%if 0%{?sailfishos}
Requires: sailfishsilica-qt5 >= 0.10.9
BuildRequires: pkgconfig(sailfishapp) >= 1.0.2
BuildRequires: mapnik-devel
#BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libsystemd)
%else
BuildRequires: pkgconfig(libsystemd)
BuildRequires: cmake(KF5Kirigami2)
BuildRequires: pkgconfig(Qt5QuickControls2)
BuildRequires: pkgconfig(mapnik)
Expand Down Expand Up @@ -101,27 +102,28 @@ Url:

%build

%qmake5 VERSION='%{version}-%{release}' \
CONFIG+=use_dbusactivation \
%if 0%{?sailfishos}
%qmake5 VERSION='%{version}-%{release}' SCOUT_FLAVOR='silica' CONFIG+=use_dbusactivation
SCOUT_FLAVOR='silica' \
%else
%qmake5 VERSION='%{version}-%{release}' SCOUT_FLAVOR='kirigami' CONFIG+=use_dbusactivation
SCOUT_FLAVOR='kirigami' \
%endif

make %{?_smp_mflags}
%{nil}
%make_build

%install
rm -rf %{buildroot}
make install INSTALL_ROOT=%{buildroot}
%qmake5_install

desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop

%if 0%{?sailfishos}

%if %{with jollaharbour}
# ship all shared libraries not allowed in Harbour with the app
mkdir -p %{buildroot}%{_datadir}/%{name}/lib

cp %{_libdir}/libmapnik.so.* %{buildroot}%{_datadir}/%{name}/lib
cp %{_libdir}/libproj.so.12 %{buildroot}%{_datadir}/%{name}/lib
cp %{_libdir}/libtiff.so.5 %{buildroot}%{_datadir}/%{name}/lib
Expand Down Expand Up @@ -161,6 +163,7 @@ strip %{buildroot}%{_datadir}/%{name}/lib/libmapnik.so.*
# strip executable bit from all libraries
chmod -x %{buildroot}%{_datadir}/%{name}/lib/*.so*
#chmod -x %{buildroot}%{_datadir}/%{name}/lib/mapnik/*/*
%endif

%endif # sailfishos

Expand Down

0 comments on commit 1a9f74c

Please sign in to comment.