summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrnmst/Franco Masotti2016-10-24 14:13:22 +0200
committerfrnmst/Franco Masotti2016-10-24 14:13:22 +0200
commit66a33ab3bc830ca6f894896710e4f9aa87f43c96 (patch)
treec25c34be76cb351670360b6882f2c29eade14e91
parent00dbb734c3b3b55a81153eb41da66314662b2ecf (diff)
downloadaur-66a33ab3bc830ca6f894896710e4f9aa87f43c96.tar.gz
Updated to the new version.
-rw-r--r--.INSTALL34
-rw-r--r--.SRCINFO6
-rw-r--r--.install21
-rw-r--r--PKGBUILD31
-rwxr-xr-xremove_web_iface_deps.pl40
-rwxr-xr-xrun.sh31
-rw-r--r--swish-cplint.conf25
-rw-r--r--swish-cplint.service6
8 files changed, 60 insertions, 134 deletions
diff --git a/.INSTALL b/.INSTALL
deleted file mode 100644
index 91b329d8c053..000000000000
--- a/.INSTALL
+++ /dev/null
@@ -1,34 +0,0 @@
-startdir=
-
-post_install() {
- # Add swish user and group.
- getent group swish &>/dev/null || groupadd -r swish >/dev/null
- getent passwd swish &>/dev/null || useradd -m -d /home/swish \
--r -g swish swish >/dev/null
-
- # Add swish user to the rserve group. If this is not done, access to the
- # socket would be forbidden.
- gpasswd -a swish rserve >/dev/null
-
- # Copy the install script.
- install -D -m744 ${startdir}/install_web_iface_deps.pl /home/swish/install_web_iface_deps.pl
- chown swish:swish /home/swish/install_web_iface_deps.pl
-
- echo ""
- echo ""
- echo "You can start and enable \
-swish-cplint.service to run the server."
- echo ""
- echo ""
-}
-
-# Trivial remove.
-pre_remove() {
- echo ""
- echo ""
- echo "UNIMPLEMENTED"
- echo ""
- rm -rf /home/swish/lib
- echo ""
- echo ""
-}
diff --git a/.SRCINFO b/.SRCINFO
index 00f9b2ae76e0..23aff63df010 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
pkgbase = swish-cplint
pkgdesc = SWI-Prolog for SHaring: a SWI-Prolog web IDE integrated with the cplint suite
pkgver = r1673.4e5dd96
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/friguzzi/swish
- install = .INSTALL
+ install = .install
arch = x86_64
license = BSD
makedepends = git
@@ -12,7 +12,7 @@ pkgbase = swish-cplint
depends = swi-prolog-devel
depends = rserve-sandbox-docker
conflicts = swish
- source = git://github.com/friguzzi/swish#branch=master
+ source = git+https://github.com/friguzzi/swish#branch=master
md5sums = SKIP
pkgname = swish-cplint
diff --git a/.install b/.install
new file mode 100644
index 000000000000..98974d05a554
--- /dev/null
+++ b/.install
@@ -0,0 +1,21 @@
+post_install() {
+ # Add swish user and group with a home directory (which will contain all
+ # the packs).
+ getent group swish &>/dev/null || groupadd -r swish >/dev/null
+ getent passwd swish &>/dev/null || useradd -m -d /home/swish \
+-r -g swish swish >/dev/null
+
+ # Add swish user to the rserve group. If this is not done, access to the
+ # socket will be forbidden.
+ gpasswd -a swish rserve >/dev/null
+
+ chown -R swish:swish /usr/share/swish-cplint
+
+ printf "\n\nYou can start and enable \
+swish-cplint.service to run the server.\n\n"
+}
+
+post_remove() {
+ printf "\n\nYou can remove /home/swish.\n"
+ printf "You can also remove swish user and group.\n\n"
+}
diff --git a/PKGBUILD b/PKGBUILD
index 1b6ce979c93e..372882bc4873 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Franco Masotti <franco dot masotti at student dot unife dot it>
pkgname=swish-cplint
pkgver=r1673.4e5dd96
-pkgrel=1
+pkgrel=2
pkgdesc="SWI-Prolog for SHaring: a SWI-Prolog web IDE integrated with the cplint suite"
arch=('x86_64')
url="https://github.com/friguzzi/swish"
@@ -13,24 +13,18 @@ makedepends=('git'
'bower'
'sed')
conflicts=('swish')
-install=.INSTALL
-source=('git://github.com/friguzzi/swish#branch=master')
+install=.install
+source=('git+https://github.com/friguzzi/swish#branch=master')
md5sums=('SKIP')
-prepare() {
- # Edit the .INSTALL script.
- sed \
- -e "s@startdir=.*@startdir="${startdir}"@" \
- -i ${startdir}/.INSTALL
-}
-
build() {
cd ${srcdir}/swish
bower --allow-root install
make src
# Patch
- cp ${startdir}/run.pl .
- cp ${startdir}/run.sh .
+ cp ../../run.pl .
+ cp ../../run.sh .
+ cp ../../install_web_iface_deps.pl .
}
pkgver () {
@@ -43,11 +37,10 @@ pkgver () {
package() {
cd ${srcdir}
- install -d ${pkgdir}/usr/share/${pkgname}
- install -d ${pkgdir}/usr/bin
- cp -r swish/* ${pkgdir}/usr/share/${pkgname}
- install -D -m644 swish/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -D -m644 ${startdir}/${pkgname}.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
- install -D -m644 ${startdir}/${pkgname}.conf "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
- ln -s /usr/share/${pkgname}/run.sh ${pkgdir}/usr/bin/${pkgname}
+ install -d "${pkgdir}"/usr/share/"${pkgname}"
+ install -d "${pkgdir}"/usr/bin
+ cp -r swish/* "${pkgdir}"/usr/share/"${pkgname}"
+ install -D -m644 swish/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
+ install -D -m644 ../"${pkgname}".service ${pkgdir}/usr/lib/systemd/system/"${pkgname}".service
+ ln -s /usr/share/"${pkgname}"/run.sh "${pkgdir}"/usr/bin/"${pkgname}"
}
diff --git a/remove_web_iface_deps.pl b/remove_web_iface_deps.pl
deleted file mode 100755
index a63156c31154..000000000000
--- a/remove_web_iface_deps.pl
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env swipl
-
-/*
- *
- * remove_web_iface_deps.pl
- *
- * Copyright (C) 2016 frnmst (Franco Masotti) <franco.masotti@student.unife.it>
- *
- * This file is part of cplint-installer.
- *
- * cplint-installer is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * cplint-installer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with cplint-installer. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-:- initialization main.
-
-remove:-
- pack_remove(aleph),
- pack_remove(auc),
- pack_remove(real),
- pack_remove(matrix),
- pack_remove(cplint),
- pack_remove('rserve_client').
-
-main:-
- catch(remove, E, (print_message(error, E), fail)),
- halt.
-main:-
- halt(1).
diff --git a/run.sh b/run.sh
index 73fececf69ba..d4df42a8f280 100755
--- a/run.sh
+++ b/run.sh
@@ -25,9 +25,9 @@
# This is the file called from the /usr/bin/swish-cplint symlink
pkg_dir="/usr/share/swish-cplint"
-pid_file="/run/swish-cplint.pid"
-installed_file="/home/swish/installed"
-deps_installer="/home/swish/install_web_iface_deps.pl"
+pid_file="/run/swish-cplint/swish-cplint.pid"
+installed_file=""$pkg_dir"/installed"
+deps_installer=""$pkg_dir"/install_web_iface_deps.pl"
user="swish"
group="swish"
@@ -62,7 +62,8 @@ initialize()
printf "This may take a while.\n"
$deps_installer
if [ $? -eq 0 ]; then
- echo "true" > "$installed_file"
+ echo "# Don't touch this file" > "$installed_file"
+ echo "true" >> "$installed_file"
else
printf "Install web dependencies error\n"
exit 1
@@ -70,6 +71,18 @@ initialize()
fi
}
+killd()
+{
+ # kill action only if process exists.
+ if [ -f "$pid_file" ]; then
+ pid=$(cat "$pid_file")
+ ps -q $pid > /dev/null
+ if [ $? -eq 0 ]; then
+ kill -s TERM $pid
+ fi
+ fi
+}
+
startd()
{
local pid=""
@@ -87,20 +100,20 @@ startd()
#
# Copyright (C) 2016 frnmst (Franco Masotti) <franco.masotti@student.unife.it>
#
-# This file is part of cplint-installer.
+# This file is part of swish-installer.
#
-# cplint-installer is free software: you can redistribute it and/or modify
+# swish-installer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# cplint-installer is distributed in the hope that it will be useful,
+# swish-installer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with cplint-installer. If not, see <http://www.gnu.org/licenses/>.
+# along with swish-installer. If not, see <http://www.gnu.org/licenses/>.
#
#
@@ -137,7 +150,7 @@ killd()
pid=$(cat "$pid_file")
ps -q $pid > /dev/null
if [ $? -eq 0 ]; then
- kill -s SIGTERM $pid
+ kill -s TERM $pid
fi
fi
}
diff --git a/swish-cplint.conf b/swish-cplint.conf
deleted file mode 100644
index 19f97697c36a..000000000000
--- a/swish-cplint.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# swish-cplint.conf
-#
-# Copyright (C) 2016 frnmst (Franco Masotti) <franco.masotti@student.unife.it>
-#
-# This file is part of cplint-installer.
-#
-# cplint-installer is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# cplint-installer is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with cplint-installer. If not, see <http://www.gnu.org/licenses/>.
-#
-#
-
-# To be placed in /usr/lib/tmpfiles.d/swish-cplint.conf
-
-f /run/swish-cplint.pid 0755 swish swish -
diff --git a/swish-cplint.service b/swish-cplint.service
index 04fe50802fba..ccfca324ee00 100644
--- a/swish-cplint.service
+++ b/swish-cplint.service
@@ -29,15 +29,13 @@ Requires=rserve-sandbox-docker.service
After=rserve-sandbox-docker.service
[Service]
-# Run ExecStartPre with root permissions.
-PermissionsStartOnly=true
-ExecStartPre=/usr/bin/systemd-tmpfiles --create swish-cplint.conf
ExecStart=/usr/bin/swish-cplint -s
ExecStop=/usr/bin/swish-cplint -k
Type=forking
-PIDFile=/run/swish-cplint.pid
+PIDFile=/run/swish-cplint/swish-cplint.pid
User=swish
Group=swish
+RuntimeDirectory=swish-cplint
[Install]
Also=rserve-sandbox-docker.service