| 1 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 |
# ----------------------------------------------------------------------------- |
| 3 |
# libcockpit-ws.a: code used in cockpit-ws and its tests |
| 4 |
|
| 5 |
noinst_LIBRARIES += libcockpit-ws.a |
| 6 |
|
| 7 |
libcockpit_ws_a_CPPFLAGS = \ |
| 8 |
-DG_LOG_DOMAIN=\"cockpit-ws\" \ |
| 9 |
$(glib_CFLAGS) \ |
| 10 |
$(json_glib_CFLAGS) \ |
| 11 |
$(AM_CPPFLAGS) |
| 12 |
|
| 13 |
libcockpit_ws_a_LIBS = \ |
| 14 |
libcockpit-ws.a \ |
| 15 |
$(libcockpit_common_a_LIBS) \ |
| 16 |
$(glib_LIBS) \ |
| 17 |
$(json_glib_LIBS) \ |
| 18 |
$(libsystemd_LIBS) \ |
| 19 |
-lutil \ |
| 20 |
-lcrypt \ |
| 21 |
$(NULL) |
| 22 |
|
| 23 |
libcockpit_ws_a_SOURCES = \ |
| 24 |
src/ws/cockpitauth.c \ |
| 25 |
src/ws/cockpitauth.h \ |
| 26 |
src/ws/cockpitbranding.c \ |
| 27 |
src/ws/cockpitbranding.h \ |
| 28 |
src/ws/cockpitchannel.c \ |
| 29 |
src/ws/cockpitchannel.h \ |
| 30 |
src/ws/cockpitchannelresponse.c \ |
| 31 |
src/ws/cockpitchannelresponse.h \ |
| 32 |
src/ws/cockpitchannelsocket.c \ |
| 33 |
src/ws/cockpitchannelsocket.h \ |
| 34 |
src/ws/cockpitcontrolmessages.c \ |
| 35 |
src/ws/cockpitcontrolmessages.h \ |
| 36 |
src/ws/cockpitcreds.h src/ws/cockpitcreds.c \ |
| 37 |
src/ws/cockpiterror.c \ |
| 38 |
src/ws/cockpiterror.h \ |
| 39 |
src/ws/cockpitflow.c \ |
| 40 |
src/ws/cockpitflow.h \ |
| 41 |
src/ws/cockpithandlers.c \ |
| 42 |
src/ws/cockpithandlers.h \ |
| 43 |
src/ws/cockpithash.c \ |
| 44 |
src/ws/cockpithash.h \ |
| 45 |
src/ws/cockpitjson.c \ |
| 46 |
src/ws/cockpitjson.h \ |
| 47 |
src/ws/cockpitlocale.c \ |
| 48 |
src/ws/cockpitlocale.h \ |
| 49 |
src/ws/cockpitmemfdread.c \ |
| 50 |
src/ws/cockpitmemfdread.h \ |
| 51 |
src/ws/cockpitpipe.c \ |
| 52 |
src/ws/cockpitpipe.h \ |
| 53 |
src/ws/cockpitpipetransport.c \ |
| 54 |
src/ws/cockpitpipetransport.h \ |
| 55 |
src/ws/cockpitsocket.c \ |
| 56 |
src/ws/cockpitsocket.h \ |
| 57 |
src/ws/cockpitsystem.c \ |
| 58 |
src/ws/cockpitsystem.h \ |
| 59 |
src/ws/cockpittemplate.c \ |
| 60 |
src/ws/cockpittemplate.h \ |
| 61 |
src/ws/cockpittransport.c \ |
| 62 |
src/ws/cockpittransport.h \ |
| 63 |
src/ws/cockpitunicode.c \ |
| 64 |
src/ws/cockpitunicode.h \ |
| 65 |
src/ws/cockpitwebfilter.c \ |
| 66 |
src/ws/cockpitwebfilter.h \ |
| 67 |
src/ws/cockpitwebinject.c \ |
| 68 |
src/ws/cockpitwebinject.h \ |
| 69 |
src/ws/cockpitwebrequest-private.h \ |
| 70 |
src/ws/cockpitwebresponse.c \ |
| 71 |
src/ws/cockpitwebresponse.h \ |
| 72 |
src/ws/cockpitwebserver.c \ |
| 73 |
src/ws/cockpitwebserver.h \ |
| 74 |
src/ws/cockpitwebservice.c \ |
| 75 |
src/ws/cockpitwebservice.h \ |
| 76 |
src/ws/cockpitws.h \ |
| 77 |
src/ws/websocket.c \ |
| 78 |
src/ws/websocket.h \ |
| 79 |
src/ws/websocketclient.c \ |
| 80 |
src/ws/websocketclient.h \ |
| 81 |
src/ws/websocketconnection.c \ |
| 82 |
src/ws/websocketconnection.h \ |
| 83 |
src/ws/websocketprivate.h \ |
| 84 |
src/ws/websocketserver.c \ |
| 85 |
src/ws/websocketserver.h \ |
| 86 |
$(NULL) |
| 87 |
|
| 88 |
# libcockpit-ws.a static-links an HTML template to use on failures |
| 89 |
nodist_libcockpit_ws_a_SOURCES = src/ws/fail-html.c |
| 90 |
src/ws/fail-html.c: src/common/fail.html |
| 91 |
@mkdir -p '$(dir $@)' |
| 92 |
$(AM_V_GEN) $(top_srcdir)/tools/escape-to-c cockpit_webresponse_fail_html_text < $< > [email protected] && mv [email protected] $@ |
| 93 |
CLEANFILES += src/ws/fail-html.c |
| 94 |
|
| 95 |
# ----------------------------------------------------------------------------- |
| 96 |
# cockpit-ws |
| 97 |
|
| 98 |
cockpitwsdir = $(libexecdir) |
| 99 |
cockpitws_PROGRAMS = cockpit-ws |
| 100 |
|
| 101 |
cockpit_ws_SOURCES = \ |
| 102 |
src/ws/main.c \ |
| 103 |
$(NULL) |
| 104 |
|
| 105 |
cockpit_ws_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) |
| 106 |
cockpit_ws_LDADD = $(libcockpit_ws_a_LIBS) |
| 107 |
|
| 108 |
# ----------------------------------------------------------------------------- |
| 109 |
# test-server: server for running the html/browser unit tests against |
| 110 |
|
| 111 |
check_PROGRAMS += test-server |
| 112 |
|
| 113 |
test_server_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 114 |
test_server_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 115 |
|
| 116 |
test_server_SOURCES = \ |
| 117 |
src/ws/mock-service.c \ |
| 118 |
src/ws/mock-service.h \ |
| 119 |
src/ws/test-server.c \ |
| 120 |
$(NULL) |
| 121 |
|
| 122 |
test_server_CPPFLAGS += -I$(top_builddir)/src/ws |
| 123 |
nodist_test_server_SOURCES = $(GDBUS_CODEGEN_GENERATED) |
| 124 |
|
| 125 |
BUILT_SOURCES += $(GDBUS_CODEGEN_GENERATED) |
| 126 |
CLEANFILES += $(GDBUS_CODEGEN_GENERATED) |
| 127 |
GDBUS_CODEGEN_GENERATED = \ |
| 128 |
src/ws/mock-dbus-tests.h \ |
| 129 |
src/ws/mock-dbus-tests.c \ |
| 130 |
$(NULL) |
| 131 |
|
| 132 |
EXTRA_DIST += $(GDBUS_CODEGEN_XML) |
| 133 |
GDBUS_CODEGEN_XML = $(srcdir)/src/ws/com.redhat.Cockpit.DBusTests.xml |
| 134 |
|
| 135 |
GDBUS_CODEGEN_INVOCATION = \ |
| 136 |
$(AM_V_GEN) gdbus-codegen \ |
| 137 |
--interface-prefix com.redhat.Cockpit.DBusTests \ |
| 138 |
--c-namespace Test \ |
| 139 |
--c-generate-object-manager \ |
| 140 |
$(NULL) |
| 141 |
|
| 142 |
src/ws/mock-dbus-tests.h: $(GDBUS_CODEGEN_XML) |
| 143 |
$(GDBUS_CODEGEN_INVOCATION) --header --output $@ $< |
| 144 |
|
| 145 |
src/ws/mock-dbus-tests.c: $(GDBUS_CODEGEN_XML) |
| 146 |
$(GDBUS_CODEGEN_INVOCATION) --body --output $@ $< |
| 147 |
|
| 148 |
# ----------------------------------------------------------------------------- |
| 149 |
# Unit tests |
| 150 |
|
| 151 |
dist_check_DATA += src/ws/mock-content |
| 152 |
check_SCRIPTS += src/ws/mock-cat-with-init |
| 153 |
|
| 154 |
check_PROGRAMS += frob-websocket |
| 155 |
frob_websocket_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 156 |
frob_websocket_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 157 |
frob_websocket_SOURCES = src/ws/frob-websocket.c |
| 158 |
|
| 159 |
TEST_PROGRAM += test-websocket |
| 160 |
test_websocket_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 161 |
test_websocket_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 162 |
test_websocket_SOURCES = src/ws/test-websocket.c |
| 163 |
|
| 164 |
TEST_PROGRAM += test-channel |
| 165 |
test_channel_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 166 |
test_channel_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 167 |
test_channel_SOURCES = src/ws/test-channel.c |
| 168 |
|
| 169 |
TEST_PROGRAM += test-hash |
| 170 |
test_hash_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 171 |
test_hash_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 172 |
test_hash_SOURCES = src/ws/test-hash.c |
| 173 |
|
| 174 |
TEST_PROGRAM += test-json |
| 175 |
test_json_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 176 |
test_json_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 177 |
test_json_SOURCES = src/ws/test-json.c |
| 178 |
|
| 179 |
TEST_PROGRAM += test-jsonfds |
| 180 |
test_jsonfds_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 181 |
test_jsonfds_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 182 |
test_jsonfds_SOURCES = src/ws/test-jsonfds.c |
| 183 |
|
| 184 |
TEST_PROGRAM += test-locale |
| 185 |
test_locale_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 186 |
test_locale_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 187 |
test_locale_SOURCES = src/ws/test-locale.c |
| 188 |
|
| 189 |
TEST_PROGRAM += test-pipe |
| 190 |
test_pipe_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 191 |
test_pipe_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 192 |
test_pipe_SOURCES = src/ws/test-pipe.c |
| 193 |
|
| 194 |
TEST_PROGRAM += test-template |
| 195 |
test_template_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 196 |
test_template_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 197 |
test_template_SOURCES = src/ws/test-template.c |
| 198 |
|
| 199 |
TEST_PROGRAM += test-transport |
| 200 |
test_transport_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 201 |
test_transport_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 202 |
test_transport_SOURCES = src/ws/test-transport.c |
| 203 |
|
| 204 |
TEST_PROGRAM += test-unicode |
| 205 |
test_unicode_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 206 |
test_unicode_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 207 |
test_unicode_SOURCES = src/ws/test-unicode.c |
| 208 |
|
| 209 |
TEST_PROGRAM += test-webresponse |
| 210 |
test_webresponse_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 211 |
test_webresponse_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 212 |
test_webresponse_SOURCES = src/ws/test-webresponse.c |
| 213 |
|
| 214 |
TEST_PROGRAM += test-webserver |
| 215 |
test_webserver_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 216 |
test_webserver_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 217 |
test_webserver_SOURCES = src/ws/test-webserver.c |
| 218 |
|
| 219 |
check_PROGRAMS += mock-echo |
| 220 |
mock_echo_CPPFLAGS = $(glib_CFLAGS) $(AM_CPPFLAGS) |
| 221 |
mock_echo_LDADD = $(glib_LIBS) |
| 222 |
mock_echo_SOURCES = src/ws/mock-echo.c |
| 223 |
|
| 224 |
check_PROGRAMS += mock-auth-command |
| 225 |
mock_auth_command_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 226 |
mock_auth_command_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 227 |
mock_auth_command_SOURCES = src/ws/mock-auth-command.c src/session/session-utils.c |
| 228 |
|
| 229 |
TEST_PROGRAM += test-auth |
| 230 |
test_auth_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 231 |
test_auth_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 232 |
test_auth_SOURCES = src/ws/test-auth.c |
| 233 |
|
| 234 |
TEST_PROGRAM += test-creds |
| 235 |
test_creds_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 236 |
test_creds_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 237 |
test_creds_SOURCES = src/ws/test-creds.c |
| 238 |
|
| 239 |
TEST_PROGRAM += test-kerberos |
| 240 |
test_kerberos_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 241 |
test_kerberos_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) $(krb5_LIBS) |
| 242 |
test_kerberos_SOURCES = src/ws/test-kerberos.c |
| 243 |
|
| 244 |
TEST_PROGRAM += test-branding |
| 245 |
test_branding_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP) |
| 246 |
test_branding_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS) |
| 247 |
test_branding_SOURCES = src/ws/test-branding.c |
| 248 |
|
| 249 |
noinst_PROGRAMS += mock-pam-conv-mod.so |
| 250 |
mock_pam_conv_mod_so_SOURCES = src/ws/mock-pam-conv-mod.c |
| 251 |
mock_pam_conv_mod_so_CFLAGS = -fPIC $(AM_CFLAGS) |
| 252 |
mock_pam_conv_mod_so_LDFLAGS = -shared |
| 253 |
mock_pam_conv_mod_so_LDADD = $(PAM_LIBS) |
| 254 |
|
| 255 |
install-tests:: |
| 256 |
mkdir -p $(DESTDIR)$(pamdir) |
| 257 |
$(INSTALL_PROGRAM) mock-pam-conv-mod.so $(DESTDIR)$(pamdir)/ |
| 258 |
|
| 259 |
install-exec-hook:: |
| 260 |
mkdir -p $(DESTDIR)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(sysconfdir)/cockpit/machines.d |
| 261 |
chmod 755 $(DESTDIR)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(sysconfdir)/cockpit/machines.d |
| 262 |
|
| 263 |
dist_check_DATA += \ |
| 264 |
src/ws/mock-combined.crt \ |
| 265 |
src/ws/mock-cat-with-init \ |
| 266 |
src/ws/mock-kdc \ |
| 267 |
src/ws/mock-krb5.conf.in \ |
| 268 |
src/ws/mock-kdc.conf.in \ |
| 269 |
src/ws/mock-static \ |
| 270 |
src/ws/mock-pipes/exit127 \ |
| 271 |
src/ws/mock-pipes/someprogram \ |
| 272 |
src/ws/mock-pipes/cockpit-session \ |
| 273 |
$(NULL) |
| 274 |
|
| 275 |
appdatadir = $(datadir)/metainfo |
| 276 |
nodist_appdata_DATA = src/ws/org.cockpit_project.cockpit.appdata.xml |
| 277 |
appdata_in = src/ws/org.cockpit_project.cockpit.appdata.xml.in |
| 278 |
$(nodist_appdata_DATA): $(appdata_in) $(PO_FILES) |
| 279 |
$(AM_V_GEN) msgfmt --xml -d $(top_srcdir)/po --template $< --output $@ |
| 280 |
CLEANFILES += $(nodist_appdata_DATA) |
| 281 |
EXTRA_DIST += $(appdata_in) |
| 282 |
|
| 283 |
icons128dir = ${datarootdir}/icons/hicolor/128x128/apps |
| 284 |
dist_icons128_DATA = src/ws/cockpit.png |
| 285 |
|
| 286 |
libexec_SCRIPTS += src/ws/cockpit-desktop |