From f488d82351a94b122262b006bc0440ea45e9d106 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Fri, 30 Dec 2022 16:21:50 +0100 Subject: [PATCH] Fix build on OBS --- .github/workflows/build.yml | 13 +------ .gitignore | 3 +- Tailscale.pro | 1 - rpm/harbour-tailscale.spec | 47 ++++++++++++++++-------- rpm/harbour-tailscale.yaml | 73 ------------------------------------- 5 files changed, 35 insertions(+), 102 deletions(-) delete mode 100644 rpm/harbour-tailscale.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cda27bb..0a21915 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Prepare run: mkdir RPMS @@ -32,9 +32,6 @@ jobs: cp -r /workspace/* . ; cd rpm ; curl -O https://pkgs.tailscale.com/stable/tailscale_${TAILSCALE_VERSION}_arm.tgz ; - tar xfz tailscale_${TAILSCALE_VERSION}_arm.tgz ; - mv tailscale_${TAILSCALE_VERSION}_arm/tailscale . ; - mv tailscale_${TAILSCALE_VERSION}_arm/tailscaled . ; cd .. ; mb2 -t SailfishOS-$RELEASE-armv7hl build ; sudo mkdir -p /workspace/RPMS ; @@ -48,9 +45,6 @@ jobs: cp -r /workspace/* . ; cd rpm ; curl -O https://pkgs.tailscale.com/stable/tailscale_${TAILSCALE_VERSION}_386.tgz ; - tar xfz tailscale_${TAILSCALE_VERSION}_386.tgz ; - mv tailscale_${TAILSCALE_VERSION}_386/tailscale . ; - mv tailscale_${TAILSCALE_VERSION}_386/tailscaled . ; cd .. ; mb2 -t SailfishOS-$RELEASE-i486 build ; sudo mkdir -p /workspace/RPMS ; @@ -64,16 +58,13 @@ jobs: cp -r /workspace/* . ; cd rpm ; curl -O https://pkgs.tailscale.com/stable/tailscale_${TAILSCALE_VERSION}_arm64.tgz ; - tar xfz tailscale_${TAILSCALE_VERSION}_arm64.tgz ; - mv tailscale_${TAILSCALE_VERSION}_arm64/tailscale . ; - mv tailscale_${TAILSCALE_VERSION}_arm64/tailscaled . ; cd .. ; mb2 -t SailfishOS-$RELEASE-aarch64 build ; sudo mkdir -p /workspace/RPMS ; sudo cp -r RPMS/*.rpm /workspace/RPMS" - name: Upload build result - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: rpms path: RPMS diff --git a/.gitignore b/.gitignore index 4feb623..32ebb08 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ *.autosave RPMS -rpm/tailscale -rpm/tailscaled +rpm/*.tgz diff --git a/Tailscale.pro b/Tailscale.pro index f5ecbac..2041f4f 100644 --- a/Tailscale.pro +++ b/Tailscale.pro @@ -14,7 +14,6 @@ OTHER_FILES += \ harbour-tailscale.desktop \ rpm/harbour-tailscale.changes \ rpm/harbour-tailscale.spec \ - rpm/harbour-tailscale.yaml \ rpm/tailscale.service \ translations/*.ts diff --git a/rpm/harbour-tailscale.spec b/rpm/harbour-tailscale.spec index 6433779..fe18ac6 100644 --- a/rpm/harbour-tailscale.spec +++ b/rpm/harbour-tailscale.spec @@ -1,12 +1,8 @@ -# -# Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.32 -# - Name: harbour-tailscale # >> macros %global _missing_build_ids_terminate_build 0 +%define tailscale_version 1.34.1 # << macros %{!?qtc_qmake:%define qtc_qmake %qmake} @@ -20,11 +16,17 @@ Group: Qt/Qt License: GPLv3 URL: https://scarpino.dev Source0: %{name}-%{version}.tar.bz2 -Source1: tailscaled.service -Source2: tailscale -Source3: tailscaled -Source4: tailscaled.defaults -Source100: harbour-tailscale.yaml +%ifarch %arm +Source1: tailscale_%{tailscale_version}_arm.tgz +%endif +%ifarch aarch64 +Source1: tailscale_%{tailscale_version}_arm64.tgz +%endif +%ifarch %ix86 +Source1: tailscale_%{tailscale_version}_386.tgz +%endif +Source2: tailscaled.service +Source3: tailscaled.defaults Requires: sailfishsilica-qt5 >= 0.10.9 BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 BuildRequires: pkgconfig(Qt5Core) @@ -32,6 +34,16 @@ BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Quick) BuildRequires: desktop-file-utils +%ifarch %arm +%define tailscale_dir tailscale_%{tailscale_version}_arm +%endif +%ifarch aarch64 +%define tailscale_dir tailscale_%{tailscale_version}_arm64 +%endif +%ifarch %ix86 +%define tailscale_dir tailscale_%{tailscale_version}_386 +%endif + %description Tailscale makes networking easy @@ -56,6 +68,11 @@ Url: %prep %setup -q -n %{name}-%{version} +#%setup -a 1 doesn't work in mb2 +if [ ! -d %{tailscale_dir} ]; then + tar xf %{SOURCE1} +fi + # >> setup # << setup @@ -63,7 +80,7 @@ Url: # >> build pre # << build pre -%qtc_qmake5 +%qtc_qmake5 %qtc_make %{?_smp_mflags} @@ -78,16 +95,16 @@ rm -rf %{buildroot} # >> install post install -d %{buildroot}%{_unitdir} -install -m644 %{SOURCE1} %{buildroot}%{_unitdir} +install -m644 %{SOURCE2} %{buildroot}%{_unitdir} -install -m755 %{SOURCE2} %{buildroot}%{_bindir} -install -m755 %{SOURCE3} %{buildroot}%{_bindir} +install -m755 %{tailscale_dir}/tailscale %{buildroot}%{_bindir} +install -m755 %{tailscale_dir}/tailscaled %{buildroot}%{_bindir} install -d %{buildroot}%{_sharedstatedir}/tailscale install -d %{buildroot}%{_localstatedir}/cache/tailscale install -d %{buildroot}%{_sysconfdir}/sysconfig -install -Dm644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/tailscaled +install -Dm644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/tailscaled # << install post desktop-file-install --delete-original \ diff --git a/rpm/harbour-tailscale.yaml b/rpm/harbour-tailscale.yaml deleted file mode 100644 index 2e78d56..0000000 --- a/rpm/harbour-tailscale.yaml +++ /dev/null @@ -1,73 +0,0 @@ -Name: harbour-tailscale -Summary: tailscale -Version: 0.0.2 -Release: 1 -# The contents of the Group field should be one of the groups listed here: -# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS -Group: Qt/Qt -URL: https://scarpino.dev -License: GPLv3 -# This must be generated before uploading a package to a remote build service. -# Usually this line does not need to be modified. -Sources: -- '%{name}-%{version}.tar.bz2' -- 'tailscaled.service' -- 'tailscale' -- 'tailscaled' -- 'tailscaled.defaults' -Description: | - - Tailscale makes networking easy - - %if "%{?vendor}" == "chum" - PackageName: tailscale - Type: desktop-application - DeveloperName: Andrea Scarpino - Categories: - - Network - Custom: - Repo: https://github.com/ilpianista/harbour-tailscale - Screenshots: - - https://raw.githubusercontent.com/ilpianista/harbour-Tailscale/master/screenshots/screenshot_1.png - Url: - Homepage: https://github.com/ilpianista/harbour-tailscale - Bugtracker: https://github.com/ilpianista/harbour-tailscale/issues - Donation: https://liberapay.com/ilpianista - %endif -Configure: none -# The qtc5 builder inserts macros to allow QtCreator to have fine -# control over qmake/make execution -Builder: qtc5 - -# This section specifies build dependencies that are resolved using pkgconfig. -# This is the preferred way of specifying build dependencies for your package. -PkgConfigBR: - - sailfishapp >= 1.0.2 - - Qt5Core - - Qt5Qml - - Qt5Quick - -# Build dependencies without a pkgconfig setup can be listed here -# PkgBR: -# - package-needed-to-build - -# Runtime dependencies which are not automatically detected -Requires: - - sailfishsilica-qt5 >= 0.10.9 - -# All installed files -Files: - - '%attr(4755,root,root) %{_bindir}/%{name}' - - '%{_bindir}/tailscale' - - '%{_bindir}/tailscaled' - - '%{_datadir}/%{name}' - - '%{_sysconfdir}/sysconfig/tailscaled' - - '%{_unitdir}/tailscaled.service' - - '%dir %{_sharedstatedir}/tailscale' - - '%dir %{_localstatedir}/cache/tailscale' - - '%{_datadir}/applications/%{name}.desktop' - - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' - -# For more information about yaml and what's supported in Sailfish OS -# build system, please see https://wiki.merproject.org/wiki/Spectacle -