From 346ccb20179d9aaf693b4b4191021b399fc2a1de Mon Sep 17 00:00:00 2001 From: guard43ru Date: Wed, 2 Aug 2023 05:06:58 +0300 Subject: [PATCH 1/7] Fedora build on GitHub Actions --- .github/workflows/package-fedora.yml | 38 +++++++++++++++++++++++++++ deploy/gk_linux_rpm_fedora_package.sh | 3 +-- deploy/make_gk3_linux_fedora_pack.sh | 2 +- deploy/rpm/gedkeeper.spec | 14 +++------- deploy/rpm/gk_files.txt | 20 +------------- 5 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/package-fedora.yml diff --git a/.github/workflows/package-fedora.yml b/.github/workflows/package-fedora.yml new file mode 100644 index 000000000..164ef3ff9 --- /dev/null +++ b/.github/workflows/package-fedora.yml @@ -0,0 +1,38 @@ +name: Package GEDKeeper3 for Fedora + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + DOTNET_VERSION: '6.0.*' + +jobs: + build-fedora: + runs-on: ubuntu-latest + steps: + - name: Init + uses: actions/checkout@v3 + with: + submodules: recursive + - name: .NET SDK check + run: dotnet sdk check +# error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'freebsd-x64' +# https://learn.microsoft.com/en-us/dotnet/devops/dotnet-build-github-action +# - name: Install dependencies +# run: dotnet restore +# working-directory: projects/GKv3 + - name: Build + run: dotnet build -c Linux_Release + working-directory: projects/GKv3 + - name: Package + run: bash ./gk_linux_rpm_fedora_package.sh + working-directory: deploy + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: gedkeeper3-rpm + path: ~/rpmbuild/RPMS/x86_64/*.rpm + if-no-files-found: error diff --git a/deploy/gk_linux_rpm_fedora_package.sh b/deploy/gk_linux_rpm_fedora_package.sh index 680d4591b..15d9e534b 100644 --- a/deploy/gk_linux_rpm_fedora_package.sh +++ b/deploy/gk_linux_rpm_fedora_package.sh @@ -1,6 +1,5 @@ #!/bin/sh -APP_VER="$1" DIR="$( cd "$( dirname "$0" )" && pwd )" rm -rf ~/rpmbuild/ @@ -10,7 +9,7 @@ mkdir -p ~/rpmbuild/SOURCES mkdir -p ~/rpmbuild/SPECS mkdir -p ~/rpmbuild/SRPMS -tar -zcf ~/rpmbuild/SOURCES/gedkeeper-$APP_VER.tar.gz -T "$DIR/rpm/gk_files.txt" +tar -zcf ~/rpmbuild/SOURCES/gedkeeper.tar.gz -T "$DIR/rpm/gk_files.txt" cp "$DIR/rpm/gedkeeper.spec" ~/rpmbuild/SPECS/gedkeeper.spec cd ~/rpmbuild/SPECS/ diff --git a/deploy/make_gk3_linux_fedora_pack.sh b/deploy/make_gk3_linux_fedora_pack.sh index 63cd95691..9e23e4037 100644 --- a/deploy/make_gk3_linux_fedora_pack.sh +++ b/deploy/make_gk3_linux_fedora_pack.sh @@ -3,4 +3,4 @@ APP_VER="3.2.1" dotnet build ../projects/GKv3/GEDKeeper3.sln -c Linux_Release #cd ./deploy/ -sh ./gk_linux_rpm_fedora_package.sh $APP_VER +sh ./gk_linux_rpm_fedora_package.sh diff --git a/deploy/rpm/gedkeeper.spec b/deploy/rpm/gedkeeper.spec index c43c40e6f..2d07c9011 100644 --- a/deploy/rpm/gedkeeper.spec +++ b/deploy/rpm/gedkeeper.spec @@ -8,13 +8,10 @@ Summary: %{summary} License: GPLv3 Group: Applications/Editors Url: https://github.com/serg-norseman/gedkeeper -Source: %{name}-%{version}.tar.gz +Source: %{name}.tar.gz BuildArch: x86_64 -#Requires: mono-core -#Requires: mono-data -#Requires: mono-winforms -#Requires: lua +Requires: dotnet-runtime-6.0 Requires: sqlite AutoReq: no @@ -33,11 +30,6 @@ AutoReqProv: no %prep %setup -qc -find . -type f -iname "*.dll" -exec chmod -x {} \; -find ./locales -type f -exec chmod -x '{}' \; -find ./plugins -type f -exec chmod -x '{}' \; -find ./scripts -type f -exec chmod -x '{}' \; -find ./samples -type f -exec chmod -x '{}' \; %install install -Dm 0755 gk_run.sh %{buildroot}%{_bindir}/gk_run.sh @@ -52,7 +44,7 @@ cp -r bin \ scripts %{buildroot}%{_libdir}/%{name} ## E: zero-length -rm -rf %{buildroot}%{_libdir}/%{name}/scripts/readme.txt +#rm -rf %{buildroot}%{_libdir}/%{name}/scripts/readme.txt %changelog * Apr 28 2023 GEDKeeper - 3.2.1 diff --git a/deploy/rpm/gk_files.txt b/deploy/rpm/gk_files.txt index b06695bde..f757e6798 100644 --- a/deploy/rpm/gk_files.txt +++ b/deploy/rpm/gk_files.txt @@ -3,25 +3,7 @@ ./gedkeeper.desktop ./application-x-gedkeeper.xml ./gedkeeper.appdata.xml -../bin/GEDKeeper3.exe -../bin/GKCore.dll -../bin/GKComponents.dll -../bin/BSLib.dll -../bin/BSLib.DataViz.Model.dll -../bin/BSLib.SQLite.dll -../bin/RtfWriter.dll -../bin/ExcelLibrary.dll -../bin/GKMap.Core.dll -../bin/GKMap.WinForms.dll -../bin/itextsharp.dll -../bin/KopiLua.dll -../bin/NLua.dll -../bin/NLog.dll -../bin/nVLC.dll -../bin/UtfUnknown.dll -../bin/YamlDotNet.dll -../bin/Newtonsoft.Json.dll -../bin/ZedGraph.dll +../bin/ ../LICENSE ../locales/ ../plugins/ From b7a631b7aa6d8294525029f0dbe30d5cb3347347 Mon Sep 17 00:00:00 2001 From: Roman G Date: Fri, 4 Aug 2023 01:59:00 +0400 Subject: [PATCH 2/7] revert APP_VER --- deploy/gk_linux_rpm_fedora_package.sh | 3 ++- deploy/make_gk3_linux_fedora_pack.sh | 2 +- deploy/rpm/gedkeeper.spec | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/gk_linux_rpm_fedora_package.sh b/deploy/gk_linux_rpm_fedora_package.sh index 15d9e534b..680d4591b 100644 --- a/deploy/gk_linux_rpm_fedora_package.sh +++ b/deploy/gk_linux_rpm_fedora_package.sh @@ -1,5 +1,6 @@ #!/bin/sh +APP_VER="$1" DIR="$( cd "$( dirname "$0" )" && pwd )" rm -rf ~/rpmbuild/ @@ -9,7 +10,7 @@ mkdir -p ~/rpmbuild/SOURCES mkdir -p ~/rpmbuild/SPECS mkdir -p ~/rpmbuild/SRPMS -tar -zcf ~/rpmbuild/SOURCES/gedkeeper.tar.gz -T "$DIR/rpm/gk_files.txt" +tar -zcf ~/rpmbuild/SOURCES/gedkeeper-$APP_VER.tar.gz -T "$DIR/rpm/gk_files.txt" cp "$DIR/rpm/gedkeeper.spec" ~/rpmbuild/SPECS/gedkeeper.spec cd ~/rpmbuild/SPECS/ diff --git a/deploy/make_gk3_linux_fedora_pack.sh b/deploy/make_gk3_linux_fedora_pack.sh index 9e23e4037..63cd95691 100644 --- a/deploy/make_gk3_linux_fedora_pack.sh +++ b/deploy/make_gk3_linux_fedora_pack.sh @@ -3,4 +3,4 @@ APP_VER="3.2.1" dotnet build ../projects/GKv3/GEDKeeper3.sln -c Linux_Release #cd ./deploy/ -sh ./gk_linux_rpm_fedora_package.sh +sh ./gk_linux_rpm_fedora_package.sh $APP_VER diff --git a/deploy/rpm/gedkeeper.spec b/deploy/rpm/gedkeeper.spec index 2d07c9011..8969963b8 100644 --- a/deploy/rpm/gedkeeper.spec +++ b/deploy/rpm/gedkeeper.spec @@ -8,7 +8,7 @@ Summary: %{summary} License: GPLv3 Group: Applications/Editors Url: https://github.com/serg-norseman/gedkeeper -Source: %{name}.tar.gz +Source: %{name}-%{version}.tar.gz BuildArch: x86_64 Requires: dotnet-runtime-6.0 From 61b432c939b71e83a0a5cb9ba01d230d2db3fccf Mon Sep 17 00:00:00 2001 From: guard43ru Date: Fri, 4 Aug 2023 04:44:56 +0300 Subject: [PATCH 3/7] Separate build fedora --- .github/workflows/package-fedora.yml | 6 +-- deploy/rpm/gedkeeper-gh-act.spec | 58 ++++++++++++++++++++++++++++ deploy/rpm/gedkeeper.desktop | 22 +++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 deploy/rpm/gedkeeper-gh-act.spec create mode 100644 deploy/rpm/gedkeeper.desktop diff --git a/.github/workflows/package-fedora.yml b/.github/workflows/package-fedora.yml index 164ef3ff9..e15023719 100644 --- a/.github/workflows/package-fedora.yml +++ b/.github/workflows/package-fedora.yml @@ -25,11 +25,11 @@ jobs: # run: dotnet restore # working-directory: projects/GKv3 - name: Build - run: dotnet build -c Linux_Release + run: dotnet build -c Linux_Debug + # run: dotnet build -c Linux_Release working-directory: projects/GKv3 - name: Package - run: bash ./gk_linux_rpm_fedora_package.sh - working-directory: deploy + run: rpmbuild --build-in-place -bb deploy/rpm/gedkeeper-gh-act.spec - name: Upload uses: actions/upload-artifact@v3 with: diff --git a/deploy/rpm/gedkeeper-gh-act.spec b/deploy/rpm/gedkeeper-gh-act.spec new file mode 100644 index 000000000..30d651dbc --- /dev/null +++ b/deploy/rpm/gedkeeper-gh-act.spec @@ -0,0 +1,58 @@ +%define summary GEDKeeper - program for work with personal genealogical database. + +Name: gedkeeper +Version: 3.2.1 +Release: 1%{?dist} +Summary: %{summary} +License: GPLv3 +Group: Applications/Editors +Url: https://github.com/serg-norseman/gedkeeper +BuildArch: x86_64 + +Requires: dotnet-runtime-6.0 +#Requires: sqlite + +%install + +# main install +mkdir -p %{buildroot}%{_libdir}/%{name} +cp -r bin \ + locales \ + plugins \ + samples \ + scripts %{buildroot}%{_libdir}/%{name} + +# clean multi-arch builds (TODO: fix me) +ls -la %{buildroot}%{_libdir}/%{name}/plugins/runtimes/ +rm -rf %{buildroot}%{_libdir}/%{name}/plugins/runtimes +install -t %{buildroot}%{_libdir}/%{name}/plugins/runtimes/linux-x64/native/ -D plugins/runtimes/linux-x64/native/* +ls -la %{buildroot}%{_libdir}/%{name}/plugins/runtimes/ + +# symlink to binary file +mkdir -p %{buildroot}%{_bindir} +ln -fs %{_libdir}/%{name}/bin/GEDKeeper3 %{buildroot}%{_bindir}/%{name} + +#rpm --eval %{_metainfodir} # not found ?! (TODO: check rpm version) +#install -D deploy/application-x-%{name}.xml %{buildroot}%{_metainfodir}/%{name}.metainfo.xml +install -D deploy/application-x-%{name}.xml %{buildroot}%{_datadir}/metainfo/%{name}.metainfo.xml +install -D deploy/rpm/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop +install -D deploy/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png + +cd %{buildroot} +chmod -cRf a-x,a+rX,u+w,g-w,o-w . +chmod -v a+x %{buildroot}%{_libdir}/%{name}/bin/GEDKeeper3 + +%files +%license LICENSE +%{_bindir}/%{name} +%{_libdir}/%{name} +%{_datadir}/metainfo/%{name}.metainfo.xml +%{_datadir}/applications/%{name}.desktop +%{_datadir}/pixmaps/%{name}.png + +%description +%{summary} + +%changelog +* Apr 28 2023 GEDKeeper - 3.2.1 +- New upstream release diff --git a/deploy/rpm/gedkeeper.desktop b/deploy/rpm/gedkeeper.desktop new file mode 100644 index 000000000..282b24532 --- /dev/null +++ b/deploy/rpm/gedkeeper.desktop @@ -0,0 +1,22 @@ +[Desktop Entry] +Name=GEDKeeper +Comment=Personal genealogical database editor +Comment[cs]=Editor osobní genealogické databáze +Comment[de]=Persönlicher genealogischer Datenbankeditor +Comment[es]=Editor de una base de datos genealógica personal +Comment[fr]=L'éditeur personnelle généalogique de la base de données +Comment[it]=Editor di un database genealogico personali +Comment[kk]=Жеке генеалогиялық деректер қорының редакторы +Comment[pl]=Edytor osobista baza genealogiczna +Comment[pt]=Editor de um banco de dados genealógico pessoal +Comment[ru]=Редактор персональной генеалогической базы данных +Comment[uk]=Редактор персональної генеалогічної бази даних +Comment[zh]=个人系谱数据库编辑器 +Path=/usr/bin/ +Exec=gedkeeper +MimeType=application/x-gedkeeper +Icon=/usr/share/pixmaps/gedkeeper.png +Terminal=false +Type=Application +Categories=Office +StartupNotify=true From 5886596654444c781ad4788a915a0ed7bbfa868a Mon Sep 17 00:00:00 2001 From: guard43ru Date: Fri, 4 Aug 2023 05:08:33 +0300 Subject: [PATCH 4/7] disable debug, verbose --- .github/workflows/package-fedora.yml | 3 +-- deploy/rpm/gedkeeper-gh-act.spec | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package-fedora.yml b/.github/workflows/package-fedora.yml index e15023719..be9866b96 100644 --- a/.github/workflows/package-fedora.yml +++ b/.github/workflows/package-fedora.yml @@ -25,8 +25,7 @@ jobs: # run: dotnet restore # working-directory: projects/GKv3 - name: Build - run: dotnet build -c Linux_Debug - # run: dotnet build -c Linux_Release + run: dotnet build -c Linux_Release working-directory: projects/GKv3 - name: Package run: rpmbuild --build-in-place -bb deploy/rpm/gedkeeper-gh-act.spec diff --git a/deploy/rpm/gedkeeper-gh-act.spec b/deploy/rpm/gedkeeper-gh-act.spec index 30d651dbc..a896cd402 100644 --- a/deploy/rpm/gedkeeper-gh-act.spec +++ b/deploy/rpm/gedkeeper-gh-act.spec @@ -39,8 +39,8 @@ install -D deploy/rpm/%{name}.desktop %{buildroot}%{_datadir}/applications/%{nam install -D deploy/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png cd %{buildroot} -chmod -cRf a-x,a+rX,u+w,g-w,o-w . -chmod -v a+x %{buildroot}%{_libdir}/%{name}/bin/GEDKeeper3 +chmod -Rf a-x,a+rX,u+w,g-w,o-w . +chmod a+x %{buildroot}%{_libdir}/%{name}/bin/GEDKeeper3 %files %license LICENSE From d0f31332d62d2a4f9a6c30820bcc61e93e86a8d7 Mon Sep 17 00:00:00 2001 From: guard43ru Date: Fri, 4 Aug 2023 05:25:25 +0300 Subject: [PATCH 5/7] some fix --- .github/workflows/package-fedora.yml | 2 +- deploy/rpm/{gedkeeper-gh-act.spec => gedkeeper-github.spec} | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename deploy/rpm/{gedkeeper-gh-act.spec => gedkeeper-github.spec} (95%) diff --git a/.github/workflows/package-fedora.yml b/.github/workflows/package-fedora.yml index be9866b96..82da1329d 100644 --- a/.github/workflows/package-fedora.yml +++ b/.github/workflows/package-fedora.yml @@ -28,7 +28,7 @@ jobs: run: dotnet build -c Linux_Release working-directory: projects/GKv3 - name: Package - run: rpmbuild --build-in-place -bb deploy/rpm/gedkeeper-gh-act.spec + run: rpmbuild --build-in-place -bb deploy/rpm/gedkeeper-github.spec - name: Upload uses: actions/upload-artifact@v3 with: diff --git a/deploy/rpm/gedkeeper-gh-act.spec b/deploy/rpm/gedkeeper-github.spec similarity index 95% rename from deploy/rpm/gedkeeper-gh-act.spec rename to deploy/rpm/gedkeeper-github.spec index a896cd402..8ad0fac04 100644 --- a/deploy/rpm/gedkeeper-gh-act.spec +++ b/deploy/rpm/gedkeeper-github.spec @@ -9,8 +9,10 @@ Group: Applications/Editors Url: https://github.com/serg-norseman/gedkeeper BuildArch: x86_64 +AutoReqProv:no +AutoReq: no Requires: dotnet-runtime-6.0 -#Requires: sqlite +Requires: sqlite %install @@ -54,5 +56,5 @@ chmod a+x %{buildroot}%{_libdir}/%{name}/bin/GEDKeeper3 %{summary} %changelog -* Apr 28 2023 GEDKeeper - 3.2.1 +* Fri Apr 28 2023 GEDKeeper - 3.2.1 - New upstream release From 525bd4f433d6b4b8dadcff8f3c362fef6b6103bc Mon Sep 17 00:00:00 2001 From: guard43ru Date: Fri, 4 Aug 2023 12:41:02 +0300 Subject: [PATCH 6/7] additional mime --- deploy/rpm/gedkeeper.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/rpm/gedkeeper.desktop b/deploy/rpm/gedkeeper.desktop index 282b24532..9681ea9c6 100644 --- a/deploy/rpm/gedkeeper.desktop +++ b/deploy/rpm/gedkeeper.desktop @@ -15,6 +15,7 @@ Comment[zh]=个人系谱数据库编辑器 Path=/usr/bin/ Exec=gedkeeper MimeType=application/x-gedkeeper +MimeType=application/x-gedcom Icon=/usr/share/pixmaps/gedkeeper.png Terminal=false Type=Application From b9428c983841a33eee3681af21f639fe11464b46 Mon Sep 17 00:00:00 2001 From: guard43ru Date: Fri, 4 Aug 2023 12:42:58 +0300 Subject: [PATCH 7/7] fix mime --- deploy/rpm/gedkeeper-github.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/rpm/gedkeeper-github.spec b/deploy/rpm/gedkeeper-github.spec index 8ad0fac04..1859833c8 100644 --- a/deploy/rpm/gedkeeper-github.spec +++ b/deploy/rpm/gedkeeper-github.spec @@ -34,9 +34,10 @@ ls -la %{buildroot}%{_libdir}/%{name}/plugins/runtimes/ mkdir -p %{buildroot}%{_bindir} ln -fs %{_libdir}/%{name}/bin/GEDKeeper3 %{buildroot}%{_bindir}/%{name} -#rpm --eval %{_metainfodir} # not found ?! (TODO: check rpm version) -#install -D deploy/application-x-%{name}.xml %{buildroot}%{_metainfodir}/%{name}.metainfo.xml -install -D deploy/application-x-%{name}.xml %{buildroot}%{_datadir}/metainfo/%{name}.metainfo.xml +#rpm --eval %{_metainfodir} # not found (TODO: check rpm version, make metainfo) +#install -D deploy/%{name}.metainfo.xml %{buildroot}%{_metainfodir}/%{name}.metainfo.xml +#install -D deploy/%{name}.metainfo.xml %{buildroot}%{_datadir}/metainfo/%{name}.metainfo.xml +install -D deploy/application-x-%{name}.xml %{buildroot}%{_datadir}/mime/packages/%{name}.xml install -D deploy/rpm/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop install -D deploy/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png @@ -48,7 +49,7 @@ chmod a+x %{buildroot}%{_libdir}/%{name}/bin/GEDKeeper3 %license LICENSE %{_bindir}/%{name} %{_libdir}/%{name} -%{_datadir}/metainfo/%{name}.metainfo.xml +%{_datadir}/mime/packages/%{name}.xml %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png