Rewrite install commands for project restructure to bash

This commit is contained in:
Eric Torres 2022-10-01 13:01:31 -07:00
parent b18cff3ee5
commit 4d29aced79
4 changed files with 13 additions and 41 deletions

View File

@ -1,14 +1,12 @@
# Maintainer: Eric Torres <erictorres4@protonmail.com> # Maintainer: Eric Torres <erictorres4@protonmail.com>
pkgname=file-scripts pkgname=file-scripts
pkgver=1.2.0 pkgver=2.0.0
pkgrel=1 pkgrel=1
pkgdesc="Various scripts for performing file-related operations such as editing and deleting." pkgdesc="Various scripts for performing file-related operations such as editing and deleting."
arch=(any) arch=(any)
license=(GPL3) license=(GPL3)
depends=(bash fd fzf mlocate python python-termcolor) depends=(bash fd fzf)
makedepends=(git) makedepends=(git)
makedepends=(git python-setuptools python-sphinx)
checkdepends=(python-hypothesis python-pytest)
source=("${pkgname}::git+file:///home/etorres/Projects/file-scripts") source=("${pkgname}::git+file:///home/etorres/Projects/file-scripts")
install=$pkgname.install install=$pkgname.install
sha256sums=('SKIP') sha256sums=('SKIP')
@ -16,12 +14,8 @@ sha256sums=('SKIP')
package() { package() {
cd "${srcdir}/${pkgname}" cd "${srcdir}/${pkgname}"
for script in bash/bin/*; do for script in bin/*; do
install -Dm755 "$script" "$pkgdir/usr/bin/$(basename -s '.sh' "$script")" install -Dm755 "$script" "$pkgdir/usr/bin/$(basename "$script")"
done
for libfile in bash/*.sh; do
install -Dm644 "$libfile" "$pkgdir/usr/share/file-scripts/$(basename "$libfile")"
done done
# Install zsh completions # Install zsh completions
@ -29,7 +23,3 @@ package() {
install -Dm644 "${completion}" "${pkgdir}/usr/share/zsh/site-functions/$(basename "$completion")" install -Dm644 "${completion}" "${pkgdir}/usr/share/zsh/site-functions/$(basename "$completion")"
done done
} }
#check() {
# pytest
#}

View File

@ -2,16 +2,15 @@ class FileScripts < Formula
desc "Various scripts for performing file-related operations" desc "Various scripts for performing file-related operations"
homepage "https://github.com/etorres4/file-scripts" homepage "https://github.com/etorres4/file-scripts"
url "https://github.com/etorres4/file-scripts", :using => :git url "https://github.com/etorres4/file-scripts", :using => :git
version "1.2.0" version "2.0.0"
sha256 "fad7da96c72c8bef81f3ec6a2d1cb13b09fb44e084f98b05ba3a7dfd8b41ae12" sha256 "fad7da96c72c8bef81f3ec6a2d1cb13b09fb44e084f98b05ba3a7dfd8b41ae12"
depends_on "fd" depends_on "fd"
depends_on "fzf" depends_on "fzf"
#depends_on "python@3.10"
def install def install
system Formula["python@3.10"].opt_bin/"python3", *Language::Python.setup_install_args(prefix) # Install scripts to system
system bin.install Dir["bin/*"]
# Install completions to zsh/site-functions # Install completions to zsh/site-functions
zsh_completion.install Dir["zsh/_*"] zsh_completion.install Dir["zsh/_*"]

View File

@ -17,25 +17,16 @@
Name: file-scripts Name: file-scripts
Version: 1.2.0 Version: 2.0.0
Release: 0 Release: 0
Summary: Set of scripts for manipulating files Summary: Set of scripts for manipulating files
License: GPL-3.0-only License: GPL-3.0-only
Group: Productivity/File utilities Group: Productivity/File utilities
URL: https://github.com/etorres4/file-scripts URL: https://github.com/etorres4/file-scripts
Source: %{name}-%{version}.tar.gz Source: %{name}-%{version}.tar.gz
BuildRequires: python3 >= 3.7 Requires: /usr/bin/bash
BuildRequires: python3-hypothesis
BuildRequires: python3-setuptools
BuildRequires: python3-Sphinx
BuildRequires: python3-pytest
BuildRequires: fdupes
Requires: python3 >= 3.7
Requires: fd Requires: fd
Requires: fzf Requires: fzf
Requires: mlocate
Requires: python3-termcolor
Supplements: zsh
BuildArch: noarch BuildArch: noarch
%description %description
@ -52,11 +43,10 @@ Plugins and completions for helper scripts.
%prep %prep
%setup -q %setup -q
%build
%{python3_build}
%install %install
%{python3_install} for script in bin/*; do
install -Dm755 "$script" "%{buildroot}/usr/bin/$(basename script)"
done
# Install zsh completion functions # Install zsh completion functions
ZSHCOMPLETIONDIR="%{buildroot}%{_datadir}/zsh/site-functions" ZSHCOMPLETIONDIR="%{buildroot}%{_datadir}/zsh/site-functions"
@ -66,15 +56,8 @@ for completion in zsh/*; do
install -Dm644 "${completion}" "${ZSHCOMPLETIONDIR}/${completion##*.}" install -Dm644 "${completion}" "${ZSHCOMPLETIONDIR}/${completion##*.}"
done done
%fdupes %{buildroot}/%{_prefix}
%check
pytest
#%%files %%{python_files} (bug)
%files %files
%attr(0755,-,-) %{_bindir}/* %attr(0755,-,-) %{_bindir}/*
/usr/lib/python3*/*
%files zsh-plugins %files zsh-plugins
%{_datadir}/zsh/ %{_datadir}/zsh/

View File

@ -15,7 +15,7 @@ with open("README", "r") as fh:
# ========== Package Setup ========== # ========== Package Setup ==========
setuptools.setup( setuptools.setup(
name="file_scripts", name="file_scripts",
version="1.2.0", version="2.0.0",
author="Eric Torres", author="Eric Torres",
author_email="erictorres4@protonmail.com", author_email="erictorres4@protonmail.com",
description="File-related helper scripts", description="File-related helper scripts",