Skip to content

Commit

Permalink
[feature] Add release RPM package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Zarubin committed Nov 4, 2024
1 parent 9fd1bf5 commit ca477c8
Show file tree
Hide file tree
Showing 15 changed files with 257 additions and 168 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Subscribe and like!

[![Version](https://img.shields.io/badge/deb_package-0.0.9-blue)](https://github.com/keygenqt/aurora-toolbox/releases)
[![Version](https://img.shields.io/badge/deb_package-0.0.10-blue)](https://github.com/keygenqt/aurora-toolbox/releases)

![Preview](https://raw.githubusercontent.com/keygenqt/aurora-toolbox/refs/heads/main/files/images/preview_telegram.png)

Expand Down
File renamed without changes
38 changes: 38 additions & 0 deletions build/deb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Как собрать rpm пакет локально, на примере спецификации для Ubuntu 24.04

Подготовка окружения для сборки:

```shell
sudo apt-get install gettext, meson, pkg-config, libgjs-dev, libgtk-4-dev, libadwaita-1-dev
```

Сборка из корня проекта:

```shell
chmod +x ./build/run.sh
./build/run.sh
```

Собранный пакет можно будет найти:

`./build/release/debrpm/aurora-toolbox_{version}-{revision}_amd64_.deb`

## Установка

Подготовка окружения для установки:

```shell
sudo apt-get install gjs, language-pack-gnome-ru, language-pack-ru-base, libadwaita-1-0
```

Установка:

```shell
sudo dpkg -i ./build/release/deb/aurora-toolbox_*.deb
```

Удаление:

```shell
sudo dpkg -r com.keygenqt.aurora-toolbox
```
53 changes: 28 additions & 25 deletions scripts/deb.sh → build/deb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
## Build and creae deb package
##############################

read -p "You change '@todo debug' code? (y/n)? " choice
case "$choice" in
y|Y ) echo "yes";;
n|N ) exit 0;;
* ) echo "invalid";;
esac
NAME="$1"
PACKAGE="$2"
REVISION="$3"
FOLDER="$4"
VERSION="$5"

ARCH="amd64"

NAME='aurora-toolbox'
PACKAGE='com.keygenqt.aurora-toolbox'
REVISION='1'
FOLDER='release'
ARCH='amd64'
# Set root dir
DIR="$(dirname "$(realpath "$0")")"
cd $DIR/../../

VERSION=$(grep -m 1 version meson.build | xargs | sed 's/[,]//g' | sed 's/version: //g')
# Folder for deb
DEB_FOLDER="${NAME}_${VERSION}-${REVISION}_${ARCH}"

# Clear
rm -rf $FOLDER
rm -rf $DEB_FOLDER

# Build
meson setup \
-Dbindir=/usr/local/bin \
-Ddatadir=/usr/local/share/$PACKAGE \
Expand All @@ -34,6 +34,7 @@ meson setup \

ninja -C $FOLDER

# Create folders
mkdir -p $DEB_FOLDER
mkdir -p $DEB_FOLDER/DEBIAN
mkdir -p $DEB_FOLDER/usr/local
Expand All @@ -44,25 +45,28 @@ mkdir -p $DEB_FOLDER/usr/share/glib-2.0/schemas
mkdir -p $DEB_FOLDER/usr/share/applications
mkdir -p $DEB_FOLDER/usr/share/icons

chmod +x $FOLDER/src/$PACKAGE

# Bin
chmod +x $FOLDER/src/$PACKAGE
cp $FOLDER/src/$PACKAGE $DEB_FOLDER/usr/local/bin

# Short name
ln -s /usr/local/bin/$PACKAGE $DEB_FOLDER/usr/local/bin/$NAME

# Source
cp $FOLDER/src/*.gresource $DEB_FOLDER/usr/local/share/$PACKAGE
cp $FOLDER/data/*.gresource $DEB_FOLDER/usr/local/share/$PACKAGE

# Translate
cp $FOLDER/po/ru/LC_MESSAGES/*.mo $DEB_FOLDER/usr/local/share/locale/ru/LC_MESSAGES

# Schemas
cp ./data/com.keygenqt.aurora-toolbox.gschema.xml $DEB_FOLDER/usr/share/glib-2.0/schemas
# Menu
cp ./files/package/*.desktop $DEB_FOLDER/usr/share/applications
cp ./files/package/*.svg $DEB_FOLDER/usr/share/icons

rm -rf $FOLDER/{*,.[^.]*}
# Menu
cp ./build/data/*.desktop $DEB_FOLDER/usr/share/applications
cp ./build/data/*.svg $DEB_FOLDER/usr/share/icons

# Create control
tee -a $DEB_FOLDER/DEBIAN/control > /dev/null <<EOT
Package: $PACKAGE
Version: $VERSION
Expand All @@ -74,11 +78,10 @@ Depends: gjs, language-pack-gnome-ru, language-pack-ru-base, libadwaita-1-0 (>=
EOT

dpkg-deb --build --root-owner-group $DEB_FOLDER
mv $DEB_FOLDER.deb $FOLDER
rm -rf $DEB_FOLDER

dpkg -x $FOLDER/$DEB_FOLDER.deb $FOLDER/$DEB_FOLDER

# Install / Remove
sudo dpkg -r com.keygenqt.aurora-toolbox
sudo dpkg -i release/aurora-toolbox_0.0.9-1_amd64.deb
# Move
rm -rf ./build/$FOLDER/deb
mkdir -p ./build/$FOLDER/deb
mv $DEB_FOLDER.deb ./build/$FOLDER/deb
rm -rf $FOLDER
rm -rf $DEB_FOLDER
38 changes: 38 additions & 0 deletions build/rpm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Как собрать rpm пакет локально, на примере спецификации для ALT Linux (P11)

Подготовка окружения для сборки:

```shell
sudo apt-get install rpm-build meson libgjs-devel libgtk4-devel libadwaita-devel
```

Сборка из корня проекта:

```shell
chmod +x ./build/run.sh
./build/run.sh
```

Собранный пакет можно будет найти:

`./build/release/rpm/aurora-toolbox_{version}-{revision}_x86_64.rpm`

## Установка

Подготовка окружения для установки:

```shell
sudo apt-get install gnome-extensions-app libgjs libgtk4-gir libadwaita-gir libsoup-gir
```

Установка:

```shell
sudo rpm -i ./build/release/rpm/aurora-toolbox_*.rpm
```

Удаление:

```shell
sudo rpm -e aurora-toolbox
```
102 changes: 102 additions & 0 deletions build/rpm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/bin/bash

###############################
## Build and create rpm package
###############################

NAME="$1"
PACKAGE="$2"
REVISION="$3"
FOLDER="$4"
VERSION="$5"

ARCH="x86_64"

# Set root dir
DIR="$(dirname "$(realpath "$0")")"
cd $DIR/../../

NAME_RPM="$NAME-$VERSION-$REVISION.$ARCH.rpm"
RPM_FOLDER=$HOME/RPM

# Clear
rm -rf $RPM_FOLDER

# Create folders
mkdir -p $RPM_FOLDER
mkdir -p $RPM_FOLDER/SPECS
mkdir -p $RPM_FOLDER/SOURCES

# Copy data
cd $DIR/../../../
cp -R ./$NAME ./$NAME-$VERSION
tar czf source.tar.gz ./$NAME-$VERSION
mv source.tar.gz $RPM_FOLDER/SOURCES
rm -rf ./$NAME-$VERSION
cd $NAME

# Create control
tee -a $RPM_FOLDER/SPECS/$NAME.spec > /dev/null <<EOT
%define fullname $PACKAGE
Name: $NAME
Version: $VERSION
Release: $REVISION
Summary: An application that provides an easy start in the Aurora OS ecosystem.
License: Apache-2.0
Group: Development/Tools
Url: https://github.com/keygenqt/aurora-toolbox
Source: source.tar.gz
BuildRequires: meson
BuildRequires: libgjs-devel
BuildRequires: libgtk4-devel
BuildRequires: libadwaita-devel >= 1.5
Requires: sudo
Requires: gnome-extensions-app
Requires: libgjs
Requires: libgtk4-gir
Requires: libadwaita-gir
Requires: libsoup-gir
%description
%summary.
%prep
%setup
%build
%meson
%meson_build
%install
%meson_install
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/icons
install ./build/data/%{fullname}.svg %{buildroot}%{_datadir}/icons/%{fullname}.svg
install ./build/data/%{fullname}.desktop %{buildroot}%{_datadir}/applications/%{fullname}.desktop
%post
ln -sf %{_bindir}/%{fullname} %{_bindir}/%{name}
%files
%doc CHANGELOG.md
%{_bindir}/%{fullname}
%{_datadir}/%{fullname}/%{fullname}.data.gresource
%{_datadir}/%{fullname}/%{fullname}.src.gresource
%{_datadir}/applications/%{fullname}.desktop
%{_datadir}/glib-2.0/schemas/%{fullname}.gschema.xml
%{_datadir}/icons/%{fullname}.svg
%{_datadir}/locale/ru/LC_MESSAGES/%{fullname}.mo
EOT

# Build
rpmbuild -bb $RPM_FOLDER/SPECS/$NAME.spec

# Move
rm -rf ./build/$FOLDER/rpm
mkdir -p ./build/$FOLDER/rpm
mv $RPM_FOLDER/RPMS/x86_64/$NAME_RPM ./build/$FOLDER/rpm/$NAME_RPM
rm -rf $RPM_FOLDER
37 changes: 37 additions & 0 deletions build/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#################
## Build packages
#################

read -p "What kind of package build? (deb/rpm)? " choice
case "$choice" in
deb ) echo "Let's start assembling...";;
rpm ) echo "Let's start assembling...";;
* ) echo "Required [deb/rpm]"; exit;;
esac

NAME='aurora-toolbox'
PACKAGE='com.keygenqt.aurora-toolbox'
REVISION='1'
FOLDER='release'
DIR="$(dirname "$(realpath "$0")")"
VERSION=$(grep -m 1 version $DIR/../meson.build | xargs | sed 's/[,]//g' | sed 's/version: //g')

# Build deb
if [ "$choice" = "deb" ]; then
sh $DIR/deb/build.sh $NAME $PACKAGE $REVISION $FOLDER $VERSION
fi

# Build rpm
if [ "$choice" = "rpm" ]; then
sh $DIR/rpm/build.sh $NAME $PACKAGE $REVISION $FOLDER $VERSION
fi

# DEB Install / Remove
# sudo dpkg -r com.keygenqt.aurora-toolbox
# sudo dpkg -i $DIR/release/deb/*_amd64.deb

# RPM Install / Remove
# sudo rpm -e aurora-toolbox
# sudo rpm -i $DIR/release/rpm/*_amd64.rpm
2 changes: 1 addition & 1 deletion data/ui/dialogs/AboutDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="presentation-mode">floating</property>
<property name="application-icon">com.keygenqt.aurora-toolbox</property>
<property name="application-name" translatable="yes">Aurora Toolbox</property>
<property name="version">0.0.9</property>
<property name="version">0.0.10</property>
<property name="copyright">© 2024 KeyGenQt</property>
<property name="issue_url">https://github.com/keygenqt/aurora-toolbox/issues</property>
<property name="developer-name" translatable="yes">Vitaliy Zarubin</property>
Expand Down
12 changes: 10 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ hide:
Я разрабатывал приложения под Ubuntu, и тестировал его там.
Приложение доступно в `deb` пакете на странице [релизов](https://github.com/keygenqt/aurora-toolbox/releases) GitHub.

Приложение [Aurora CLI](https://keygenqt.github.io/aurora-cli), от которого зависит Aurora Toolbox устанавливается стандартным способом для него:
Приложение [Aurora CLI](https://keygenqt.github.io/aurora-cli), от которого зависит Aurora Toolbox устанавливается стандартным способом для него:
[Install](https://keygenqt.github.io/aurora-cli/install/).

!!! info

Установка на примере дистрибутива Ubuntu, но так же доступен rpm пакет, который можно установит примерно так:
```shell
sudo rpm -i aurora-toolbox_0.0.10-1_x86_64.rpm
```


#### Install

```shell
sudo dpkg -i aurora-toolbox_0.0.9-1_amd64.deb
sudo dpkg -i aurora-toolbox_0.0.10-1_amd64.deb
```

#### Update/Install dependency
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Define our project
project(
'aurora-toolbox',
version: '0.0.9',
version: '0.0.10',
license: ['Apache 2.0'],
meson_version: '>= 0.59.0',
default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'cpp_eh=none',
Expand Down
17 changes: 0 additions & 17 deletions rpm/README.md

This file was deleted.

Loading

0 comments on commit ca477c8

Please sign in to comment.