Skip to content

Commit 5a37171

Browse files
Added default values for pathnames.
This allows one to simply run `./configure` and expect it to produce sane defaults for an install. Previously, without specifying `--prefix=...`, `make install` would simply fail, recommending to set `--prefix` or `DESTDIR`, but that recommendation was incomplete at best, since it didn't set many of the subdirs needed for a good organization. Setting `DESTDIR` was even worse, since that shouldn't even affect an installation (it is required to be transparent to the installation). /usr/local is the historic Unix standard path to use for installations from source made manually by the admin of the system. Some package managers (Homebrew, I'm looking specifically at you) have abused that path to install their things, but 1) it's not our fault that someone else incorrectly abuses that path (and they seem to be fixing it for newer archs; e.g., they started using /opt/homebrew for Apple Silicon), 2) there's no better path than /usr/local, 3) we still allow changing it for systems where this might not be the desired path (MacOS Intel with hombrew), and 4) it's _the standard_. See a related conversation with Ingo (OpenBSD maintainer): On 7/27/22 16:16, Ingo Schwarze wrote: > Hi Alejandro, [...] > > Alejandro Colomar wrote on Sun, Jul 24, 2022 at 07:07:18PM +0200: >> On 7/24/22 16:57, Ingo Schwarze wrote: >>> Alejandro Colomar wrote on Sun, Jul 24, 2022 at 01:20:46PM +0200: > >>>> /usr/local is for sysadmins to build from source; > >>> Doing that is *very* strongly discouraged on OpenBSD. > >> I guess that's why the directory was reused in the BSDs to install ports >> (probably ports were installed by the sysadmin there, and by extension, >> ports are now always installed there, but that's just a guess). > > Maybe. In any case, the practice of using /usr/local for packages > created from ports is significantly older than the recommendation > to refrain from using upstream "make install" outside the ports > framework. > > * The FreeBSD ports framework was started by Jordan Hubbard in 1993. > * The ports framework was ported from FreeBSD to OpenBSD > by Niklas Hallqvist in 1996. > * NetBSD pkgsrc was forked from FreeBSD ports by Alistair G. Crooks > and Hubert Feyrer in 1997. > > I failed to quickly find Jordan's original version, but rev. 1.1 > of /usr/ports/infrastructure/mk/bsd.port.mk in OpenBSD (dated Jun 3 > 22:47:10 1996 UTC) already said > > LOCALBASE ?= /usr/local > PREFIX ?= ${LOCALBASE} > [...] >> I had a discussion in NGINX Unit about it, and >> the decission for now has been: "support prefix=/usr/local for default >> manual installation through the Makefile, and let BSD users adjust to >> their preferred path". > > That's an *excellent* solution for the task, thanks for doing it > the right way. By setting PREFIX=/usr/local by default in the > upstream Makefile, you are minimizing the work for *BSD porters. > > The BSD ports frameworks will typically run the upstreak "make install" > with the variable DESTDIR set to a custom value, for example > > DESTDIR=/usr/ports/pobj/groff-1.23.0/fake-amd64 > > so if the upstream Makefile sets PREFIX=/usr/local , > that's perfect, everything gets installed to the right place > without an intervention by the person doing the porting. > > Of course, if the upstream Makefile would use some other PREFIX, > that would not be a huge obstacle. All we have to do in that case > is pass the option --prefix=/usr/local to the ./configure script, > or something equivalent if the software isn't using GNU configure. > >> We were concerned that we might get collisions >> with the BSD port also installing in /usr/local, but that's the least >> evil (and considering BSD users don't typically run `make install`, it's >> not so bad). > > It's not bad at all. It's perfect. > > Of course, if a user wants to install *without* the ports framework, > they have to provide their own --prefix. But that's not an issue > because it is easy to do, and installing without a port is discouraged > anyway. === Directory variables should never contain a trailing slash (I've learned that the hard way, where some things would break unexpectedly). Especially, make(1) is likely to have problems when things have double slashes or a trailing slash, since it treats filenames as text strings. I've removed the trailing slash from the prefix, and added it to the derivate variables just after the prefix. pkg-config(1) also expects directory variables to have no trailing slash. === I also removed the code that would set variables as depending on the prefix if they didn't start with a slash, because that is a rather non-obvious behavior, and things should not always depend on prefix, but other dirs such as $(runstatedir), so if we keep a similar behavior it would be very unreliable. Better keep variables intact if set, or use the default if unset. === Print the real defaults for ./configure --help, rather than the actual values. === I used a subdirectory under the standard /var/lib for NXT_STATE, instead of a homemade "state" dir that does the same thing. === Modified the Makefile to create some dirs that weren't being created, and also remove those that weren't being removed in uninstall, probably because someone forgot to add them. === Add new options for setting the new variables, and rename some to be consistent with the standard names. Keep the old ones at configuration time for compatibility, but mark them as deprecated. Don't keep the old ones at exec time. === A summary of the default config is: Unit configuration summary: bin directory: ............. "/usr/local/bin" sbin directory: ............ "/usr/local/sbin" lib directory: ............. "/usr/local/lib" include directory: ......... "/usr/local/include" man pages directory: ....... "/usr/local/share/man" modules directory: ......... "/usr/local/lib/unit/modules" state directory: ........... "/usr/local/var/lib/unit" tmp directory: ............. "/tmp" pid file: .................. "/usr/local/var/run/unit/unit.pid" log file: .................. "/usr/local/var/log/unit/unit.log" control API socket: ........ "unix:/usr/local/var/run/unit/control.unit.sock" Link: <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html> Link: <https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html> Reviewed-by: Artem Konev <[email protected]> Reviewed-by: Andrew Clayton <[email protected]> Tested-by: Andrew Clayton <[email protected]> Reviewed-by: Konstantin Pavlov <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]>
1 parent 0be289b commit 5a37171

File tree

15 files changed

+152
-159
lines changed

15 files changed

+152
-159
lines changed

auto/help

+23-15
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,31 @@ cat << END
1111
--cc-opt=OPTIONS set additional C compiler options
1212
--ld-opt=OPTIONS set additional linker options
1313

14-
--prefix=DIRECTORY set prefix for relative pathnames, default: none
15-
--bindir=DIRECTORY set user executables directory name
16-
default: "$NXT_BINDIR"
17-
--sbindir=DIRECTORY set system admin executables directory name
18-
default: "$NXT_SBINDIR"
19-
--libdir=DIRECTORY set library directory name, default: "$NXT_LIBDIR"
20-
--incdir=DIRECTORY set includes directory name, default: "$NXT_INCDIR"
21-
--mandir=DIRECTORY set man pages directory name, default: "$NXT_MANDIR"
22-
--modules=DIRECTORY set modules directory name, default: "$NXT_MODULES"
23-
--state=DIRECTORY set state directory name, default: "$NXT_STATE"
24-
--tmp=DIRECTORY set tmp directory name, default: "$NXT_TMP"
25-
26-
--pid=FILE set pid filename, default: "$NXT_PID"
27-
--log=FILE set log filename, default: "$NXT_LOG"
14+
--prefix=DIR default: "/usr/local"
15+
--exec-prefix=DIR default: "\$prefix"
16+
--bindir=DIR default: "\$exec_prefix/bin"
17+
--sbindir=DIR default: "\$exec_prefix/sbin"
18+
--includedir=DIR default: "\$prefix/include"
19+
--libdir=DIR default: "\$exec_prefix/lib"
20+
--modulesdir=DIR default: "\$libdir/unit/modules"
21+
--datarootdir=DIR default: "\$prefix/share"
22+
--mandir=DIR default: "\$datarootdir/man"
23+
--localstatedir=DIR default: "\$prefix/var"
24+
--libstatedir=DIR default: "\$localstatedir/lib/unit"
25+
--runstatedir=DIR default: "\$localstatedir/run/unit"
26+
--logdir=DIR default: "\$localstatedir/log/unit"
27+
--tmpdir=DIR default: "/tmp"
28+
29+
--incdir=DIR [deprecated] synonym for --includedir
30+
--modules=DIR [deprecated] synonym for --modulesdir
31+
--state=DIR [deprecated] synonym for --libstatedir
32+
--tmp=DIR [deprecated] synonym for --tmpdir
33+
34+
--pid=FILE set pid filename, default: "\$runstatedir/unit.pid"
35+
--log=FILE set log filename, default: "\$logdir/unit.log"
2836

2937
--control=ADDRESS set address of control API socket
30-
default: "$NXT_CONTROL"
38+
default: "unix:\$runstatedir/control.unit.sock"
3139

3240
--user=USER set non-privileged processes to run as specified user
3341
default: "$NXT_USER"

auto/make

+20-16
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,12 @@ ${NXT_DAEMON}-install: $NXT_DAEMON install-check
366366
test -d \$(DESTDIR)$NXT_SBINDIR \
367367
|| install -d \$(DESTDIR)$NXT_SBINDIR
368368
install -p $NXT_BUILD_DIR/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/
369-
test -d \$(DESTDIR)$NXT_STATE \
370-
|| install -d \$(DESTDIR)$NXT_STATE
369+
test -d \$(DESTDIR)$NXT_LIBSTATEDIR \
370+
|| install -d \$(DESTDIR)$NXT_LIBSTATEDIR
371+
test -d \$(DESTDIR)$NXT_LOGDIR \
372+
|| install -d \$(DESTDIR)$NXT_LOGDIR
373+
test -d \$(DESTDIR)$NXT_RUNSTATEDIR \
374+
|| install -d \$(DESTDIR)$NXT_RUNSTATEDIR
371375

372376
manpage-install: manpage install-check
373377
test -d \$(DESTDIR)$NXT_MANDIR/man8 \
@@ -397,8 +401,8 @@ libunit-install: $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
397401
|| install -d \$(DESTDIR)$NXT_LIBDIR
398402
install -p -m u=rw,go=r $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC \
399403
\$(DESTDIR)$NXT_LIBDIR/
400-
test -d \$(DESTDIR)$NXT_INCDIR \
401-
|| install -d \$(DESTDIR)$NXT_INCDIR
404+
test -d \$(DESTDIR)$NXT_INCLUDEDIR \
405+
|| install -d \$(DESTDIR)$NXT_INCLUDEDIR
402406
install -p -m u=rw,go=r src/nxt_unit.h \
403407
src/nxt_unit_field.h \
404408
src/nxt_unit_request.h \
@@ -409,22 +413,22 @@ libunit-install: $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
409413
$NXT_BUILD_DIR/nxt_auto_config.h \
410414
$NXT_BUILD_DIR/nxt_version.h \
411415
src/nxt_websocket_header.h \
412-
\$(DESTDIR)$NXT_INCDIR/
416+
\$(DESTDIR)$NXT_INCLUDEDIR/
413417

414418
libunit-uninstall:
415419
rm -f \$(DESTDIR)$NXT_LIBDIR/$NXT_LIB_UNIT_STATIC
416420
@rmdir -p \$(DESTDIR)$NXT_LIBDIR 2>/dev/null || true
417-
rm -f \$(DESTDIR)$NXT_INCDIR/nxt_unit.h \
418-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_field.h \
419-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_request.h \
420-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_response.h \
421-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_sptr.h \
422-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_typedefs.h \
423-
\$(DESTDIR)$NXT_INCDIR/nxt_unit_websocket.h \
424-
\$(DESTDIR)$NXT_INCDIR/nxt_auto_config.h \
425-
\$(DESTDIR)$NXT_INCDIR/nxt_version.h \
426-
\$(DESTDIR)$NXT_INCDIR/nxt_websocket_header.h
427-
@rmdir -p \$(DESTDIR)$NXT_INCDIR 2>/dev/null || true
421+
rm -f \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit.h \
422+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_field.h \
423+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_request.h \
424+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_response.h \
425+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_sptr.h \
426+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_typedefs.h \
427+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_websocket.h \
428+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_auto_config.h \
429+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_version.h \
430+
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_websocket_header.h
431+
@rmdir -p \$(DESTDIR)$NXT_INCLUDEDIR 2>/dev/null || true
428432

429433
END
430434

auto/modules/java

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fi
6363
. $NXT_AUTOCONF_DATA
6464

6565

66-
NXT_JARS=${NXT_JARS=$NXT_MODULES}
66+
NXT_JARS=${NXT_JARS=$NXT_MODULESDIR}
6767
NXT_JAVA_MODULE=${NXT_JAVA_MODULE=java}
6868
NXT_JAVA_LIB_PATH=${NXT_JAVA_LIB_PATH=}
6969

@@ -535,9 +535,9 @@ ${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
535535
$NXT_BUILD_DIR/$NXT_UNIT_JAR \\
536536
$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
537537
java-shared-install
538-
install -d \$(DESTDIR)$NXT_MODULES
538+
install -d \$(DESTDIR)$NXT_MODULESDIR
539539
install -p $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
540-
\$(DESTDIR)$NXT_MODULES/
540+
\$(DESTDIR)$NXT_MODULESDIR/
541541
install -d \$(DESTDIR)$NXT_JARS
542542
install -p -m 0644 $NXT_BUILD_DIR/$NXT_UNIT_JAR \$(DESTDIR)$NXT_JARS/
543543
install -p -m 0644 $NXT_BUILD_DIR/$NXT_WS_API_JAR \$(DESTDIR)$NXT_JARS/
@@ -546,8 +546,8 @@ ${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
546546
uninstall: ${NXT_JAVA_MODULE}-uninstall
547547

548548
${NXT_JAVA_MODULE}-uninstall: java-shared-uninstall
549-
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_JAVA_MODULE}.unit.so
550-
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
549+
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_JAVA_MODULE}.unit.so
550+
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
551551
rm -f \$(DESTDIR)$NXT_JARS/$NXT_UNIT_JAR
552552
rm -f \$(DESTDIR)$NXT_JARS/$NXT_WS_API_JAR
553553
@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true

auto/modules/perl

+4-4
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ $NXT_BUILD_DIR/${NXT_PERL_MODULE}.unit.so: $nxt_objs
195195
install: ${NXT_PERL_MODULE}-install
196196

197197
${NXT_PERL_MODULE}-install: ${NXT_PERL_MODULE} install-check
198-
install -d \$(DESTDIR)$NXT_MODULES
198+
install -d \$(DESTDIR)$NXT_MODULESDIR
199199
install -p $NXT_BUILD_DIR/${NXT_PERL_MODULE}.unit.so \\
200-
\$(DESTDIR)$NXT_MODULES/
200+
\$(DESTDIR)$NXT_MODULESDIR/
201201

202202

203203
uninstall: ${NXT_PERL_MODULE}-uninstall
204204

205205
${NXT_PERL_MODULE}-uninstall:
206-
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PERL_MODULE}.unit.so
207-
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
206+
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PERL_MODULE}.unit.so
207+
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
208208

209209
END

auto/modules/php

+4-4
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,15 @@ $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so: $nxt_objs
275275
install: ${NXT_PHP_MODULE}-install
276276

277277
${NXT_PHP_MODULE}-install: ${NXT_PHP_MODULE} install-check
278-
install -d \$(DESTDIR)$NXT_MODULES
278+
install -d \$(DESTDIR)$NXT_MODULESDIR
279279
install -p $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so \\
280-
\$(DESTDIR)$NXT_MODULES/
280+
\$(DESTDIR)$NXT_MODULESDIR/
281281

282282

283283
uninstall: ${NXT_PHP_MODULE}-uninstall
284284

285285
${NXT_PHP_MODULE}-uninstall:
286-
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PHP_MODULE}.unit.so
287-
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
286+
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PHP_MODULE}.unit.so
287+
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
288288

289289
END

auto/modules/python

+4-4
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so: $nxt_objs
223223
install: ${NXT_PYTHON_MODULE}-install
224224

225225
${NXT_PYTHON_MODULE}-install: ${NXT_PYTHON_MODULE} install-check
226-
install -d \$(DESTDIR)$NXT_MODULES
226+
install -d \$(DESTDIR)$NXT_MODULESDIR
227227
install -p $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so \\
228-
\$(DESTDIR)$NXT_MODULES/
228+
\$(DESTDIR)$NXT_MODULESDIR/
229229

230230

231231
uninstall: ${NXT_PYTHON_MODULE}-uninstall
232232

233233
${NXT_PYTHON_MODULE}-uninstall:
234-
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PYTHON_MODULE}.unit.so
235-
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
234+
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PYTHON_MODULE}.unit.so
235+
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
236236

237237
END

auto/modules/ruby

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ $NXT_BUILD_DIR/${NXT_RUBY_MODULE}.unit.so: $nxt_objs
261261
install: ${NXT_RUBY_MODULE}-install
262262

263263
${NXT_RUBY_MODULE}-install: ${NXT_RUBY_MODULE} install-check
264-
install -d \$(DESTDIR)$NXT_MODULES
264+
install -d \$(DESTDIR)$NXT_MODULESDIR
265265
install -p $NXT_BUILD_DIR/${NXT_RUBY_MODULE}.unit.so \\
266-
\$(DESTDIR)$NXT_MODULES/
266+
\$(DESTDIR)$NXT_MODULESDIR/
267267

268268

269269
uninstall: ${NXT_RUBY_MODULE}-uninstall
270270

271271
${NXT_RUBY_MODULE}-uninstall:
272-
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_RUBY_MODULE}.unit.so
273-
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
272+
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_RUBY_MODULE}.unit.so
273+
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
274274

275275
END

auto/options

+50-66
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ NXT_CFLAGS=
99
NXT_CC_OPT=
1010
NXT_LD_OPT=
1111

12-
NXT_PREFIX=
13-
1412
NXT_DEBUG=NO
1513

1614
NXT_INET6=YES
@@ -44,6 +42,8 @@ NXT_TEST_BUILD_HPUX_SENDFILE=NO
4442

4543
NXT_TESTS=NO
4644

45+
NXT_HELP=NO
46+
4747
for nxt_option
4848
do
4949
case "$nxt_option" in
@@ -57,14 +57,35 @@ do
5757
--ld-opt=*) NXT_LD_OPT="$value" ;;
5858

5959
--prefix=*) NXT_PREFIX="$value" ;;
60+
--exec-prefix=*) NXT_EXEC_PREFIX="$value" ;;
6061
--bindir=*) NXT_BINDIR="$value" ;;
6162
--sbindir=*) NXT_SBINDIR="$value" ;;
63+
--includedir=*) NXT_INCLUDEDIR="$value" ;;
64+
--incdir=*)
65+
>&2 echo "[warn] option --incdir is deprecated; use --includedir"
66+
NXT_INCLUDEDIR="$value"
67+
;;
6268
--libdir=*) NXT_LIBDIR="$value" ;;
63-
--incdir=*) NXT_INCDIR="$value" ;;
69+
--modulesdir=*) NXT_MODULESDIR="$value" ;;
70+
--modules=*)
71+
>&2 echo "[warn] option --modules is deprecated; use --modulesdir"
72+
NXT_MODULESDIR="$value"
73+
;;
74+
--datarootdir=*) NXT_DATAROOTDIR="$value" ;;
6475
--mandir=*) NXT_MANDIR="$value" ;;
65-
--modules=*) NXT_MODULES="$value" ;;
66-
--state=*) NXT_STATE="$value" ;;
67-
--tmp=*) NXT_TMP="$value" ;;
76+
--localstatedir=*) NXT_LOCALSTATEDIR="$value" ;;
77+
--libstatedir=*) NXT_LIBSTATEDIR="$value" ;;
78+
--state=*)
79+
>&2 echo "[warn] option --state is deprecated; use --libstatedir"
80+
NXT_LIBSTATEDIR="$value"
81+
;;
82+
--logdir=*) NXT_LOGDIR="$value" ;;
83+
--runstatedir=*) NXT_RUNSTATEDIR="$value" ;;
84+
--tmpdir=*) NXT_TMPDIR="$value" ;;
85+
--tmp=*)
86+
>&2 echo "[warn] option --tmp is deprecated; use --tmpdir"
87+
NXT_TMPDIR="$value"
88+
;;
6889

6990
--pid=*) NXT_PID="$value" ;;
7091
--log=*) NXT_LOG="$value" ;;
@@ -124,63 +145,26 @@ do
124145
done
125146

126147

127-
case "$NXT_PREFIX" in
128-
""|*/) ;;
129-
*) NXT_PREFIX="$NXT_PREFIX/" ;;
130-
esac
131-
132-
case "$NXT_BINDIR" in
133-
/*) ;;
134-
*) NXT_BINDIR="$NXT_PREFIX$NXT_BINDIR" ;;
135-
esac
136-
137-
case "$NXT_SBINDIR" in
138-
/*) ;;
139-
*) NXT_SBINDIR="$NXT_PREFIX$NXT_SBINDIR" ;;
140-
esac
141-
142-
case "$NXT_LIBDIR" in
143-
/*) ;;
144-
*) NXT_LIBDIR="$NXT_PREFIX$NXT_LIBDIR" ;;
145-
esac
146-
147-
case "$NXT_INCDIR" in
148-
/*) ;;
149-
*) NXT_INCDIR="$NXT_PREFIX$NXT_INCDIR" ;;
150-
esac
151-
152-
case "$NXT_MANDIR" in
153-
/*) ;;
154-
*) NXT_MANDIR="$NXT_PREFIX$NXT_MANDIR" ;;
155-
esac
156-
157-
case "$NXT_MODULES" in
158-
/*) ;;
159-
*) NXT_MODULES="$NXT_PREFIX$NXT_MODULES" ;;
160-
esac
161-
162-
case "$NXT_STATE" in
163-
/*) ;;
164-
*) NXT_STATE="$NXT_PREFIX$NXT_STATE" ;;
165-
esac
166-
167-
case "$NXT_TMP" in
168-
/*) ;;
169-
*) NXT_TMP="$NXT_PREFIX$NXT_TMP" ;;
170-
esac
171-
172-
case "$NXT_PID" in
173-
/*) ;;
174-
*) NXT_PID="$NXT_PREFIX$NXT_PID" ;;
175-
esac
176-
177-
case "$NXT_LOG" in
178-
/*) ;;
179-
*) NXT_LOG="$NXT_PREFIX$NXT_LOG" ;;
180-
esac
181-
182-
case "$NXT_CONTROL" in
183-
unix:/*) ;;
184-
unix:*) NXT_CONTROL="unix:$NXT_PREFIX${NXT_CONTROL##unix:}" ;;
185-
*) ;;
186-
esac
148+
NXT_PREFIX="${NXT_PREFIX-"/usr/local"}"
149+
150+
NXT_EXEC_PREFIX="${NXT_EXEC_PREFIX-"$NXT_PREFIX"}"
151+
NXT_BINDIR="${NXT_BINDIR-"$NXT_EXEC_PREFIX/bin"}"
152+
NXT_SBINDIR="${NXT_SBINDIR-"$NXT_EXEC_PREFIX/sbin"}"
153+
154+
NXT_INCLUDEDIR="${NXT_INCLUDEDIR-"$NXT_PREFIX/include"}"
155+
156+
NXT_LIBDIR="${NXT_LIBDIR-"$NXT_PREFIX/lib"}"
157+
NXT_MODULESDIR="${NXT_MODULESDIR-"$NXT_LIBDIR/unit/modules"}"
158+
159+
NXT_DATAROOTDIR="${NXT_DATAROOTDIR-"$NXT_PREFIX/share"}"
160+
NXT_MANDIR="${NXT_MANDIR-"$NXT_DATAROOTDIR/man"}"
161+
162+
NXT_LOCALSTATEDIR="${NXT_LOCALSTATEDIR-"$NXT_PREFIX/var"}"
163+
NXT_LIBSTATEDIR="${NXT_LIBSTATEDIR-"$NXT_LOCALSTATEDIR/lib/unit"}"
164+
NXT_LOGDIR="${NXT_LOGDIR-"$NXT_LOCALSTATEDIR/log/unit"}"
165+
NXT_LOG="${NXT_LOG-"$NXT_LOGDIR/unit.log"}"
166+
NXT_RUNSTATEDIR="${NXT_RUNSTATEDIR-"$NXT_LOCALSTATEDIR/run/unit"}"
167+
NXT_CONTROL="${NXT_CONTROL-"unix:$NXT_RUNSTATEDIR/control.unit.sock"}"
168+
NXT_PID="${NXT_PID-"$NXT_RUNSTATEDIR/unit.pid"}"
169+
170+
NXT_TMPDIR="${NXT_TMPDIR-"/tmp"}"

auto/save

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NXT_LIB_AUX_LIBS=
2828

2929
NXT_LIB_UNIT_STATIC='$NXT_LIB_UNIT_STATIC'
3030

31-
NXT_MODULES='$NXT_MODULES'
32-
NXT_TMP='$NXT_TMP'
31+
NXT_MODULESDIR='$NXT_MODULESDIR'
32+
NXT_TMPDIR='$NXT_TMPDIR'
3333

3434
END

auto/summary

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Unit configuration summary:
1010
bin directory: ............. "$NXT_BINDIR"
1111
sbin directory: ............ "$NXT_SBINDIR"
1212
lib directory: ............. "$NXT_LIBDIR"
13-
include directory: ......... "$NXT_INCDIR"
13+
include directory: ......... "$NXT_INCLUDEDIR"
1414
man pages directory: ....... "$NXT_MANDIR"
15-
modules directory: ......... "$NXT_MODULES"
16-
state directory: ........... "$NXT_STATE"
17-
tmp directory: ............. "$NXT_TMP"
15+
modules directory: ......... "$NXT_MODULESDIR"
16+
state directory: ........... "$NXT_LIBSTATEDIR"
17+
tmp directory: ............. "$NXT_TMPDIR"
1818

1919
pid file: .................. "$NXT_PID"
2020
log file: .................. "$NXT_LOG"

0 commit comments

Comments
 (0)