Skip to content

Commit

Permalink
net-misc/fileshelter: new package, add 6.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas PARLANT <[email protected]>
  • Loading branch information
PPN-SD committed Oct 14, 2024
1 parent 126cd5b commit 3af0def
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 0 deletions.
1 change: 1 addition & 0 deletions net-misc/fileshelter/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST fileshelter-6.2.0.tar.gz 66406 BLAKE2B bb510331c84f0321e21a87a7cd25886c7c391666504833c5acb8db724322cb2bf8919e8ef281cbe4453aacf7e1c0f93447200f60a79c429a595c8678b7e4bdb8 SHA512 5563fd04a1c97064f443d7081e897e3473d5937d43410d48d32dbb610c90d0eb8df2fb0b642aaf7af9c5fdad30f53d7f3a797021121fc9a3dbd35b2e64fdae6c
23 changes: 23 additions & 0 deletions net-misc/fileshelter/files/fileshelter-6.2.0-fix-lib-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
https://github.com/epoupon/fileshelter/pull/109/commits/c2f023133f4dd9d5826ea339bb6d278d33c389df
use cmake libdir to satisfy some sanity checks

diff -uNr a/src/libs/share/CMakeLists.txt b/src/libs/share/CMakeLists.txt
--- a/src/libs/share/CMakeLists.txt
+++ b/src/libs/share/CMakeLists.txt
@@ -28,5 +28,5 @@
Wt::Wt
)

-install(TARGETS filesheltershare DESTINATION lib)
+install(TARGETS filesheltershare DESTINATION ${CMAKE_INSTALL_LIBDIR})

diff -uNr a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt
--- a/src/libs/utils/CMakeLists.txt
+++ b/src/libs/utils/CMakeLists.txt
@@ -27,5 +27,5 @@
Wt::Wt
)

-install(TARGETS fileshelterutils DESTINATION lib)
+install(TARGETS fileshelterutils DESTINATION ${CMAKE_INSTALL_LIBDIR})

29 changes: 29 additions & 0 deletions net-misc/fileshelter/files/fileshelter-6.2.0-hierarchy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/conf/fileshelter.conf b/conf/fileshelter.conf
--- a/conf/fileshelter.conf
+++ b/conf/fileshelter.conf
@@ -1,10 +1,10 @@
# Fileshelter Sample configuration file

# Working directory (must have write privileges)
-working-dir = "/var/fileshelter";
+working-dir = "/var/lib/fileshelter";

# Log files, empty means stderr
-log-file = "";
+log-file = "/var/log/fileshelter/fileshelter.log";
access-log-file = "";
# Logger configuration, see log-config in https://webtoolkit.eu/wt/doc/reference/html/overview.html#config_general
log-config = "* -debug -info:WebRequest";
@@ -45,9 +45,9 @@ trusted-proxies =

# If enabled, these files have to exist and have correct permissions set
tls-enable = false;
-tls-cert = "/var/fileshelter/cert.pem";
-tls-key = "/var/fileshelter/privkey.pem";
-tls-dh = "/var/fileshelter/dh2048.pem";
+tls-cert = "/var/lib/fileshelter/cert.pem";
+tls-key = "/var/lib/fileshelter/privkey.pem";
+tls-dh = "/var/lib/fileshelter/dh2048.pem";

# Application settings
app-name = "FileShelter";
29 changes: 29 additions & 0 deletions net-misc/fileshelter/files/fileshelter.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/sbin/openrc-run
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

: ${FILESHELTER_GROUP:=fileshelter}
: ${FILESHELTER_USER:=fileshelter}
: ${FILESHELTER_BINDIR:=/var/lib/fileshelter}
: ${FILESHELTER_PIDFILE:=/run/fileshelter.pid}

command="/usr/bin/fileshelter"
command_user="fileshelter:fileshelter"
command_background=true
directory="${FILESHELTER_BINDIR}"
pidfile="${FILESHELTER_PIDFILE}"
extra_started_commands="reload"

depend() {
use net
}

start_pre() {
checkpath -d -m 0750 -o "${FILESHELTER_USER}:${FILESHELTER_GROUP}" ${FILESHELTER_BINDIR}
}

reload () {
ebegin "Reloading configuration and re-opening log files"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}
48 changes: 48 additions & 0 deletions net-misc/fileshelter/fileshelter-6.2.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake systemd

DESCRIPTION="FileShelter is a “one-click” file sharing web application "
HOMEPAGE="https://fileshelter-demo.poupon.dev https://github.com/epoupon/fileshelter"
SRC_URI="https://github.com/epoupon/fileshelter/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
acct-user/fileshelter
app-arch/libarchive
dev-cpp/wt:=
dev-libs/boost:=
dev-libs/libconfig[cxx]
"

RDEPEND="${DEPEND}"

DOCS=( INSTALL.md README.md )

PATCHES="
${FILESDIR}/${PN}-6.2.0-fix-lib-dir.patch
${FILESDIR}/${PN}-6.2.0-hierarchy.patch
"

src_install() {
cmake_src_install

systemd_newunit conf/systemd/default.service fileshelter.service
newinitd "${FILESDIR}/fileshelter.init" fileshelter

keepdir /var/log/fileshelter
fowners -R fileshelter:fileshelter /var/log/fileshelter

mv "${ED}/usr/share/fileshelter/fileshelter.conf" "${ED}/etc/fileshelter.conf" || die

rm "${ED}/usr/share/fileshelter/default.service" || die

keepdir /var/lib/fileshelter
fowners fileshelter:fileshelter /var/lib/fileshelter
}
11 changes: 11 additions & 0 deletions net-misc/fileshelter/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Nicolas PARLANT</name>
</maintainer>
<upstream>
<remote-id type="github">epoupon/fileshelter</remote-id>
</upstream>
</pkgmetadata>

3 comments on commit 3af0def

@stkw0
Copy link
Contributor

@stkw0 stkw0 commented on 3af0def Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can send the patches upstream btw. I sent a similar CMake patch to the same developer time ago.

@PPN-SD
Copy link
Contributor Author

@PPN-SD PPN-SD commented on 3af0def Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch is waiting for the next release in the dev branch.
See : epoupon/fileshelter#109

@stkw0
Copy link
Contributor

@stkw0 stkw0 commented on 3af0def Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I looked at open PR only (:

Please sign in to comment.