summaryrefslogtreecommitdiff
path: root/uhub/0001-Install-man-pages.patch
blob: 04bdf6663b2434132f0fbf2d3054b9356a7ad134 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
From ecefce8b7466e4866a47587df4a1364f4f250c5e Mon Sep 17 00:00:00 2001
From: "Christoph J. Thompson" <cjsthompson@gmail.com>
Date: Sat, 13 Dec 2014 22:08:00 +0100
Subject: [PATCH 1/5] * Install man pages * Support multilib distros such as
 fedora/slackware

	modified:   CMakeLists.txt
	renamed:    doc/plugins.conf -> doc/plugins.conf.in
---
 CMakeLists.txt      | 14 ++++++++---
 doc/plugins.conf    | 72 -----------------------------------------------------
 doc/plugins.conf.in | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 76 deletions(-)
 delete mode 100644 doc/plugins.conf
 create mode 100644 doc/plugins.conf.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f3941d..80a1a85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,12 @@ option(USE_OPENSSL "Use OpenSSL's SSL support" ON )
 option(SYSTEMD_SUPPORT "Enable systemd notify and journal logging" OFF)
 option(ADC_STRESS "Enable the stress tester client" OFF)
 
+set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
+set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
+set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/plugins.conf.in plugins.conf @ONLY)
+
 find_package(Git)
 find_package(Sqlite3)
 
@@ -240,9 +246,9 @@ if (LOWLEVEL_DEBUG)
 endif()
 
 if (UNIX)
-	install( TARGETS uhub uhub-passwd RUNTIME DESTINATION bin )
-	install( TARGETS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_history_sqlite mod_chat_only mod_topic mod_no_guest_downloads DESTINATION /usr/lib/uhub/ OPTIONAL )
-	install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/doc/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION /etc/uhub OPTIONAL )
+	install( TARGETS uhub uhub-passwd RUNTIME DESTINATION ${INSTALL_BIN_DIR} )
+	install( TARGETS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_history_sqlite mod_chat_only mod_topic mod_no_guest_downloads DESTINATION ${INSTALL_LIB_DIR}/uhub/ OPTIONAL )
+	install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION /etc/uhub/ OPTIONAL )
+	install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.1 ${CMAKE_SOURCE_DIR}/doc/uhub-passwd.1 DESTINATION ${INSTALL_MAN_DIR}/man1/ OPTIONAL )
 endif()
 
-
diff --git a/doc/plugins.conf b/doc/plugins.conf
deleted file mode 100644
index 6e5a9a0..0000000
--- a/doc/plugins.conf
+++ /dev/null
@@ -1,72 +0,0 @@
-# ATTENTION!
-# Plugins are invoked in the order of listing in the plugin config file.
-
-
-# Sqlite based user authentication.
-#
-# This plugin provides a Sqlite based authentication database for
-# registered users.
-# Use the uhub-passwd utility to create the database and add/remove users.
-#
-# Parameters:
-# file: path/filename for database.
-#
-plugin /usr/lib/uhub/mod_auth_sqlite.so "file=/etc/uhub/users.db"
-
-# Topic commands.
-# Note: "topic" == "hub description" (as configured in uhub.conf)
-#
-# !topic      - change the topic (op required)
-# !showtopic  - show the topic
-# !resettopic - reset the topic to the default (op required)
-#
-# This plugins takes no parameters.
-#plugin /usr/lib/uhub/mod_topic.so
-
-# Log file writer
-#
-# Parameters:
-# file: path/filename for log file.
-# syslog: if true then syslog is used instead of writing to a file (Unix only)
-plugin /usr/lib/uhub/mod_logging.so "file=/var/log/uhub.log"
-
-# A simple example plugin
-#plugin /usr/lib/uhub/mod_example.so
-
-# A plugin sending a welcome message.
-#
-# This plugin provides the following commands:
-# !motd - Message of the day
-# !rules - Show hub rules.
-#
-# Parameters:
-# motd: path/filename for the welcome message (message of the day)
-# rules: path/filenam for the rules file
-#
-# NOTE: The files MUST exist, however if you do not wish to provide one then these parameters can be omitted.
-#
-# The motd/rules files can do the following substitutions:
-# %n - Nickname of the user who entered the hub or issued the command.
-# %a - IP address of the user
-# %c - The credentials of the user (guest, user, op, super, admin).
-# %% - Becomes '%'
-# %H - Hour 24-hour format (00-23) (Hub local time)
-# %I - Hour 12-hour format (01-12) (Hub local time)
-# %P - 'AM' or 'PM'
-# %p - 'am' or 'pm'
-# %M - Minutes (00-59) (Hub local time)
-# %S - Seconds (00-60) (Hub local time)
-plugin /usr/lib/uhub/mod_welcome.so "motd=/etc/uhub/motd.txt rules=/etc/uhub/rules.txt"
-
-# Load the chat history plugin.
-#
-# This plugin provides chat history when users are connecting, or
-# when users invoke the !history command.
-# The history command can optionally take a parameter to indicate how many lines of history is requested.
-#
-# Parameters:
-# history_max:     the maximum number of messages to keep in history
-# history_default: when !history is provided without arguments, then this default number of messages are returned.
-# history_connect: the number of chat history messages to send when users connect (0 = do not send any history)
-plugin /usr/lib/uhub/mod_chat_history.so "history_max=200 history_default=10 history_connect=5"
-
diff --git a/doc/plugins.conf.in b/doc/plugins.conf.in
new file mode 100644
index 0000000..873abcd
--- /dev/null
+++ b/doc/plugins.conf.in
@@ -0,0 +1,72 @@
+# ATTENTION!
+# Plugins are invoked in the order of listing in the plugin config file.
+
+
+# Sqlite based user authentication.
+#
+# This plugin provides a Sqlite based authentication database for
+# registered users.
+# Use the uhub-passwd utility to create the database and add/remove users.
+#
+# Parameters:
+# file: path/filename for database.
+#
+plugin @INSTALL_LIB_DIR@/uhub/mod_auth_sqlite.so "file=/etc/uhub/users.db"
+
+# Topic commands.
+# Note: "topic" == "hub description" (as configured in uhub.conf)
+#
+# !topic      - change the topic (op required)
+# !showtopic  - show the topic
+# !resettopic - reset the topic to the default (op required)
+#
+# This plugins takes no parameters.
+#plugin @INSTALL_LIB_DIR@/uhub/mod_topic.so
+
+# Log file writer
+#
+# Parameters:
+# file: path/filename for log file.
+# syslog: if true then syslog is used instead of writing to a file (Unix only)
+plugin @INSTALL_LIB_DIR@/uhub/mod_logging.so "file=/var/log/uhub.log"
+
+# A simple example plugin
+#plugin @INSTALL_LIB_DIR@/uhub/mod_example.so
+
+# A plugin sending a welcome message.
+#
+# This plugin provides the following commands:
+# !motd - Message of the day
+# !rules - Show hub rules.
+#
+# Parameters:
+# motd: path/filename for the welcome message (message of the day)
+# rules: path/filenam for the rules file
+#
+# NOTE: The files MUST exist, however if you do not wish to provide one then these parameters can be omitted.
+#
+# The motd/rules files can do the following substitutions:
+# %n - Nickname of the user who entered the hub or issued the command.
+# %a - IP address of the user
+# %c - The credentials of the user (guest, user, op, super, admin).
+# %% - Becomes '%'
+# %H - Hour 24-hour format (00-23) (Hub local time)
+# %I - Hour 12-hour format (01-12) (Hub local time)
+# %P - 'AM' or 'PM'
+# %p - 'am' or 'pm'
+# %M - Minutes (00-59) (Hub local time)
+# %S - Seconds (00-60) (Hub local time)
+plugin @INSTALL_LIB_DIR@/uhub/mod_welcome.so "motd=/etc/uhub/motd.txt rules=/etc/uhub/rules.txt"
+
+# Load the chat history plugin.
+#
+# This plugin provides chat history when users are connecting, or
+# when users invoke the !history command.
+# The history command can optionally take a parameter to indicate how many lines of history is requested.
+#
+# Parameters:
+# history_max:     the maximum number of messages to keep in history
+# history_default: when !history is provided without arguments, then this default number of messages are returned.
+# history_connect: the number of chat history messages to send when users connect (0 = do not send any history)
+plugin @INSTALL_LIB_DIR@/uhub/mod_chat_history.so "history_max=200 history_default=10 history_connect=5"
+
-- 
2.1.3