Skip to content

Commit d44f923

Browse files
committed
package_name in config
1 parent bf6e807 commit d44f923

19 files changed

+40
-57
lines changed

.omnipackage/config.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ extract_version:
44
file: 'lib/omnipackage_agent/version.rb'
55
regex: "VERSION = '(.+)'"
66

7+
common: &common
8+
package_name: 'omnipackage-agent'
9+
maintainer: 'Oleg Antonyan <[email protected]>'
10+
homepage: https://omnipackage.org/
11+
description: OmniPackage agent for both standalone and client-server modes
12+
713
rpm: &rpm
8-
installable_package_name: 'omnipackage-agent'
14+
<<: *common
915
build_dependencies: []
1016
runtime_dependencies: ['ruby', 'tar', 'xz', '(docker or podman)']
1117
rpm:
1218
spec_template: '.omnipackage/specfile.spec.liquid'
1319

1420
deb: &deb
15-
installable_package_name: 'omnipackage-agent'
21+
<<: *common
1622
build_dependencies: []
1723
runtime_dependencies: ['ruby', 'tar', 'xz-utils', 'docker | podman']
1824
deb:

.omnipackage/deb/changelog.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
omnipackage-agent ({{ version }}-0) stable; urgency=low
1+
{{ package_name }} ({{ version }}-0) stable; urgency=low
22

33
* Release {{ version }}
44

5-
-- Oleg Antonyan <oleg@omnipackage.org> {{ current_time_rfc2822 }}
5+
-- {{ maintainer }} {{ current_time_rfc2822 }}

.omnipackage/deb/control.liquid

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Source: omnipackage-agent
1+
Source: {{ package_name }}
22
Section: devel
33
Priority: optional
4-
Maintainer: Oleg Antonyan <oleg@omnipackage.org>
4+
Maintainer: {{ maintainer }}
55
Build-Depends: debhelper (>= 8.0.0), {{ build_dependencies | join: ', ' }}
66
Standards-Version: 3.9.4
7-
Homepage: https://omnipackage.org
7+
Homepage: {{ homepage }}
88

9-
Package: omnipackage-agent
9+
Package: {{ package_name }}
1010
Architecture: all
1111
Depends: ${shlibs:Depends}, ${misc:Depends}, {{ runtime_dependencies | join: ', ' }}
12-
Description: OmniPackage agent for both standalone and client-server modes
12+
Description: {{ description }}

.omnipackage/deb/dsc.dsc.liquid

Lines changed: 0 additions & 9 deletions
This file was deleted.

.omnipackage/deb/rules.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Be carefull, this is a Makefile, so the indents are tabs and not spaces!
44
# -*- makefile -*-
55

6-
export DESTROOT=$(CURDIR)/debian/omnipackage-agent
6+
export DESTROOT=$(CURDIR)/debian/{{ package_name }}
77
# export DH_VERBOSE=1
88

99
%:

.omnipackage/specfile.spec.liquid

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Name: omnipackage-agent
1+
Name: {{ package_name }}
22
Version: {{ version }}
33
Release: 1%{?dist}
4-
Summary: OmniPackage agent for both standalone and client-server modes
4+
Summary: {{ description }}
55
License: MIT
66
URL: https://omnipackage.org/
77
Source0: {{ source_folder_name }}.tar.gz
@@ -12,7 +12,7 @@ Requires: {{ runtime_dependencies | join: ', ' }}
1212
%define _build_id_links none
1313

1414
%description
15-
OmniPackage agent for both standalone and client-server modes
15+
{{ descroption }}
1616

1717

1818
%prep

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require:
1+
plugins:
22
- rubocop-rake
33
- rubocop-minitest
44

lib/omnipackage_agent/build/base_package.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def build_deps
2828
def artefacts
2929
end
3030

31+
def name
32+
build_conf.fetch(:package_name)
33+
end
34+
3135
def before_build_script(relative_to = source_path)
3236
bbs = build_conf[:before_build_script]
3337
return unless bbs

lib/omnipackage_agent/build/deb/debian_folder.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ def initialize(debian_folder_path)
1717
@debian_folder_path = debian_folder_path
1818
end
1919

20-
def name
21-
file = if ::File.exist?(mkpath_rel("control#{template_ext}"))
22-
::File.read(mkpath_rel("control#{template_ext}"))
23-
elsif ::File.exist?(mkpath_rel('control'))
24-
::File.read(mkpath_rel('control'))
25-
else
26-
raise "no control file in #{debian_folder_path}"
27-
end
28-
29-
/[Ss]ource:(.+)/.match(file)[1].strip
30-
end
31-
3220
def render(params_hash) # rubocop: disable Metrics/AbcSize
3321
::Dir.foreach(debian_folder_path).each_with_object({}) do |fname, result_hash|
3422
next if ['.', '..'].include?(fname)

lib/omnipackage_agent/build/deb/package.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def artefacts
2020
def setup # rubocop: disable Metrics/MethodLength, Metrics/AbcSize
2121
debian_folder_template_path = build_conf.fetch(:deb).fetch(:debian_templates)
2222
debian_folder = ::OmnipackageAgent::Build::Deb::DebianFolder.new(::OmnipackageAgent::Utils::Path.mkpath(source_path, debian_folder_template_path))
23-
build_folder_name = "#{debian_folder.name}-#{distro.name}"
23+
build_folder_name = "#{name}-#{distro.name}"
2424

2525
build_path = ::OmnipackageAgent::Utils::Path.mkpath(build_dir, build_folder_name, 'build')
2626
@output_path = ::OmnipackageAgent::Utils::Path.mkpath(build_dir, build_folder_name, 'output')

lib/omnipackage_agent/build/logfile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Logfile
88
attr_reader :file, :path
99

1010
def initialize(path)
11-
::FileUtils.rm(path) if ::File.exist?(path)
11+
::FileUtils.rm_f(path)
1212
@path = path
1313
@file = ::File.open(path, 'a+')
1414
at_exit { close }

lib/omnipackage_agent/build/rpm/package.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ def setup # rubocop: disable Metrics/MethodLength, Metrics/AbcSize
2121
specfile_path_template_path = build_conf.fetch(:rpm).fetch(:spec_template)
2222

2323
specfile = ::OmnipackageAgent::Build::Rpm::Specfile.new(::OmnipackageAgent::Utils::Path.mkpath(source_path, specfile_path_template_path))
24-
rpmbuild_folder_name = "#{specfile.name}-#{distro.name}"
24+
rpmbuild_folder_name = "#{name}-#{distro.name}"
2525
rpmbuild_path = ::OmnipackageAgent::Utils::Path.mkpath(build_dir, rpmbuild_folder_name)
2626
::FileUtils.mkdir_p(rpmbuild_path)
2727
@output_path = rpmbuild_path
2828

29-
source_folder_name = "#{specfile.name}-#{version}"
29+
source_folder_name = "#{name}-#{version}"
3030
specfile_name = "#{source_folder_name}-#{distro.name}.spec"
3131

3232
template_params = build_conf.merge(job_variables).merge(source_folder_name: source_folder_name)

lib/omnipackage_agent/build/rpm/specfile.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ module OmnipackageAgent
66
class Build
77
module Rpm
88
class Specfile < ::OmnipackageAgent::Utils::Template
9-
def name
10-
/[Nn]ame:(.+)/.match(template)[1].strip
11-
end
129
end
1310
end
1411
end

test/sample_project/.omnipackage/config.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ extract_version:
55
regex: 'VERSION "(.+)"'
66

77
rpm: &rpm
8-
installable_package_name: 'sample_project'
8+
package_name: 'sample_project'
99
build_dependencies: ['gcc', 'make']
1010
rpm:
1111
spec_template: '.omnipackage/sample_project.spec.liquid'
1212

1313
deb: &deb
14-
installable_package_name: 'sample-project'
14+
package_name: 'sample-project'
1515
build_dependencies: ['build-essential']
1616
deb:
1717
debian_templates: '.omnipackage/deb'
@@ -41,6 +41,9 @@ builds:
4141
- distro: 'fedora_40'
4242
<<: *rpm
4343

44+
- distro: 'fedora_41'
45+
<<: *rpm
46+
4447
- distro: 'fedora_rawhide'
4548
<<: *rpm
4649

@@ -65,12 +68,6 @@ builds:
6568
- distro: 'ubuntu_22.04'
6669
<<: *deb
6770

68-
- distro: 'ubuntu_23.10'
69-
<<: *deb
70-
71-
- distro: 'ubuntu_23.04'
72-
<<: *deb
73-
7471
- distro: 'ubuntu_24.04'
7572
<<: *deb
7673

test/sample_project/.omnipackage/deb/changelog.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sample-project ({{ version }}-0) stable; urgency=low
1+
{{ package_name }} ({{ version }}-0) stable; urgency=low
22

33
* Release {{ version }}
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Source: sample-project
1+
Source: {{ package_name }}
22
Section: sound
33
Priority: optional
44
Maintainer: Chuck Norris <chuck@norr.is>
55
Build-Depends: debhelper (>= 8.0.0), {{ build_dependencies | join: ', ' }}
66
Standards-Version: 3.9.4
77
Homepage: http://example.com
88

9-
Package: sample-project
9+
Package: {{ package_name }}
1010
Architecture: amd64
1111
Depends: ${shlibs:Depends}, ${misc:Depends}, {{ runtime_dependencies | join: ', ' }}
1212
Description: Sample project

test/sample_project/.omnipackage/deb/rules.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Be carefull, this is a Makefile, so the indents are tabs and not spaces!
44
# -*- makefile -*-
55

6-
export DESTROOT=$(CURDIR)/debian/sample-project
6+
export DESTROOT=$(CURDIR)/debian/{{ package_name }}
77
export DH_VERBOSE=1
88

99
%:

test/sample_project/.omnipackage/deb/sample_project.dsc.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Format: 1.0
2-
Source: sample-project
2+
Source: {{ package_name }}
33
Version: {{ version }}-0
4-
Binary: sample_project
4+
Binary: {{ package_name }}
55
Maintainer: Chuck Norris <chuck@norr.is>
66
Architecture: amd64
77
Homepage: http://example.com

test/sample_project/.omnipackage/sample_project.spec.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Name: sample_project
1+
Name: {{ package_name }}
22
Version: {{ version }}
33
Release: 1%{?dist}
44
Summary: Sample project

0 commit comments

Comments
 (0)