Skip to content

Commit

Permalink
CPack Updates (#408)
Browse files Browse the repository at this point in the history
* Add project description and URL for CPack packaging
* Address cppcheck issues
  • Loading branch information
hummeltech authored Mar 14, 2024
1 parent a404c81 commit c3d9bd2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/actions/cmake/package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
elif [ -f /etc/os-release ]; then
source /etc/os-release
if [ "$ID" = "freebsd" ]; then
echo "CPACK_OPTIONS=-D CPACK_FREEBSD_PACKAGE_LICENSE=GPLv2 -D CPACK_SET_DESTDIR=1 -G FREEBSD" >> ${GITHUB_ENV}
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G FREEBSD" >> ${GITHUB_ENV}
fi
elif [[ ${OSTYPE} == 'darwin'* ]]; then
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G DragNDrop" >> ${GITHUB_ENV}
Expand All @@ -28,7 +28,6 @@ runs:
- name: Package `mod_tile`
run: |
${{ !matrix.image && 'sudo' || '' }} cpack ${CPACK_OPTIONS} \
-D CPACK_PACKAGE_CONTACT="GitHub Actions" \
-D CPACK_PACKAGE_FILE_NAME="${CPACK_PACKAGE_FILE_NAME}" || true
shell: bash --noprofile --norc -euxo pipefail {0}
working-directory: build
Expand Down
21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#
#-----------------------------------------------------------------------------

project(mod_tile VERSION 0.7.0)
project(mod_tile
DESCRIPTION "Renders map tiles with Mapnik and serves them using Apache HTTP Server"
HOMEPAGE_URL "https://github.com/openstreetmap/mod_tile"
VERSION 0.7.0
)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -172,8 +176,6 @@ add_subdirectory(src)
#
#-----------------------------------------------------------------------------

include(CPack)

# Determine install destination for 'etc/apache2/tile.load.in'
if(EXISTS "/etc/os-release")
execute_process(COMMAND sh -c ". /etc/os-release && echo $ID"
Expand Down Expand Up @@ -258,6 +260,19 @@ if(ENABLE_MAN)
)
endif()

#-----------------------------------------------------------------------------
#
# Package
#
#-----------------------------------------------------------------------------

set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_PACKAGE_CONTACT "OpenStreetMap")
set(CPACK_PACKAGE_VENDOR "OpenStreetMap")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")

include(CPack)

#-----------------------------------------------------------------------------
#
# Test
Expand Down
2 changes: 1 addition & 1 deletion src/render_expired.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ int main(int argc, char **argv)
if (n != 3) {
// Discard input line
char tmp[1024];
char *r = fgets(tmp, sizeof(tmp), stdin);
const char *r = fgets(tmp, sizeof(tmp), stdin);

if (!r) {
continue;
Expand Down
3 changes: 1 addition & 2 deletions src/render_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ int main(int argc, char **argv)
spawn_workers(num_threads, socketname, max_load);

if (all) {
int x, y, z;
g_logger(G_LOG_LEVEL_MESSAGE, "Rendering all tiles from zoom %d to zoom %d", min_zoom, max_zoom);

for (z = min_zoom; z <= max_zoom; z++) {
Expand Down Expand Up @@ -400,7 +399,7 @@ int main(int argc, char **argv)
if (n != 3) {
// Discard input line
char tmp[1024];
char *r = fgets(tmp, sizeof(tmp), stdin);
const char *r = fgets(tmp, sizeof(tmp), stdin);

if (!r) {
continue;
Expand Down

0 comments on commit c3d9bd2

Please sign in to comment.