Add packaging files

This commit is contained in:
Eric Torres 2021-12-20 09:16:56 -08:00
parent 3fb8cae288
commit b2ddc57086
3 changed files with 141 additions and 0 deletions

43
PKGBUILD Normal file
View File

@ -0,0 +1,43 @@
# Maintainer: Eric Torres <erictorres4@protonmail.com>
pkgname=file-scripts
pkgver=0.9.0
pkgrel=0
pkgdesc="Various scripts for performing file-related operations such as editing and deleting."
arch=(any)
license=(GPL3)
depends=(fd fzf python)
makedepends=(git)
source=("${pkgname}::git+file:///home/etorres/Projects/file-scripts")
sha256sums=('SKIP')
sha512sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname}"
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
package() {
cd "${srcdir}/${pkgname}"
install -dm755 "${pkgdir}"/usr/{bin,share/zsh/{plugins/helper-scripts,site-functions}}
for script in *.{py,sh}; do
install -m755 "${script}" "${pkgdir}/usr/bin/${script%.*}"
done
## Install /etc/config files
#install -dm755 "${pkgdir}/etc/helper-scripts"
#for config in config/*; do
# install -m644 "${config}" "${pkgdir}/etc/helper-scripts/${config##*/}"
#done
## Install zsh completions
#for completion in zsh/completions/*; do
# install -m644 "${completion}" "${pkgdir}/usr/share/zsh/site-functions/${plugin##*.}"
#done
## Install zsh plugins
#for plugin in zsh/plugins/*; do
# install -m644 "${plugin}" "${pkgdir}/usr/share/zsh/plugins/helper-scripts/${plugin##*/}"
#done
}

21
file-scripts.rb Normal file
View File

@ -0,0 +1,21 @@
class HelperScripts < Formula
desc "Various scripts for performing file-related operations such as editing and deleting"
homepage "https://github.com/etorres4/helper-scripts"
url "https://github.com/etorres4/file-scripts",
:using => :git
sha256 "7b6c3f363e3b34787765b5975d87f861a19eeda278612cbf8c5176e3e2732cd9"
version "0.9"
# No build dependencies
bottle :unneeded
def install
#bin.install "ddusb.py" => "ddusb"
#bin.install "fless.sh" => "fless"
#bin.install "lsgroups.sh" => "lsgroups"
#bin.install "lsusers.sh" => "lsusers"
# Install completions to zsh/site-functions
zsh_completion.install Dir["zsh/completions/_*"]
end
end

77
file-scripts.spec Normal file
View File

@ -0,0 +1,77 @@
#
# spec file for package file-scripts
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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: file-scripts
Version: 0.9
Release: 0
Summary: Eric's helper scripts
License: GPL-3.0-only
Group: Productivity/File utilities
Source: %{name}-%{version}.tar.gz
Requires: %{_bindir}/python3
Requires:: fd
Recommends: fzf
Supplements: bash
Supplements: zsh
BuildArch: noarch
%description
A collection of various helper scripts and some shell completions to speed up terminal workflow.
%package zsh-plugins
Summary: zsh addons for helper scripts
Requires: %{name} = %{version}
Requires: /bin/zsh
%description zsh-plugins
Plugins and completions for helper scripts.
%prep
%setup -q
%build
%install
# Install scripts in /usr/bin first
SCRIPTDIR='%{buildroot}%{_bindir}'
for script in *.{py,sh}; do
install -Dm755 "${script}" "${SCRIPTDIR}/${script%.*}"
done
# Install zsh plugins
ZSHPLUGINDIR='%{buildroot}%{_datadir}/zsh/plugins/helper-scripts'
mkdir -p "${ZSHPLUGINDIR}"
cp zsh/plugins/* "${ZSHPLUGINDIR}"
# Install zsh completion functions
ZSHCOMPLETIONDIR="%{buildroot}%{_datadir}/zsh/site-functions"
mkdir -p "${ZSHCOMPLETIONDIR}"
cp zsh/completions/* "${ZSHCOMPLETIONDIR}"
%check
%files
%attr(0755,-,-) %{_bindir}/*
%files zsh-plugins
%{_datadir}/zsh/plugins/helper-scripts/*
%{_datadir}/zsh/site-functions/*
%changelog