Skip to content

Commit

Permalink
Make RPM spec file (#10)
Browse files Browse the repository at this point in the history
* Try link to OpenBuildService try 12
* Try link to OpenBuildService try 13
* Try link to OpenBuildService try 14
* Try link to OpenBuildService try 15
* Try link to OpenBuildService try 16
* Try link to OpenBuildService try 17
* Try link to OpenBuildService try 18
* Try link to OpenBuildService try 19
* Try link to OpenBuildService try 20
* Try link to OpenBuildService try 21
* Try link to OpenBuildService try 22
* Try link to OpenBuildService try 23
* Make a normal appearance for RPM spec
* Fix versioning
* Add Provides: ytcon
* Looks like specifying python3 is bad idea
* Add missing depency
* Delete not needed depency
* Try to build package only for main python version
* Try to build package only for main python version 2
* Try to specify RPM in INSTALLER package metadata
* Try to specify RPM in INSTALLER package metadata 2
* Try to specify RPM in package metadata №3
* Try to specify RPM in package metadata №4
* Try to remove pycache
* Try to remove pycache №2
* Clean trash
* Create _service
  • Loading branch information
NikitaBeloglazov authored Sep 8, 2024
1 parent c438ca8 commit 218eefd
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .obs/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Just copy of _service file from OBS -->
<!-- https://build.opensuse.org/projects/home:NikitaBeloglazov/packages/ytcon/files/_service?expand=1 -->
<services>
<service name="tar_scm">
<param name="url">https://github.com/NikitaBeloglazov/ytcon</param>
<param name="scm">git</param>
<param name="revision">main</param>
<param name="filename">ytcon</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="package-meta">yes</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/*.spec</param>
</service>
<service name="set_version"/>
</services>
48 changes: 41 additions & 7 deletions ytcon.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# TEST SPEC PLEASE DON'T LOOK INTO IT
# * - = - = - =
# * spec file for package YTCON
# * - = - = - =
# * Copyright (C) 2023-2024 Nikita Beloglazov <[email protected]>
# *
# * This file is part of github.com/NikitaBeloglazov/ytcon.
# *
# * NikitaBeloglazov/ytcon is free software; you can redistribute it and/or
# * modify it under the terms of the Mozilla Public License 2.0
# * published by the Mozilla Foundation.
# *
# * NikitaBeloglazov/ytcon is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY.
# *
# * You should have received a copy of the Mozilla Public License 2.0
# * along with NikitaBeloglazov/ytcon
# * If not, see https://mozilla.org/en-US/MPL/2.0.
# * - = - = - =
# * Please submit bugfixes or comments via https://github.com/NikitaBeloglazov/ytcon/issues
# * - = - = - =

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define pythons python3
Name: ytcon
# Version sets dynamically by _service
Version: 0.0.0
Release: 0
Summary: yt-dlp pseudo-graphical console interface (TUI)
Expand All @@ -11,28 +31,42 @@ Source0: %{name}-%{version}.tar
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: git

Requires: python3
Requires: python3-requests
Requires: python3-tqdm
Requires: python3-urwid
Requires: python3-clipman
Requires: python3-ffmpeg-python
Requires: ffmpeg
Requires: python3-yt-dlp

BuildArch: noarch
%python_subpackages

%description
yt-dlp pseudo-graphical console interface (TUI)
yt-dlp pseudo-graphical console interface (TUI). More at https://github.com/NikitaBeloglazov/ytcon

%prep
echo "DEBUG - PREP RUNNING"
%autosetup -p1 -n ytcon-%{version}
# This is needed for the auto-update system, so that ytcon will know that this is an RPM and will refuse to auto-update.
export SOURCE_FILE_TEXT="__source__ = source = 'rpm'" # Because escaping quotes doesn't seem to work in RPM spec
bash -c 'echo $SOURCE_FILE_TEXT > src/ytcon/__source__.py'

%build
echo "DEBUG - BUILD RUNNING"
export SETUPTOOLS_SCM_PRETEND_VERSION="v%{version}"
%pyproject_wheel

%install
echo "DEBUG - INSTALL RUNNING"
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}
%files
%{_bindir}/ytcon
%{python_sitelib}/ytcon
%{python_sitelib}/ytcon-%{version}.dist-info

Expand Down

0 comments on commit 218eefd

Please sign in to comment.