From f93796767eae19c7ce14e222b00499f53a750528 Mon Sep 17 00:00:00 2001 From: Aptivi CEO Date: Mon, 14 Aug 2023 20:48:53 +0300 Subject: [PATCH] add - Initialize makefile We've initialized the makefiles. --- We've initialized the makefile, as well as the debian packaging. --- Type: add Breaking: False Doc Required: False Part: 1/1 --- .../build-ppa-package-with-lintian.yml | 55 +++++++++++++++++++ .github/workflows/build-ppa-package.yml | 55 +++++++++++++++++++ .github/workflows/build-ppa.yml | 36 ++++++++++++ .github/workflows/pushamend.yml | 39 +++++++++++++ .github/workflows/pushtest.yml | 45 +++++++++++++++ Makefile | 46 ++++++++++++++++ debian/changelog | 6 ++ debian/control | 18 ++++++ debian/copyright | 23 ++++++++ debian/nuglobal.manpages | 1 + debian/rules | 26 +++++++++ debian/source/format | 1 + 12 files changed, 351 insertions(+) create mode 100644 .github/workflows/build-ppa-package-with-lintian.yml create mode 100644 .github/workflows/build-ppa-package.yml create mode 100644 .github/workflows/build-ppa.yml create mode 100644 .github/workflows/pushamend.yml create mode 100644 .github/workflows/pushtest.yml create mode 100644 Makefile create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/nuglobal.manpages create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.github/workflows/build-ppa-package-with-lintian.yml b/.github/workflows/build-ppa-package-with-lintian.yml new file mode 100644 index 0000000..86eec37 --- /dev/null +++ b/.github/workflows/build-ppa-package-with-lintian.yml @@ -0,0 +1,55 @@ +name: Build Project (Debian Package, Lintian) + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Import GPG + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install required packages + run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list + sudo apt update + sudo apt purge dotnet* + sudo apt autoremove + sudo apt install curl locales-all cli-common-dev libunwind8-dev libcurl4-openssl-dev rustc cargo devscripts debhelper-compat dput + + - name: Initialize offline package + run: | + make debian-init-offline + + - name: Make original package + run: | + mv debian .. + mv .github .. + tar cfv ../nuglobal_0.1.0.orig.tar . + xz ../nuglobal_0.1.0.orig.tar + mv ../debian . + + - name: Build package + run: | + debuild -us -uc + cp ../*.deb . + + - name: Upload package to artifacts + uses: actions/upload-artifact@v2 + with: + name: NuGlobal-Debian-Package + path: "*.deb" diff --git a/.github/workflows/build-ppa-package.yml b/.github/workflows/build-ppa-package.yml new file mode 100644 index 0000000..237da8d --- /dev/null +++ b/.github/workflows/build-ppa-package.yml @@ -0,0 +1,55 @@ +name: Build Project (Debian Package) + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Import GPG + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install required packages + run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list + sudo apt update + sudo apt purge dotnet* + sudo apt autoremove + sudo apt install curl locales-all cli-common-dev libunwind8-dev libcurl4-openssl-dev rustc cargo devscripts debhelper-compat dput + + - name: Initialize offline package + run: | + make debian-init-offline + + - name: Make original package + run: | + mv debian .. + mv .github .. + tar cfv ../nuglobal_0.1.0.orig.tar . + xz ../nuglobal_0.1.0.orig.tar + mv ../debian . + + - name: Build package + run: | + debuild --no-lintian -us -uc + cp ../*.deb . + + - name: Upload package to artifacts + uses: actions/upload-artifact@v2 + with: + name: NuGlobal-Debian-Package + path: "*.deb" diff --git a/.github/workflows/build-ppa.yml b/.github/workflows/build-ppa.yml new file mode 100644 index 0000000..5bcfd09 --- /dev/null +++ b/.github/workflows/build-ppa.yml @@ -0,0 +1,36 @@ +name: Build Project (for Launchpad PPA) + +on: + push: + branches: + - main + pull_request: + branches: + - main + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Install required packages + run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list + sudo apt update + sudo apt purge dotnet* + sudo apt autoremove + sudo apt install curl locales-all cli-common-dev libunwind8-dev libcurl4-openssl-dev rustc cargo devscripts debhelper-compat dput + + - name: Initialize offline package + run: | + sudo ip netns add no-net + make debian-init-offline + + - name: Try to build + run: | + sudo ip netns exec no-net make debian-all-offline diff --git a/.github/workflows/pushamend.yml b/.github/workflows/pushamend.yml new file mode 100644 index 0000000..d41543b --- /dev/null +++ b/.github/workflows/pushamend.yml @@ -0,0 +1,39 @@ +name: Push to PPA (amend with original source) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Import GPG + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install required packages + run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list + sudo apt update + sudo apt purge dotnet* + sudo apt autoremove + sudo apt install curl locales-all cli-common-dev libunwind8-dev libcurl4-openssl-dev rustc cargo devscripts debhelper-compat dput + + - name: Download original source + run: | + wget --output-document=../nuglobal_0.1.0.orig.tar.xz https://launchpad.net/~eofla/+archive/ubuntu/aptivi-devapps/+sourcefiles/nuglobal/0.1.0/nuglobal_0.1.0.orig.tar.xz + tar xf ../nuglobal_0.1.0.orig.tar.xz . + mv .github .. + + - name: Build source package + run: debuild -S + + - name: Push to Launchpad + run: dput ppa:eofla/aptivi-devapps ../nuglobal_0.1.0*_source.changes diff --git a/.github/workflows/pushtest.yml b/.github/workflows/pushtest.yml new file mode 100644 index 0000000..9b12bff --- /dev/null +++ b/.github/workflows/pushtest.yml @@ -0,0 +1,45 @@ +name: Push to PPA + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Import GPG + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install required packages + run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list + sudo apt update + sudo apt purge dotnet* + sudo apt autoremove + sudo apt install curl locales-all cli-common-dev libunwind8-dev libcurl4-openssl-dev rustc cargo devscripts debhelper-compat dput + + - name: Initialize offline package + run: | + make debian-init-offline + + - name: Make original package + run: | + mv debian .. + mv .github .. + tar cfv ../nuglobal_0.1.0.orig.tar . + xz ../nuglobal_0.1.0.orig.tar + mv ../debian . + + - name: Build source package + run: debuild -S -sa + + - name: Push to Launchpad + run: dput ppa:eofla/aptivi-devapps ../nuglobal_0.1.0*_source.changes diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4e9e2ba --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +# +# NuGlobal Copyright (C) 2018-2023 Aptivi +# +# NuGlobal is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# NuGlobal is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +OUTPUTS = targets debian/nuglobal +BINARIES = targets/release/nuglobal +MANUALS = doc/nuglobal.1 + +.PHONY: all all-online-release debian-install + +# General use + +all: all-online + +all-online: + cargo build + +all-online-release: + cargo build --release + +# Below targets are for Debian packaging only + +debian-all-offline: + cargo build --release --offline + +debian-install: + mkdir -m 755 -p debian/nuglobal/usr/bin + install -m 755 -t debian/nuglobal/usr/bin/ $(BINARIES) + install -m 755 -t debian/ $(MANUALS) + +clean: + rm -rf $(OUTPUTS) + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a6978d3 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +nuglobal (0.1.0) jammy; urgency=medium + + * Initial release + + -- EoflaOE Tue, 14 Aug 2023 20:48:50 +0300 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c0ec65f --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: nuglobal +Section: devel +Priority: optional +Maintainer: EoflaOE +Build-Depends: debhelper-compat (= 12), cargo, rustc +Standards-Version: 4.4.0 +Homepage: https://aptivi.gitbook.io/nuglobal-manual +Vcs-Browser: https://github.com/Aptivi/nuglobal +Vcs-Git: https://github.com/Aptivi/nuglobal.git + +Package: nuglobal +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, cargo, rustc +Description: Offline NuGet Global Feed Initializer for Offline Builds + NuGlobal is the offline NuGet global feed initializer and manager for + offline builds of .NET projects. It allows you to install NuGet package + files to either your home directory or to your systemwide configuration + directory so that they can get initialized for offline .NET builds. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..4659688 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: nuglobal +Source: https://github.com/Aptivi/nuglobal/blob/main/LICENSE + +Files: * +Copyright: 2023 Aptivi +License: GPL-3+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + diff --git a/debian/nuglobal.manpages b/debian/nuglobal.manpages new file mode 100644 index 0000000..f746afa --- /dev/null +++ b/debian/nuglobal.manpages @@ -0,0 +1 @@ +debian/nuglobal.1 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..5003ba7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f +# +# NuGlobal Copyright (C) 2023 Aptivi +# +# NuGlobal is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# NuGlobal is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +%: + dh $@ + +override_dh_auto_build: + $(MAKE) debian-all-offline + +override_dh_auto_install: + $(MAKE) debian-install diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)