Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/monkeyd/, www-servers/monkeyd/files/
Date: Fri, 01 Jul 2016 17:20:20
Message-Id: 1467393791.6761e0a48b09d1f88f81dbf620e14676404784cc.blueness@gentoo
1 commit: 6761e0a48b09d1f88f81dbf620e14676404784cc
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 1 17:22:34 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 1 17:23:11 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6761e0a4
7
8 www-servers/monkeyd: add monkeyd user, fix pidfile and address bug #459274
9
10 Package-Manager: portage-2.2.28
11
12 .../monkeyd/files/monkeyd-1.6.9-fix-pidfile.patch | 12 ++++++++++++
13 ...{monkeyd-1.6.9.ebuild => monkeyd-1.6.9-r1.ebuild} | 20 ++++++++++++++++----
14 www-servers/monkeyd/monkeyd-9999.ebuild | 20 ++++++++++++++++----
15 3 files changed, 44 insertions(+), 8 deletions(-)
16
17 diff --git a/www-servers/monkeyd/files/monkeyd-1.6.9-fix-pidfile.patch b/www-servers/monkeyd/files/monkeyd-1.6.9-fix-pidfile.patch
18 new file mode 100644
19 index 0000000..82550ae
20 --- /dev/null
21 +++ b/www-servers/monkeyd/files/monkeyd-1.6.9-fix-pidfile.patch
22 @@ -0,0 +1,12 @@
23 +diff -Naur monkey-1.6.9.orig/CMakeLists.txt monkey-1.6.9/CMakeLists.txt
24 +--- monkey-1.6.9.orig/CMakeLists.txt 2016-06-04 19:16:47.000000000 -0400
25 ++++ monkey-1.6.9/CMakeLists.txt 2016-07-01 13:08:51.237213196 -0400
26 +@@ -285,7 +285,7 @@
27 +
28 + # Custom PIDPATH
29 + if(NOT PID_PATH)
30 +- set(MK_PATH_PIDPATH ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/ CACHE STRING "Server PID path")
31 ++ set(MK_PATH_PIDPATH /run/ CACHE STRING "Server PID path")
32 + else()
33 + set(MK_PATH_PIDPATH ${PID_PATH} CACHE STRING "Server PID path")
34 + endif()
35
36 diff --git a/www-servers/monkeyd/monkeyd-1.6.9.ebuild b/www-servers/monkeyd/monkeyd-1.6.9-r1.ebuild
37 similarity index 90%
38 rename from www-servers/monkeyd/monkeyd-1.6.9.ebuild
39 rename to www-servers/monkeyd/monkeyd-1.6.9-r1.ebuild
40 index 3221de5..86b01b6 100644
41 --- a/www-servers/monkeyd/monkeyd-1.6.9.ebuild
42 +++ b/www-servers/monkeyd/monkeyd-1.6.9-r1.ebuild
43 @@ -4,7 +4,7 @@
44
45 EAPI="5"
46
47 -inherit eutils flag-o-matic toolchain-funcs multilib
48 +inherit eutils flag-o-matic toolchain-funcs user multilib
49
50 DESCRIPTION="A small, fast, and scalable web server"
51 HOMEPAGE="http://www.monkey-project.com/"
52 @@ -46,6 +46,11 @@ S="${WORKDIR}/${MY_P}"
53
54 WEBROOT="/var/www/localhost"
55
56 +pkg_preinst() {
57 + enewgroup monkeyd
58 + enewuser monkeyd -1 -1 /var/tmp/monkeyd monkeyd
59 +}
60 +
61 pkg_setup() {
62 if use debug; then
63 ewarn
64 @@ -59,6 +64,7 @@ pkg_setup() {
65 src_prepare() {
66 # Unconditionally get rid of the bundled jemalloc
67 rm -rf "${S}"/deps
68 + epatch "${FILESDIR}"/${PN}-1.6.9-fix-pidfile.patch
69 epatch "${FILESDIR}"/${PN}-1.6.8-system-mbedtls.patch
70 }
71
72 @@ -106,13 +112,13 @@ src_configure() {
73 ./configure \
74 --pthread-tls \
75 --prefix=/usr \
76 + --default-user=monkeyd \
77 --sbindir=/usr/sbin \
78 --webroot=${WEBROOT}/htdocs \
79 - --logdir=/var/log/${PN} \
80 + --logdir=/var/log/monkeyd \
81 --mandir=/usr/share/man \
82 --libdir=/usr/$(get_libdir) \
83 - --pidfile=/run/monkey.pid \
84 - --sysconfdir=/etc/${PN} \
85 + --sysconfdir=/etc/monkeyd \
86 ${myconf} \
87 || die
88 }
89 @@ -133,9 +139,15 @@ src_install() {
90 "${D}"/usr/share/doc/"${PF}"/htdocs.dist || die
91
92 keepdir \
93 + /var/tmp/monkeyd \
94 /var/log/monkeyd \
95 ${WEBROOT}/htdocs
96
97 # This needs to be created at runtime
98 rm -rf "${D}"/run
99 }
100 +
101 +pkg_postinst() {
102 + chown monkeyd:monkeyd /var/{log,tmp}/monkeyd
103 + chmod 770 /var/{log,tmp}/monkeyd
104 +}
105
106 diff --git a/www-servers/monkeyd/monkeyd-9999.ebuild b/www-servers/monkeyd/monkeyd-9999.ebuild
107 index 3221de5..86b01b6 100644
108 --- a/www-servers/monkeyd/monkeyd-9999.ebuild
109 +++ b/www-servers/monkeyd/monkeyd-9999.ebuild
110 @@ -4,7 +4,7 @@
111
112 EAPI="5"
113
114 -inherit eutils flag-o-matic toolchain-funcs multilib
115 +inherit eutils flag-o-matic toolchain-funcs user multilib
116
117 DESCRIPTION="A small, fast, and scalable web server"
118 HOMEPAGE="http://www.monkey-project.com/"
119 @@ -46,6 +46,11 @@ S="${WORKDIR}/${MY_P}"
120
121 WEBROOT="/var/www/localhost"
122
123 +pkg_preinst() {
124 + enewgroup monkeyd
125 + enewuser monkeyd -1 -1 /var/tmp/monkeyd monkeyd
126 +}
127 +
128 pkg_setup() {
129 if use debug; then
130 ewarn
131 @@ -59,6 +64,7 @@ pkg_setup() {
132 src_prepare() {
133 # Unconditionally get rid of the bundled jemalloc
134 rm -rf "${S}"/deps
135 + epatch "${FILESDIR}"/${PN}-1.6.9-fix-pidfile.patch
136 epatch "${FILESDIR}"/${PN}-1.6.8-system-mbedtls.patch
137 }
138
139 @@ -106,13 +112,13 @@ src_configure() {
140 ./configure \
141 --pthread-tls \
142 --prefix=/usr \
143 + --default-user=monkeyd \
144 --sbindir=/usr/sbin \
145 --webroot=${WEBROOT}/htdocs \
146 - --logdir=/var/log/${PN} \
147 + --logdir=/var/log/monkeyd \
148 --mandir=/usr/share/man \
149 --libdir=/usr/$(get_libdir) \
150 - --pidfile=/run/monkey.pid \
151 - --sysconfdir=/etc/${PN} \
152 + --sysconfdir=/etc/monkeyd \
153 ${myconf} \
154 || die
155 }
156 @@ -133,9 +139,15 @@ src_install() {
157 "${D}"/usr/share/doc/"${PF}"/htdocs.dist || die
158
159 keepdir \
160 + /var/tmp/monkeyd \
161 /var/log/monkeyd \
162 ${WEBROOT}/htdocs
163
164 # This needs to be created at runtime
165 rm -rf "${D}"/run
166 }
167 +
168 +pkg_postinst() {
169 + chown monkeyd:monkeyd /var/{log,tmp}/monkeyd
170 + chmod 770 /var/{log,tmp}/monkeyd
171 +}