-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# | ||
# spec file for newflasher | ||
# | ||
# Copyright (c) 2022 Mikel Pérez ([email protected]) | ||
# | ||
# All modifications and additions to the file contributed by third parties | ||
# remain the property of their copyright owners, unless otherwise agreed | ||
# upon. The license for this file, and modifications and additions to the | ||
# file, is the same license as for the pristine package itself (unless the | ||
# license for the pristine package is not an Open Source License, in which | ||
# case the license is the MIT License). An "Open Source License" is a | ||
# license that conforms to the Open Source Definition (Version 1.9) | ||
# published by the Open Source Initiative. | ||
|
||
|
||
%define pkg_version 52 | ||
Name: newflasher | ||
Version: %{pkg_version} | ||
Release: 1 | ||
Summary: Flash Sony Xperia firmwares for XZ Premium phones and later. | ||
License: MIT | ||
URL: https://github.com/munjeni/newflasher | ||
Source0: https://github.com/munjeni/newflasher/archive/refs/tags/%{pkg_version}.tar.gz | ||
BuildRequires: gcc | ||
BuildRequires: pkgconfig(expat) | ||
BuildRequires: pkgconfig(zlib) | ||
Requires: (libexpat.so.1()(64bit) or libexpat.so.1) | ||
Requires: zlib | ||
|
||
%description | ||
This _experimental_ software allows you to flash firmwares acquired | ||
through XperiFirm to Sony phones from the XZ Premium and newer. | ||
|
||
%prep | ||
%setup -q | ||
|
||
%build | ||
make CFLAGS="%{optflags}" %{?_smp_mflags} | ||
make newflasher.1.gz | ||
|
||
%install | ||
# the make install target wants to use real root privileges | ||
# so can't use the %%make_install macro | ||
mkdir -p %{buildroot}/usr/bin/ | ||
install -m 755 newflasher %{buildroot}/usr/bin/newflasher | ||
mkdir -p %{buildroot}/usr/share/man/man1 | ||
install -m 644 newflasher.1.gz %{buildroot}/usr/share/man/man1 | ||
|
||
%files | ||
%defattr(-,root,root) | ||
%doc readme.md | ||
%{_bindir}/%{name} | ||
%{_mandir}/*/* | ||
|
||
%changelog |
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace pkg_version on the fly by reading version.h header?
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooof idk lemme check
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe the expr or lua macros could help here https://rpm-software-management.github.io/rpm/manual/macros.html
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or turning this into a
newflasher.spec.in
and adding a makefile rule that makes anewflasher.spec
from it and appropriately replaces with the value fromversion.h
.7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less complication better! Maybe pickup directly trough "latest" somehow? Or maybe trought .in from makefile is better idea
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't be able to set the version for pushing upgrades (and showing the user in the package manager and UI).
.in
is probably the right solution here7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened a pull request that does so over at #56
7302a3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I'm merged it!