summaryrefslogtreecommitdiff
path: root/pcr/initify
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-01-27 00:14:58 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2022-01-27 03:08:04 -0500
commita3883a71ac303662083c472ac46302bea264f5e7 (patch)
tree8ab84f30f1fe3509013ec75aa4c532248dbcd5f8 /pcr/initify
parent7c2a761eaa4c5331c8d9b8c3a2a89248b9e4189f (diff)
downloadabslibre-a3883a71ac303662083c472ac46302bea264f5e7.tar.gz
abslibre-a3883a71ac303662083c472ac46302bea264f5e7.tar.bz2
abslibre-a3883a71ac303662083c472ac46302bea264f5e7.zip
[initify]: add pkg
Diffstat (limited to 'pcr/initify')
-rw-r--r--pcr/initify/PKGBUILD43
-rw-r--r--pcr/initify/trim_path_from_service_name.patch13
-rw-r--r--pcr/initify/validate_args.patch16
3 files changed, 72 insertions, 0 deletions
diff --git a/pcr/initify/PKGBUILD b/pcr/initify/PKGBUILD
new file mode 100644
index 000000000..9911bb15a
--- /dev/null
+++ b/pcr/initify/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer (aur): TBK <aur at jjtc dot eu>
+# Contributor: bill-auger <bill-auger@programmer.net>
+
+
+pkgname=initify
+_gitver=f9ccbb147924a2371a1ae5a925c1be6858cca5fa
+pkgver=0.0.0.pre.${_gitver:0:7}
+pkgrel=1
+pkgdesc="Convert systemd services to OpenRC init-scripts"
+arch=(any)
+url=https://github.com/goose121/initify/
+license=(custom:MIT)
+
+makedepends=(git)
+depends=(perl)
+source=(${pkgname}-${pkgver}.tar.gz::https://github.com/goose121/${pkgname}/archive/${_gitver}.tar.gz)
+source+=(trim_path_from_service_name.patch
+ validate_args.patch)
+sha256sums=('24709e6f243247a83826b662d6e8431eca223ef5aaccf75a09d5dbf7dde81539')
+sha256sums+=('3ec2d0a9c582c80d708a36bdf35b40f024d8f676d4fbca05e2274a22f1f42f4b'
+ '77b06164a52846adfd48d314a18b3aadf10373cc5c6040f97e65b20538d0150d')
+
+
+prepare()
+{
+ cd "${srcdir}"/${pkgname}-${_gitver}/
+
+ echo "applying trim_path_from_service_name.patch"
+ patch -p1 < "${srcdir}"/trim_path_from_service_name.patch
+
+ echo "applying validate_args.patch"
+ patch -p1 < "${srcdir}"/validate_args.patch
+}
+
+package()
+{
+ cd "${srcdir}"/${pkgname}-${_gitver}/
+
+ install -Dm755 cronify.pl "${pkgdir}"/usr/bin/cronify
+ install -Dm755 initify.pl "${pkgdir}"/usr/bin/initify
+ install -Dm644 README.md "${pkgdir}"/usr/share/doc/${pkgname}/README.md
+ install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/pcr/initify/trim_path_from_service_name.patch b/pcr/initify/trim_path_from_service_name.patch
new file mode 100644
index 000000000..dea81a249
--- /dev/null
+++ b/pcr/initify/trim_path_from_service_name.patch
@@ -0,0 +1,13 @@
+diff --git a/initify.pl b/initify.pl
+index 7cec3d2..3accde8 100755
+--- a/initify.pl
++++ b/initify.pl
+@@ -14,7 +14,7 @@ my @cmds_start = ();
+ my @cmds_stop = ();
+ my $pidfile = "";
+ my $desc = "";
+-(my $service=$ARGV[0])=~s/\.service//;
++(my $service=$ARGV[0])=~s|(.*/)?([^/.]*)\.service|$2|;
+
+ my %opt;
+ GetOptions(\%opt,
diff --git a/pcr/initify/validate_args.patch b/pcr/initify/validate_args.patch
new file mode 100644
index 000000000..515bff05f
--- /dev/null
+++ b/pcr/initify/validate_args.patch
@@ -0,0 +1,16 @@
+diff --git a/initify.pl b/initify.pl
+index 7cec3d2..acbfad3 100755
+--- a/initify.pl
++++ b/initify.pl
+@@ -9,6 +9,11 @@ use feature "switch";
+ use Getopt::Long;
+ use Pod::Usage;
+
++unless (-e $ARGV[0]) {
++ print "can not find service file: '$ARGV[0]' - quitting\n";
++ exit;
++}
++
+ my $type = "simple";
+ my @cmds_start = ();
+ my @cmds_stop = ();