1 |
commit: 7dce4489ac962b89da6d80cd17abd971bee3fb92 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 3 05:28:26 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 3 05:30:19 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dce4489 |
7 |
|
8 |
dev-db/firebird: Improve OpenRC script |
9 |
|
10 |
The attached script updates a couple things which effectively is the same |
11 |
as the current model however it follows the modular nature of the declarative |
12 |
syntax. |
13 |
|
14 |
Changes: |
15 |
* Removes -p which is implied via pidfile= |
16 |
* Sets user via command_user |
17 |
* Moves the daemon options to command_args_background |
18 |
|
19 |
Closes: https://bugs.gentoo.org/828073 |
20 |
Signed-off-by: Brian Evans <grknight <AT> gentoo.org> |
21 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
22 |
|
23 |
dev-db/firebird/files/firebird.init.d.3.0-r1 | 22 +++ |
24 |
dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild | 228 +++++++++++++++++++++++ |
25 |
2 files changed, 250 insertions(+) |
26 |
|
27 |
diff --git a/dev-db/firebird/files/firebird.init.d.3.0-r1 b/dev-db/firebird/files/firebird.init.d.3.0-r1 |
28 |
new file mode 100644 |
29 |
index 000000000000..c49ea97f9203 |
30 |
--- /dev/null |
31 |
+++ b/dev-db/firebird/files/firebird.init.d.3.0-r1 |
32 |
@@ -0,0 +1,22 @@ |
33 |
+#!/sbin/openrc-run |
34 |
+# Copyright 1999-2021 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License, v2 or later |
36 |
+ |
37 |
+name=${RC_SVCNAME} |
38 |
+ |
39 |
+fbhomedir="/var/run/firebird" |
40 |
+fblogdir="/var/log/firebird" |
41 |
+pidfile="${fbhomedir}/firebird.pid" |
42 |
+command="/usr/sbin/fbguard" |
43 |
+command_args="-forever" |
44 |
+command_args_background="-daemon -pidfile $pidfile" |
45 |
+command_user="${FBUSER:-firebird}:${FBGROUP:-firebird}" |
46 |
+ |
47 |
+depend() { |
48 |
+ need net |
49 |
+} |
50 |
+ |
51 |
+start_pre() { |
52 |
+ checkpath -q -d -m 0770 -o ${FBUSER:-firebird}:${FBGROUP:-firebird} ${fbhomedir} || return 1 |
53 |
+ checkpath -q -d -m 0770 -o ${FBUSER:-firebird}:${FBGROUP:-firebird} ${fblogdir} || return 1 |
54 |
+} |
55 |
|
56 |
diff --git a/dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild b/dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild |
57 |
new file mode 100644 |
58 |
index 000000000000..3ee04900edfe |
59 |
--- /dev/null |
60 |
+++ b/dev-db/firebird/firebird-3.0.4.33054.0-r3.ebuild |
61 |
@@ -0,0 +1,228 @@ |
62 |
+# Copyright 1999-2022 Gentoo Authors |
63 |
+# Distributed under the terms of the GNU General Public License v2 |
64 |
+ |
65 |
+EAPI=7 |
66 |
+ |
67 |
+MY_P=${PN/f/F}-$(ver_rs 4 '-') |
68 |
+inherit autotools flag-o-matic |
69 |
+ |
70 |
+DESCRIPTION="Relational database offering many ANSI SQL:2003 and some SQL:2008 features" |
71 |
+HOMEPAGE="https://www.firebirdsql.org/" |
72 |
+SRC_URI=" |
73 |
+ https://github.com/FirebirdSQL/firebird/releases/download/R$(ver_rs 1-3 '_' $(ver_cut 1-3))/${MY_P}.tar.bz2 |
74 |
+ doc? ( ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip ) |
75 |
+" |
76 |
+S="${WORKDIR}/${MY_P}" |
77 |
+ |
78 |
+LICENSE="IDPL Interbase-1.0" |
79 |
+SLOT="0" |
80 |
+KEYWORDS="~amd64 ~x86" |
81 |
+IUSE="doc examples +server xinetd" |
82 |
+ |
83 |
+BDEPEND=" |
84 |
+ >=dev-util/btyacc-3.0-r2 |
85 |
+ doc? ( app-arch/unzip ) |
86 |
+" |
87 |
+# FIXME: cloop? |
88 |
+DEPEND=" |
89 |
+ dev-libs/icu:= |
90 |
+ dev-libs/libedit |
91 |
+ dev-libs/libtommath |
92 |
+" |
93 |
+RDEPEND=" |
94 |
+ ${DEPEND} |
95 |
+ acct-group/firebird |
96 |
+ acct-user/firebird |
97 |
+ xinetd? ( virtual/inetd ) |
98 |
+ !sys-cluster/ganglia |
99 |
+" |
100 |
+ |
101 |
+PATCHES=( |
102 |
+ "${FILESDIR}"/${PN}-3.0.2.32703.0-unbundle.patch |
103 |
+ "${FILESDIR}"/${PN}-3.0.2.32703.0-cloop-compiler.patch |
104 |
+) |
105 |
+ |
106 |
+pkg_pretend() { |
107 |
+ if [[ -e /var/run/${PN}/${PN}.pid ]] ; then |
108 |
+ ewarn |
109 |
+ ewarn "The presence of server connections may prevent isql or gsec" |
110 |
+ ewarn "from establishing an embedded connection. Accordingly," |
111 |
+ ewarn "creating employee.fdb or security3.fdb could fail." |
112 |
+ ewarn "It is more secure to stop the firebird daemon before running emerge." |
113 |
+ ewarn |
114 |
+ fi |
115 |
+} |
116 |
+ |
117 |
+check_sed() { |
118 |
+ MSG="sed of $3, required $2 line(s) modified $1" |
119 |
+ einfo "${MSG}" |
120 |
+ [[ $1 -ge $2 ]] || die "${MSG}" |
121 |
+} |
122 |
+ |
123 |
+src_unpack() { |
124 |
+ unpack "${MY_P}.tar.bz2" |
125 |
+ if use doc; then |
126 |
+ # Unpack docs |
127 |
+ mkdir "manuals" || die |
128 |
+ cd "manuals" || die |
129 |
+ unpack ib_b60_doc.zip |
130 |
+ fi |
131 |
+} |
132 |
+ |
133 |
+src_prepare() { |
134 |
+ default |
135 |
+ |
136 |
+ # Rename references to isql to fbsql |
137 |
+ # sed vs patch for portability and addtional location changes |
138 |
+ check_sed "$(sed -i -e 's:"isql :"fbsql :w /dev/stdout' \ |
139 |
+ src/isql/isql.epp | wc -l)" "1" "src/isql/isql.epp" # 1 line |
140 |
+ check_sed "$(sed -i -e 's:isql :fbsql :w /dev/stdout' \ |
141 |
+ src/msgs/history2.sql | wc -l)" "4" "src/msgs/history2.sql" # 4 lines |
142 |
+ check_sed "$(sed -i -e 's:--- ISQL:--- FBSQL:w /dev/stdout' \ |
143 |
+ -e 's:isql :fbsql :w /dev/stdout' \ |
144 |
+ -e 's:ISQL :FBSQL :w /dev/stdout' \ |
145 |
+ src/msgs/messages2.sql | wc -l)" "6" "src/msgs/messages2.sql" # 6 lines |
146 |
+ |
147 |
+ find . -name \*.sh -exec chmod +x {} + || die |
148 |
+ rm -r extern/{btyacc,editline,icu} || die |
149 |
+ |
150 |
+ eautoreconf |
151 |
+} |
152 |
+ |
153 |
+src_configure() { |
154 |
+ filter-flags -fprefetch-loop-arrays |
155 |
+ filter-mfpmath sse |
156 |
+ |
157 |
+ # otherwise this doesnt build with gcc-6 |
158 |
+ # http://tracker.firebirdsql.org/browse/CORE-5099 |
159 |
+ append-cflags -fno-sized-deallocation -fno-delete-null-pointer-checks |
160 |
+ append-cxxflags -fno-sized-deallocation -fno-delete-null-pointer-checks -std=c++11 |
161 |
+ |
162 |
+ local myeconfargs=( |
163 |
+ --prefix=/usr/$(get_libdir)/firebird |
164 |
+ --with-editline |
165 |
+ --with-system-editline |
166 |
+ --with-fbbin=/usr/bin |
167 |
+ --with-fbsbin=/usr/sbin |
168 |
+ --with-fbconf=/etc/${PN} |
169 |
+ --with-fblib=/usr/$(get_libdir) |
170 |
+ --with-fbinclude=/usr/include |
171 |
+ --with-fbdoc=/usr/share/doc/${PF} |
172 |
+ --with-fbudf=/usr/$(get_libdir)/${PN}/UDF |
173 |
+ --with-fbsample=/usr/share/doc/${PF}/examples |
174 |
+ --with-fbsample-db=/usr/share/doc/${PF}/examples/db |
175 |
+ --with-fbhelp=/usr/$(get_libdir)/${PN}/help |
176 |
+ --with-fbintl=/usr/$(get_libdir)/${PN}/intl |
177 |
+ --with-fbmisc=/usr/share/${PN} |
178 |
+ --with-fbsecure-db=/etc/${PN} |
179 |
+ --with-fbmsg=/usr/$(get_libdir)/${PN} |
180 |
+ --with-fblog=/var/log/${PN}/ |
181 |
+ --with-fbglock=/var/run/${PN} |
182 |
+ --with-fbplugins=/usr/$(get_libdir)/${PN}/plugins |
183 |
+ --with-gnu-ld |
184 |
+ ) |
185 |
+ econf "${myeconfargs[@]}" |
186 |
+} |
187 |
+ |
188 |
+# from linux underground, merging into this here |
189 |
+src_install() { |
190 |
+ if use doc; then |
191 |
+ dodoc -r doc |
192 |
+ find "${WORKDIR}"/manuals -type f -iname "*.pdf" -exec dodoc '{}' + || die |
193 |
+ fi |
194 |
+ |
195 |
+ cd "${S}/gen/Release/${PN}" || die |
196 |
+ |
197 |
+ doheader include/* |
198 |
+ dolib.so lib/*.so* |
199 |
+ |
200 |
+ # links for backwards compatibility |
201 |
+ insinto /usr/$(get_libdir) |
202 |
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so |
203 |
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so.0 |
204 |
+ dosym libfbclient.so /usr/$(get_libdir)/libfbclient.so.1 |
205 |
+ |
206 |
+ insinto /usr/share/${PN}/msg |
207 |
+ doins *.msg |
208 |
+ |
209 |
+ use server || return |
210 |
+ |
211 |
+ einfo "Renaming isql -> fbsql" |
212 |
+ mv bin/isql bin/fbsql || die "failed to rename isql -> fbsql" |
213 |
+ |
214 |
+ dobin bin/{fb_config,fbsql,fbsvcmgr,fbtracemgr,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup,qli} |
215 |
+ dosbin bin/{firebird,fbguard,fb_lock_print} |
216 |
+ |
217 |
+ insinto /usr/share/${PN}/help |
218 |
+ # why??? |
219 |
+ insopts -m0660 -o firebird -g firebird |
220 |
+ doins help/help.fdb |
221 |
+ |
222 |
+ exeinto /usr/$(get_libdir)/${PN}/intl |
223 |
+ doexe intl/libfbintl.so |
224 |
+ dosym libfbintl.so /usr/$(get_libdir)/${PN}/intl/fbintl.so |
225 |
+ |
226 |
+ insinto /usr/$(get_libdir)/${PN}/intl |
227 |
+ insopts -m0644 -o root -g root |
228 |
+ doins intl/fbintl.conf |
229 |
+ |
230 |
+ # plugins |
231 |
+ exeinto /usr/$(get_libdir)/${PN}/plugins |
232 |
+ doexe plugins/*.so |
233 |
+ exeinto /usr/$(get_libdir)/${PN}/plugins/udr |
234 |
+ doexe plugins/udr/*.so |
235 |
+ |
236 |
+ exeinto /usr/$(get_libdir)/${PN}/UDF |
237 |
+ doexe UDF/*.so |
238 |
+ |
239 |
+ # logging (do we really need the perms?) |
240 |
+ diropts -m 755 -o firebird -g firebird |
241 |
+ dodir /var/log/${PN} |
242 |
+ keepdir /var/log/${PN} |
243 |
+ |
244 |
+ # logrotate |
245 |
+ insinto /etc/logrotate.d |
246 |
+ newins "${FILESDIR}/${PN}.logrotate" ${PN} |
247 |
+ |
248 |
+ # configuration files |
249 |
+ insinto /etc/${PN}/plugins |
250 |
+ doins plugins/udr_engine.conf |
251 |
+ insinto /etc/${PN} |
252 |
+ doins {databases,fbtrace,firebird,plugins}.conf |
253 |
+ |
254 |
+ # install secutity3.fdb |
255 |
+ insopts -m0660 -o firebird -g firebird |
256 |
+ doins security3.fdb |
257 |
+ |
258 |
+ if use xinetd; then |
259 |
+ insinto /etc/xinetd.d |
260 |
+ newins "${FILESDIR}/${PN}.xinetd.3.0" ${PN} |
261 |
+ else |
262 |
+ newinitd "${FILESDIR}/${PN}.init.d.3.0-r1" ${PN} |
263 |
+ fi |
264 |
+ |
265 |
+ if use examples; then |
266 |
+ cd examples || die |
267 |
+ insinto /usr/share/${PN}/examples |
268 |
+ insopts -m0644 -o root -g root |
269 |
+ doins -r api |
270 |
+ doins -r dbcrypt |
271 |
+ doins -r include |
272 |
+ doins -r interfaces |
273 |
+ doins -r package |
274 |
+ doins -r stat |
275 |
+ doins -r udf |
276 |
+ doins -r udr |
277 |
+ doins CMakeLists.txt |
278 |
+ doins functions.c |
279 |
+ doins README |
280 |
+ insinto /usr/share/${PN}/examples/empbuild |
281 |
+ insopts -m0660 -o firebird -g firebird |
282 |
+ doins empbuild/employee.fdb |
283 |
+ fi |
284 |
+ |
285 |
+ elog "Starting with version 3, server mode is set in firebird.conf" |
286 |
+ elog "The default setting is superserver." |
287 |
+ elog |
288 |
+ elog "If you're using UDFs, please remember to move them to /usr/$(get_libdir)/firebird/UDF" |
289 |
+} |