Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions doc/RPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,38 @@

`hrmp` can be built into a RPM for [Fedora](https://getfedora.org/) systems.

## Requirements

```sh
dnf install gcc rpm-build rpm-devel rpmlint make python bash coreutils diffutils patch rpmdevtools chrpath
```

## Setup RPM development

```sh
sudo dnf install rpmdevtools
rpmdev-setuptree
```

## Create source package
## Get the source tree

```sh
git clone https://github.com/HighResMusicPlayer/hrmp.git
cd hrmp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make package_source
```

## Create RPM package
## Install build requirements

```sh
sudo dnf builddep hrmp.spec
```

## Create the source archive

```sh
VERSION=0.14.0 # Should match one in hrmp.spec.
TAG=HEAD # You can also use any real tag or sha.
git archive --format=tar.gz --prefix=hrmp-$VERSION/ $TAG >~/rpmbuild/SOURCES/hrmp-$VERSION.tar.gz
```

## Create RPM packages

```sh
cp hrmp-$VERSION.tar.gz ~/rpmbuild/SOURCES
QA_RPATHS=0x0001 rpmbuild -bb hrmp.spec
rpmbuild -ba hrmp.spec
```

The resulting RPM will be located in `~/rpmbuild/RPMS/x86_64/`, if your architecture is `x86_64`.
The resulting RPMs will be located in `~/rpmbuild/RPMS/x86_64/`, if your architecture is `x86_64`.
7 changes: 3 additions & 4 deletions hrmp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ URL: https://github.com/HighResMusicPlayer/hrmp
Source0: https://github.com/HighResMusicPlayer/hrmp/releases/download/%{version}/hrmp-%{version}.tar.gz

BuildRequires: gcc cmake make python3-docutils alsa-lib alsa-lib-devel libsndfile libsndfile-devel opus-devel faad2-devel gtk3-devel ncurses-libs ncurses-devel
Requires: alsa-lib libsndfile opus faad2 gtk3 ncurses-labs
Requires: alsa-lib libsndfile opus faad2 gtk3 ncurses-libs

%description
hrmp is a high resolution music player.
Expand All @@ -19,7 +19,7 @@ hrmp is a high resolution music player.

%{__mkdir} build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=true ..
%{__make}

%install
Expand All @@ -32,6 +32,7 @@ cmake -DCMAKE_BUILD_TYPE=Release ..
%{__mkdir} -p %{buildroot}%{_datadir}/applications
%{__mkdir} -p %{buildroot}%{_datadir}/icons/hicolor
%{__mkdir} -p %{buildroot}%{_sysconfdir}/hrmp
%{__mkdir} -p %{buildroot}%{_docdir}/%{name}

%{__install} -m 644 %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}%{_docdir}/%{name}/LICENSE
%{__install} -m 644 %{_builddir}/%{name}-%{version}/CODE_OF_CONDUCT.md %{buildroot}%{_docdir}/%{name}/CODE_OF_CONDUCT.md
Expand Down Expand Up @@ -60,8 +61,6 @@ done

%{__install} -m 755 %{_builddir}/%{name}-%{version}/build/src/libhrmp.so.%{version} %{buildroot}%{_libdir}/libhrmp.so.%{version}

chrpath -r %{_libdir} %{buildroot}%{_bindir}/hrmp

cd %{buildroot}%{_libdir}/
%{__ln_s} -f libhrmp.so.%{version} libhrmp.so.0
%{__ln_s} -f libhrmp.so.0 libhrmp.so
Expand Down
Loading