-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from joular/develop
Version 1.0.0
- Loading branch information
Showing
19 changed files
with
705 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
name = "powerjoular" | ||
description = "Monitoring the power consumption of multiple platforms and processes" | ||
version = "0.7.3" | ||
|
||
authors = ["Adel Noureddine"] | ||
maintainers = ["Adel Noureddine <adel.noureddine@univ-pau.fr>"] | ||
maintainers-logins = ["adelnoureddine"] | ||
|
||
tags = ["linux", "power", "energy"] | ||
|
||
licenses = "GPL-3.0-only" | ||
website = "https://www.noureddine.org/research/joular/powerjoular" | ||
|
||
executables = ["powerjoular"] | ||
name = "powerjoular" | ||
description = "Monitoring the power consumption of multiple platforms and processes" | ||
version = "1.0.0" | ||
|
||
authors = ["Adel Noureddine"] | ||
maintainers = ["Adel Noureddine <adel.noureddine@univ-pau.fr>"] | ||
maintainers-logins = ["adelnoureddine"] | ||
|
||
tags = ["linux", "power", "energy"] | ||
|
||
licenses = "GPL-3.0-only" | ||
website = "https://www.noureddine.org/research/joular/powerjoular" | ||
|
||
executables = ["powerjoular"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Maintainer: Adel Noureddine <adel.noureddine@univ-pau.fr> | ||
pkgname=powerjoular | ||
pkgver=1.0.0 | ||
pkgrel=1 | ||
pkgdesc="PowerJoular allows monitoring power consumption of multiple platforms and processes." | ||
arch=('x86_64' 'aarch64' 'armv7h') | ||
url="https://github.com/joular/powerjoular" | ||
license=('GPL3') | ||
depends=('gcc-ada' 'gprbuild' 'xmlada' 'libgpr') | ||
source=("$pkgname-$pkgver.tar.gz::https://github.com/joular/powerjoular/archive/refs/heads/main.tar.gz") | ||
sha256sums=('SKIP') | ||
|
||
build() { | ||
cd "$srcdir/$pkgname-develop" | ||
gprbuild -P powerjoular.gpr | ||
} | ||
|
||
package() { | ||
cd "$srcdir/$pkgname-develop" | ||
install -Dm755 obj/powerjoular "$pkgdir/usr/bin/powerjoular" | ||
install -Dm644 systemd/powerjoular.service "$pkgdir/etc/systemd/system/powerjoular.service" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Function to check user permissions to write to current directory | ||
if [ ! -w "$(pwd)" ]; then | ||
echo "ERROR: You don't have write permission on the directory $(pwd)." | ||
exit 1 | ||
fi | ||
|
||
# Source directory for PKGBUILD | ||
PKG_DIR="arch_pkgbuild" | ||
OUTPUT_DIR="arch_source_packages" | ||
rm -rf $PKG_DIR $OUTPUT_DIR | ||
mkdir -p $PKG_DIR $OUTPUT_DIR | ||
|
||
# Copy the PKGBUILD file to the build directory | ||
cp PKGBUILD $PKG_DIR/ | ||
|
||
# Changer de répertoire pour PKGBUILD | ||
cd $PKG_DIR | ||
|
||
# Change directory to PKGBUILD | ||
makepkg | ||
|
||
# Move the generated package to the output directory | ||
mv *.pkg.tar.zst ../$OUTPUT_DIR/ | ||
|
||
# Clean up temporary directories | ||
cd .. | ||
rm -rf $PKG_DIR | ||
|
||
echo "Arch package has been created and moved to the '$OUTPUT_DIR' directory." |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Name: powerjoular | ||
Version: 1.0.0 | ||
Release: 1%{?dist} | ||
Summary: PowerJoular allows monitoring power consumption of multiple platforms and processes. | ||
|
||
License: GPL-3.0-only | ||
Source0: %{_sourcedir}/obj/powerjoular | ||
Source1: %{_sourcedir}/powerjoular.service | ||
|
||
%description | ||
PowerJoular allows monitoring power consumption of multiple platforms and processes. | ||
|
||
%install | ||
rm -rf $RPM_BUILD_ROOT | ||
mkdir -p $RPM_BUILD_ROOT/%{_bindir} | ||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/systemd/system/ | ||
install -m 755 %{SOURCE0} $RPM_BUILD_ROOT/%{_bindir}/%{name} | ||
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/systemd/system/%{name}.service | ||
|
||
%files | ||
%{_bindir}/%{name} | ||
%{_sysconfdir}/systemd/system/%{name}.service | ||
|
||
%changelog | ||
* Thu Jun 20 2024 Adel Noureddine <adel.noureddine@univ-pau.fr> - 1.0.0-1 | ||
- Version 1.0.0 | ||
* Thu Jun 06 2024 Adel Noureddine <adel.noureddine@univ-pau.fr> - 0.7.3-1 | ||
- First RPM build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/bin/bash | ||
|
||
VERSION=1.0.0 | ||
|
||
# First cross compiler | ||
|
||
# Create obj/ folder it not exist | ||
mkdir -p obj | ||
|
||
# Architectures | ||
ARCHS=("x86_64-linux-gnu" "aarch64-linux-gnu") | ||
|
||
for ARCH in "${ARCHS[@]}" | ||
do | ||
gprbuild powerjoular.gpr --target=$ARCH | ||
mkdir -p ./binary/$ARCH | ||
cp ./obj/powerjoular ./binary/$ARCH/ | ||
done | ||
|
||
# Create packages folder | ||
rm -rf packages | ||
mkdir -p packages | ||
|
||
|
||
# Create deb packages | ||
|
||
# Create deb temporary folder | ||
mkdir -p deb-temp | ||
cd deb-temp | ||
|
||
DEBIAN_ARCHITECTURES=("amd64" "arm64") | ||
|
||
for DEB_ARCH in "${DEBIAN_ARCHITECTURES[@]}" | ||
do | ||
# Create a new directory structure for architecture | ||
rm -rf $DEB_ARCH | ||
mkdir -p $DEB_ARCH/powerjoular/usr/bin | ||
mkdir -p $DEB_ARCH/powerjoular/etc/systemd/system | ||
mkdir -p $DEB_ARCH/powerjoular/DEBIAN/ | ||
chmod 755 $DEB_ARCH | ||
|
||
# Copy precompiled binaries to bin directory | ||
if [[ $DEB_ARCH = "amd64" ]] | ||
then | ||
cp ../binary/x86_64-linux-gnu/powerjoular $DEB_ARCH/powerjoular/usr/bin | ||
elif [[ $DEB_ARCH = "arm64" ]] | ||
then | ||
cp ../binary/aarch64-linux-gnu/powerjoular $DEB_ARCH/powerjoular/usr/bin | ||
fi | ||
|
||
# Copy systemd service files | ||
cp ../systemd/powerjoular.service $DEB_ARCH/powerjoular/etc/systemd/system/ | ||
|
||
# Create the control | ||
cat << EOL > $DEB_ARCH/powerjoular/DEBIAN/control | ||
Package: powerjoular | ||
Version: $VERSION | ||
Maintainer: Adel Noureddine | ||
Architecture: $DEB_ARCH | ||
Description: PowerJoular allows monitoring power consumption of multiple platforms and processes. | ||
EOL | ||
|
||
cd $DEB_ARCH | ||
|
||
# Creating a .deb package | ||
dpkg-deb --build powerjoular | ||
mv powerjoular.deb ../../packages/powerjoular_${VERSION}_${DEB_ARCH}.deb | ||
|
||
cd .. | ||
done | ||
|
||
# Remove temp folder | ||
cd .. | ||
rm -rf deb-temp | ||
|
||
|
||
# Create rpm packages | ||
|
||
RPM_ARCHITECTURES=("x86_64" "arm64") | ||
|
||
# Create rpm temporary folder | ||
mkdir -p rpm-temp | ||
cd rpm-temp | ||
|
||
for RPM_ARCH in "${RPM_ARCHITECTURES[@]}" | ||
do | ||
# Create a new directory structure for architecture | ||
rm -rf $RPM_ARCH | ||
mkdir -p $RPM_ARCH | ||
|
||
|
||
|
||
# Prepare the RPM build environment | ||
mkdir -p $RPM_ARCH/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | ||
cp ../installer/powerjoular.spec $RPM_ARCH/rpmbuild/SPECS/ | ||
|
||
# Copy the sources accordingly | ||
|
||
if [[ $RPM_ARCH = "x86_64" ]] | ||
then | ||
cp ../binary/x86_64-linux-gnu/powerjoular $RPM_ARCH/rpmbuild/SOURCES/ | ||
elif [[ $RPM_ARCH = "arm64" ]] | ||
then | ||
cp ../binary/aarch64-linux-gnu/powerjoular $RPM_ARCH/rpmbuild/SOURCES/ | ||
fi | ||
|
||
cp ../systemd/powerjoular.service $RPM_ARCH/rpmbuild/SOURCES/ | ||
|
||
# Build the RPM package | ||
cd $RPM_ARCH | ||
rpmbuild -ba rpmbuild/SPECS/powerjoular.spec --define "_topdir $(pwd)/rpmbuild" --target $RPM_ARCH | ||
|
||
# Move the created RPM to packages | ||
find rpmbuild/RPMS/ -name '*.rpm' -exec mv {} ../../packages/ \; | ||
cd .. | ||
done | ||
|
||
# Remove temp folder | ||
cd .. | ||
rm -rf rpm-temp |
Oops, something went wrong.