Skip to content

Commit 50944af

Browse files
committed
Release: Initial work on generating Debian packages
1 parent 92ead13 commit 50944af

File tree

11 files changed

+64
-4
lines changed

11 files changed

+64
-4
lines changed

CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
cmake_minimum_required(VERSION 3.10)
33

44
include(CheckSymbolExists)
5+
include(GNUInstallDirs)
56

67
# set the project name
78
project(libgeek VERSION 1.0)
@@ -15,8 +16,8 @@ SET(CMAKE_C_FLAGS "${FLAGS_COMMON}")
1516
SET(CMAKE_CXX_FLAGS "${FLAGS_COMMON}")
1617
SET(CMAKE_C_FLAGS_DEBUG "${FLAGS_COMMON} -O0 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
1718
SET(CMAKE_CXX_FLAGS_DEBUG "${FLAGS_COMMON} -O0 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
18-
SET(CMAKE_C_FLAGS_RELEASE "${FLAGS_COMMON} -O3")
19-
SET(CMAKE_CXX_FLAGS_RELEASE "${FLAGS_COMMON} -O3")
19+
SET(CMAKE_C_FLAGS_RELEASE "${FLAGS_COMMON} -O3 -s")
20+
SET(CMAKE_CXX_FLAGS_RELEASE "${FLAGS_COMMON} -O3 -s")
2021

2122
find_package(PkgConfig REQUIRED)
2223

@@ -49,3 +50,27 @@ string(REPLACE ";" " " PKGCONFIG_LDFLAGS "${PKGCONFIG_LDFLAGS_LIST}")
4950
configure_file(libgeek.pc.in libgeek.pc @ONLY)
5051
install(FILES ${CMAKE_BINARY_DIR}/libgeek.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
5152

53+
include(InstallRequiredSystemLibraries)
54+
set(CPACK_PACKAGE_CONTACT "Ian Parker <[email protected]>")
55+
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
56+
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
57+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Useful code from GeekProjects")
58+
set(CPACK_PACKAGE_DESCRIPTION "A small library of various useful code.")
59+
60+
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
61+
set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}")
62+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2-dev (>= 2.9), libpng-dev (>= 1.6), libjpeg-dev (>= 8c), sqlite3 (>= 3), libsqlite0-dev (>= 2.8), libsigc++-2.0-dev (>= 2), libfreetype6-dev (>= 2.10)")
63+
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
64+
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
65+
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION YES)
66+
if (CPACK_GENERATOR MATCHES "DEB")
67+
# lintian complains changelog-file-missing-in-native-package, this fixes it,
68+
execute_process(COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog.bak)
69+
execute_process(COMMAND gzip -9 -f -n ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog)
70+
execute_process(COMMAND mv ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog.bak ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog)
71+
install(FILES debian/changelog.gz DESTINATION ${CMAKE_INSTALL_DOCDIR}/libgeek)
72+
install(FILES debian/copyright DESTINATION ${CMAKE_INSTALL_DOCDIR}/libgeek)
73+
endif (CPACK_GENERATOR MATCHES "DEB")
74+
75+
include(CPack)
76+

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
libgeek (1.0.0) unstable; urgency=low
2+
3+
* Initial release.
4+
5+
-- Ian Parker <[email protected]> Sat, 12 Sep 2020 14:14:40 +0100

debian/changelog.gz

138 Bytes
Binary file not shown.

debian/control

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Source: libgeek
2+
Section: libs
3+
Priority: extra
4+
Maintainer: Ian Parker <[email protected]>
5+
Build-Depends: libxml2-dev (>= 2.9), libpng-dev (>= 1.6), libjpeg-dev (>= 8c), sqlite3 (>= 3), libsqlite0-dev (>= 2.8), libsigc++-2.0-dev (>= 2), libfreetype6-dev (>= 2.10)
6+
Standards-Version:
7+
Homepage: http://seancode.com/minutor/
8+
9+
Package: minutor
10+
Architecture: any
11+
Depends: ${shlibs:Depends}, ${misc:Depends}
12+
Description: Minecraft mapping tool
13+
Minutor lets you view and inspect your Minecraft worlds.
14+
It is designed for Minecraft 1.2 and later.

debian/copyright

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: libgeek
3+
Upstream-Contact: Ian Parker <[email protected]>
4+
Source: https://github.com/geekprojects/libgeek
5+
6+
Files: *
7+
Copyright: 2014-2020, Ian Parker
8+
License: LGPL-3+
9+
10+
Files: src/core/sha/*
11+
Copyright: 2011 IETF Trust and the persons identified as authors of the code.
12+
License: BSD-3-clause

debian/files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
minutor_1.0.0_amd64.deb libs extra

debian/rules

Whitespace-only changes.

libgeek.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
prefix=@CMAKE_INSTALL_PREFIX@
44
exec_prefix=${prefix}
5-
libdir=${prefix}/lib
6-
includedir=${prefix}/include
75
bindir=${prefix}/bin
6+
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
7+
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
88

99
Name: libgeek
1010
Description: GeekProjects.com's utility library

src/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ file.cpp random.cpp tasks.cpp thread.cpp xml.
1010
add_definitions(${sigcpp_CFLAGS} ${libxml2_CFLAGS})
1111

1212
target_link_libraries(geek-core ${sigcpp_LDFLAGS} ${libxml2_LIBRARIES} ${SQLITE3_LIBRARY} ${z_LIBRARY} sha)
13+
set_target_properties(geek-core PROPERTIES VERSION ${PROJECT_VERSION})
1314

1415
install(TARGETS geek-core DESTINATION lib)
1516

src/fonts/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ADD_LIBRARY(geek-fonts SHARED
99
add_definitions(${freetype2_CFLAGS})
1010

1111
target_link_libraries(geek-fonts ${freetype2_LDFLAGS} geek-core)
12+
set_target_properties(geek-fonts PROPERTIES VERSION ${PROJECT_VERSION})
1213

1314
install(TARGETS geek-fonts DESTINATION lib)
1415

0 commit comments

Comments
 (0)