1
- # Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2018, 2022 , Oracle and/or its affiliates. All rights reserved.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License, version 2.0,
@@ -31,6 +31,45 @@ IF (NOT DEFINED DEB_CODENAME)
31
31
)
32
32
SET (DEB_CODENAME ${DEB_CODENAME} CACHE STRING "" )
33
33
ENDIF ()
34
+
35
+ # debian, ubuntu
36
+ IF (NOT DEFINED DEB_ID )
37
+ execute_process (
38
+ COMMAND lsb_release -is
39
+ OUTPUT_VARIABLE DEB_ID
40
+ OUTPUT_STRIP_TRAILING_WHITESPACE
41
+ )
42
+ SET (DEB_ID ${DEB_ID} CACHE STRING "" )
43
+ ENDIF ()
44
+
45
+ # 22.04, 11.x, etc
46
+ IF (NOT DEFINED DEB_RELEASE )
47
+ execute_process (
48
+ COMMAND lsb_release -rs
49
+ OUTPUT_VARIABLE DEB_RELEASE
50
+ OUTPUT_STRIP_TRAILING_WHITESPACE
51
+ )
52
+ SET (DEB_RELEASE ${DEB_RELEASE} CACHE STRING "" )
53
+ ENDIF ()
54
+
55
+ # Change uppercase first letter of Ubuntu/Debian
56
+ string (TOLOWER "${DEB_ID} " DEB_ID )
57
+
58
+ # lsb_release on Debian reports the full version number, e.g. 9.9, and we just want the major version
59
+ IF (DEB_ID STREQUAL "debian" )
60
+ string (REGEX REPLACE "\\ ..*" "" DEB_RELEASE "${DEB_RELEASE} " )
61
+ ENDIF ()
62
+
63
+ # ubuntu22.04, debian11, etc
64
+ SET (DEB_PLATFORMRELEASE "${DEB_ID}${DEB_RELEASE} " )
65
+
66
+ IF (DEB_CODENAME STREQUAL "sid" )
67
+ IF (DEFINED DEB_GCC_SNAPSHOT )
68
+ SET (DEB_CMAKE_EXTRAS "${DEB_CMAKE_EXTRAS} -DCMAKE_C_COMPILER=/usr/lib/gcc-snapshot/bin/gcc -DCMAKE_CXX_COMPILER=/usr/lib/gcc-snapshot/bin/g++ -DMYSQL_MAINTAINER_MODE=0 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" )
69
+ ENDIF ()
70
+ SET (DEB_PLATFORMRELEASE "debianunstable" )
71
+ ENDIF ()
72
+
34
73
# Timestamp for use in debian/changelog
35
74
IF (NOT DEFINED DEB_CHANGELOG_TIMESTAMP )
36
75
execute_process (
@@ -56,60 +95,6 @@ ELSE()
56
95
SET (DEB_SERVERPRODUCT "community" )
57
96
ENDIF ()
58
97
59
-
60
- # Platform specifics. The differences are generally only distro name used in version string
61
- IF (DEB_CODENAME STREQUAL "stretch" )
62
- SET (DEB_PLATFORMRELEASE "debian9" )
63
- ELSEIF (DEB_CODENAME STREQUAL "buster" )
64
- SET (DEB_PLATFORMRELEASE "debian10" )
65
- ELSEIF (DEB_CODENAME STREQUAL "bullseye" )
66
- SET (DEB_PLATFORMRELEASE "debian11" )
67
- ELSEIF (DEB_CODENAME STREQUAL "sid" )
68
- IF (DEFINED DEB_GCC_SNAPSHOT )
69
- SET (DEB_CMAKE_EXTRAS "${DEB_CMAKE_EXTRAS} -DCMAKE_C_COMPILER=/usr/lib/gcc-snapshot/bin/gcc -DCMAKE_CXX_COMPILER=/usr/lib/gcc-snapshot/bin/g++ -DMYSQL_MAINTAINER_MODE=0 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" )
70
- ENDIF ()
71
- SET (DEB_PLATFORMRELEASE "debianunstable" )
72
- ELSEIF (DEB_CODENAME STREQUAL "xenial" )
73
- SET (DEB_PLATFORMRELEASE "ubuntu16.04" )
74
- # Generate debug symbol packages (this is done automatically in Debian9+)
75
- SET (DEB_RULES_STRIP
76
- "
77
- override_dh_strip:
78
- dh_strip -plibmysqlcppconn9 --dbg-package=libmysqlcppconn9-dbgsym
79
- dh_strip -plibmysqlcppconn8-2 --dbg-package=libmysqlcppconn8-2-dbgsym
80
- " )
81
- SET (DEB_CONTROL_DBGSYM
82
- "
83
- Package: libmysqlcppconn9-dbgsym
84
- Architecture: any
85
- Section: debug
86
- Depends: libmysqlcppconn9 (=\$ {binary:Version}), \$ {misc:Depends}
87
- Description: Debugging symbols for compat library
88
-
89
- Package: libmysqlcppconn8-2-dbgsym
90
- Architecture: any
91
- Section: debug
92
- Depends: libmysqlcppconn8-2 (= \$ {binary:Version}), \$ {misc:Depends}
93
- Description: Debugging symbols for main library
94
- " )
95
- ELSEIF (DEB_CODENAME STREQUAL "bionic" )
96
- SET (DEB_PLATFORMRELEASE "ubuntu18.04" )
97
- ELSEIF (DEB_CODENAME STREQUAL "groovy" )
98
- SET (DEB_PLATFORMRELEASE "ubuntu20.10" )
99
- ELSEIF (DEB_CODENAME STREQUAL "focal" )
100
- SET (DEB_PLATFORMRELEASE "ubuntu20.04" )
101
- ELSEIF (DEB_CODENAME STREQUAL "hirsute" )
102
- SET (DEB_PLATFORMRELEASE "ubuntu21.04" )
103
- ELSEIF (DEB_CODENAME STREQUAL "impish" )
104
- SET (DEB_PLATFORMRELEASE "ubuntu21.10" )
105
- ELSEIF (DEB_CODENAME STREQUAL "jammy" )
106
- SET (DEB_PLATFORMRELEASE "ubuntu22.04" )
107
- ELSE ()
108
- MESSAGE (STATUS
109
- "Skipping deb packaging on unsupported platform ${DEB_CODENAME} ." )
110
- RETURN ()
111
- ENDIF ()
112
-
113
98
# All files are configured and copied to the debian/ directory, which is used
114
99
# by debuild to make the packages
115
100
SET (DEB_ROOT ${CMAKE_SOURCE_DIR} /packaging/deb-in )
0 commit comments