blob: 67e0711515e3b544263b5e2b070b8ae84e06dbe9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
PORTNAME= rustypaste
DISTVERSIONPREFIX= v
DISTVERSION= 0.11.1
PORTREVISION= 1
CATEGORIES= www
MAINTAINER= DtxdF@disroot.org
COMMENT= Minimal file upload/pastebin service
WWW= https://blog.orhun.dev/blazingly-fast-file-sharing/
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libzstd.so:archivers/zstd
USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= orhun
USE_RC_SUBR= ${PORTNAME}
CARGO_FEATURES= --no-default-features
SUB_LIST+= USER="${USERS:[0]}"
USERS= ${PORTNAME}
GROUPS= ${PORTNAME}
PLIST_SUB+= GROUP="${GROUPS:[0]}" \
USER="${USERS:[0]}"
OPTIONS_DEFINE= SHUTTLE
OPTIONS_DEFAULT= OPENSSL
OPTIONS_RADIO= TLS
OPTIONS_RADIO_TLS= OPENSSL RUSTLS
OPENSSL_DESC= Use distro OpenSSL (binary size is reduced ~20%)
RUSTLS_DESC= Use modern TLS library in Rust
SHUTTLE_DESC= Enable an entry point for deploying on Shuttle
OPENSSL_USES= ssl
OPENSSL_VARS= CARGO_FEATURES+=openssl
RUSTLS_VARS= CARGO_FEATURES+=rustls
SHUTTLE_BUILD_DEPENDS= protoc:devel/protobuf
SHUTTLE_VARS= CARGO_FEATURES+=shuttle
UPLOAD_PATH= /var/db/${PORTNAME}
post-patch:
@${REINPLACE_CMD} -e '/^upload_path[[:space:]]*=/s#=.*#= "${UPLOAD_PATH}"#' ${WRKSRC}/config.toml
post-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}/${UPLOAD_PATH}
${ECHO_CMD} 'CONFIG="${ETCDIR}/${PORTNAME}.toml"' > ${STAGEDIR}${ETCDIR}/${PORTNAME}.env.sample
${CP} ${WRKSRC}/config.toml ${STAGEDIR}${ETCDIR}/${PORTNAME}.toml.sample
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
.include <bsd.port.mk>
|