From 3877403043acfbfa57497d3ba51a5ec2db1c77dc Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Sat, 3 Aug 2019 09:35:23 +0100 Subject: [PATCH] Move CGI sources to their own subdirectory Cleanup the code structure a bit by pulling those files only used for the HKP interface into their own directory. --- CMakeLists.txt | 45 ++++++++++++++-------------------- CGI => cgi/CGI | 0 cgi/CMakeLists.txt | 9 +++++++ add.c => cgi/add.c | 0 gpgwww.c => cgi/gpgwww.c | 0 hashquery.c => cgi/hashquery.c | 0 lookup.c => cgi/lookup.c | 0 debian/onak.install | 2 +- 8 files changed, 29 insertions(+), 27 deletions(-) rename CGI => cgi/CGI (100%) create mode 100644 cgi/CMakeLists.txt rename add.c => cgi/add.c (100%) rename gpgwww.c => cgi/gpgwww.c (100%) rename hashquery.c => cgi/hashquery.c (100%) rename lookup.c => cgi/lookup.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6594a8b..4b28688 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,22 +130,31 @@ target_compile_definitions(libonak PRIVATE target_sources(libonak PRIVATE keydb_${DBTYPE}.c) target_link_libraries(libonak ${LIBONAK_LIBRARIES}) +# Build files that have substitutions in them +include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}) +configure_file("${CMAKE_SOURCE_DIR}/build-config.h.in" + "${CMAKE_BINARY_DIR}/build-config.h" @ONLY) + +configure_file("${CMAKE_SOURCE_DIR}/onak.ini.in" + "${CMAKE_BINARY_DIR}/onak.ini" @ONLY) +install(FILES ${CMAKE_BINARY_DIR}/onak.ini + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) + +configure_file("${CMAKE_SOURCE_DIR}/onak-mail.pl.in" + "${CMAKE_BINARY_DIR}/onak-mail.pl" @ONLY) +install(PROGRAMS ${CMAKE_BINARY_DIR}/onak-mail.pl + DESTINATION ${CMAKE_INSTALL_LIBDIR}/onak/) +install(FILES onak-mail.pl.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/) + +# CGI directory +add_subdirectory(cgi) + # Executables start here # Swiss Army tool add_executable(onak onak.c) target_link_libraries(onak libonak) -# CGI -add_executable(add add.c) -target_link_libraries(add libonak) -add_executable(gpgwww gpgwww.c stats.c) -target_link_libraries(gpgwww libonak) -add_executable(hashquery hashquery.c) -target_link_libraries(hashquery libonak) -add_executable(lookup lookup.c) -target_link_libraries(lookup libonak) - # Tools that operate on the key DB add_executable(maxpath maxpath.c stats.c) target_link_libraries(maxpath libonak) @@ -163,22 +172,6 @@ target_link_libraries(stripkey libonak) install(TARGETS onak splitkeys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES onak.1 splitkeys.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) -# Build files that have substitutions in them -include_directories(${CMAKE_BINARY_DIR}) -configure_file("${CMAKE_SOURCE_DIR}/build-config.h.in" - "${CMAKE_BINARY_DIR}/build-config.h" @ONLY) - -configure_file("${CMAKE_SOURCE_DIR}/onak.ini.in" - "${CMAKE_BINARY_DIR}/onak.ini" @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/onak.ini - DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) - -configure_file("${CMAKE_SOURCE_DIR}/onak-mail.pl.in" - "${CMAKE_BINARY_DIR}/onak-mail.pl" @ONLY) -install(PROGRAMS ${CMAKE_BINARY_DIR}/onak-mail.pl - DESTINATION ${CMAKE_INSTALL_LIBDIR}/onak/) -install(FILES onak-mail.pl.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/) - # Basic unit tests enable_testing() add_test(NAME syntaxtest COMMAND perl -cw ${CMAKE_BINARY_DIR}/onak-mail.pl) diff --git a/CGI b/cgi/CGI similarity index 100% rename from CGI rename to cgi/CGI diff --git a/cgi/CMakeLists.txt b/cgi/CMakeLists.txt new file mode 100644 index 0000000..977f2a2 --- /dev/null +++ b/cgi/CMakeLists.txt @@ -0,0 +1,9 @@ +# CGI +add_executable(add add.c) +target_link_libraries(add libonak) +add_executable(gpgwww gpgwww.c ../stats.c) +target_link_libraries(gpgwww libonak) +add_executable(hashquery hashquery.c) +target_link_libraries(hashquery libonak) +add_executable(lookup lookup.c) +target_link_libraries(lookup libonak) diff --git a/add.c b/cgi/add.c similarity index 100% rename from add.c rename to cgi/add.c diff --git a/gpgwww.c b/cgi/gpgwww.c similarity index 100% rename from gpgwww.c rename to cgi/gpgwww.c diff --git a/hashquery.c b/cgi/hashquery.c similarity index 100% rename from hashquery.c rename to cgi/hashquery.c diff --git a/lookup.c b/cgi/lookup.c similarity index 100% rename from lookup.c rename to cgi/lookup.c diff --git a/debian/onak.install b/debian/onak.install index a092913..f747b2d 100644 --- a/debian/onak.install +++ b/debian/onak.install @@ -1,2 +1,2 @@ obj-*/onak.ini etc -obj-*/add obj-*/lookup obj-*/gpgwww obj-*/hashquery usr/lib/cgi-bin/pks +obj-*/cgi/add obj-*/cgi/lookup obj-*/cgi/gpgwww obj-*/cgi/hashquery usr/lib/cgi-bin/pks -- 2.39.5