akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.72k stars 86 forks source link

automake support? #274

Closed ChrTall closed 1 year ago

ChrTall commented 1 year ago

I am trying to package ble.sh as a rpm package, but when I specify %make_install INSDIR=/usr/local/bin during %install I get an permission error. Normally I just use %{configure} during build and it is not required to specify any directory during make_install. Can somebody point me to the right direction?

akinomyoga commented 1 year ago

Have you checked the last item of Quick Instruction in README (the item is folded, so you need to unfold it)? PREFIX is supposed to be specified instead of INSDIR. INSDIR overwrites the combination of DESTDIR & PREFIX. I haven't tried it, but could you try this?

%make_install PREFIX=/usr/local

Edit: The install prefix should be /usr/local but not /usr/local/bin. I have fixed it.

ChrTall commented 1 year ago

When I change to PREFIX it basically has no install targets at all. RPM is happy when I provide only %license and %doc. Normally it should complain about files that are not packaged but installed in the buildroot.

ChrTall commented 1 year ago

This is my current spec file:

#
# spec file for package blesh
#
# Copyright (c) 2023 SUSE LLC
#
# 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.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           blesh
Version:        0.3.3
Release:        0
Summary:        A command line editor written in Bash which replaces GNU Readline
License:        BSD-3-Clause
URL:            https://github.com/akinomyoga/ble.sh
Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz
BuildRequires:  make
BuildRequires:  gcc
Requires:       bash
BuildArch:      noarch

%description
Bash Line Editor (ble.sh) is a command line editor written in pure Bash which replaces the default GNU Readline.

%prep
%autosetup -n ble.sh-%{version}

%build
make %{?_smp_mflags}

%install
%make_install PREFIX=/usr/local

%files
%license LICENSE.md
%doc README.md

%changelog
akinomyoga commented 1 year ago

Ah, OK. So you are using 0.3.3. 0.3.3 doesn't support it. Can you use 0.4.0-devel2?

akinomyoga commented 1 year ago
Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz

This link doesn't work (for both 0.3.3 and 0.4.0-devel). This link is automatically generated by GitHub, but its content is incomplete. If you like to build ble.sh from the source, you need to clone the git repository.

Basically, you do not need to build it from source code but can just use the pre-built archive provided on top of the release page. The resulting ble.sh is purely a set of shell scripts, so it works in every environment (as you set BuildArch: noarch).

BuildRequires:  make
BuildRequires:  gcc

gcc isn't needed to build ble.sh.

ChrTall commented 1 year ago

Ah okay, thank you for the information. I will try to package the bash files then instead.

akinomyoga commented 1 year ago

I have added some descriptions in README. (To see it, search "Create a package of ble.sh" in README and open the item)

akinomyoga commented 1 year ago

@ChrTall Have you solved your issue? Can I close the issue?