File: packaging.cmake

package info (click to toggle)
cadabra2 2.4.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,796 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (227 lines) | stat: -rwxr-xr-x 15,309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Logic to build packages (RPM/DEB) using CPack; see https://cmake.org/Wiki/CMake:Packaging_With_CPack
# 

if(MSVC)
  set(CPACK_GENERATOR "NSIS")
  message("-- This is a Windows system")
endif()

set(LINUX_NAME "")
set(IS_DEBIAN_PACKAGE FALSE)
if(EXISTS "/etc/redhat-release")
   file(READ "/etc/redhat-release" LINUX_ISSUE)
   if(LINUX_ISSUE MATCHES "CentOS")
       set(CPACK_GENERATOR "RPM")
       set(CPACK_SYSTEM_NAME "centos")
		 set(CPACK_RPM_PACKAGE_REQUIRES   "centos-release-scl, epel-release, rh-python36, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, dvipng, texlive, texlive-ytableau")
       message("-- This is a CentOS system")
   endif()
   if(LINUX_ISSUE MATCHES "Scientific Linux")
       set(CPACK_GENERATOR "RPM")
       set(CPACK_SYSTEM_NAME "scientific7x")
		 set(CPACK_RPM_PACKAGE_REQUIRES   "yum-conf-softwarecollections, epel-release, rh-python36, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, dvipng, texlive, texlive-ytableau")
       message("-- This is a CentOS system")
   endif()
   if(LINUX_ISSUE MATCHES "Fedora")
       set(CPACK_GENERATOR   "RPM")
		 if(LINUX_ISSUE MATCHES "26")
			message("-- This is a Fedora 26 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora26")
		 elseif(LINUX_ISSUE MATCHES "27")
			message("-- This is a Fedora 27 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora27")
		 elseif(LINUX_ISSUE MATCHES "28")
			message("-- This is a Fedora 28 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora28")
		 elseif(LINUX_ISSUE MATCHES "29")
			message("-- This is a Fedora 29 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora29")
		 elseif(LINUX_ISSUE MATCHES "32")
			message("-- This is a Fedora 32 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora32")
		 elseif(LINUX_ISSUE MATCHES "33")
			message("-- This is a Fedora 33 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora33")
		 elseif(LINUX_ISSUE MATCHES "35")
			message("-- This is a Fedora 35 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, python3-sympy, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora35")
		 elseif(LINUX_ISSUE MATCHES "24")
			message("-- This is a Fedora 24 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora24")
		 else()	
			message("-- This is a Fedora <24 system")
			set(CPACK_RPM_PACKAGE_REQUIRES   "python-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python-matplotlib, dvipng, texlive, texlive-ytableau")
			set(CPACK_SYSTEM_NAME "fedora")
		 endif()
   endif()
else()
   if(EXISTS "/etc/os-release")
     file(READ "/etc/os-release" LINUX_ISSUE)
	  if(LINUX_ISSUE MATCHES "15.0")
   	 set(CPACK_SYSTEM_NAME "leap150")
		 set(CPACK_GENERATOR   "RPM")
		 message("-- This is an openSUSE Leap 15.0 system")
		 set(CPACK_RPM_PACKAGE_REQUIRES   "libpython3_6m1_0, libgmp10, libuuid1, libsqlite3-0, libgtkmm-3_0-1, libboost_system1_66_0, libboost_filesystem1_66_0, libboost_program_options1_66_0, libboost_regex1_66_0, libstdc++6, python3-matplotlib, python3-sympy, texlive-dvipng, texlive, texlive-ytableau")
	  endif()
	  if(LINUX_ISSUE MATCHES "Tumbleweed")
   	 set(CPACK_SYSTEM_NAME "tumbleweed")
		 set(CPACK_GENERATOR   "RPM")
		 message("-- This is an openSUSE Tumbleweed system")
		 set(CPACK_RPM_PACKAGE_REQUIRES   "libpython3_7m1_0, libgmp10, libuuid1, libsqlite3-0, libgtkmm-3_0-1, libboost_system1_71_0, libboost_filesystem1_71_0, libboost_program_options1_71_0, libboost_regex1_71_0, libstdc++6, python3-matplotlib, python3-sympy, texlive-dvipng, texlive, texlive-ytableau")
	  endif()
	endif()
   if(EXISTS "/etc/issue")
      file(READ "/etc/issue" LINUX_ISSUE)
      if(LINUX_ISSUE MATCHES "openSUSE")
		  if(LINUX_ISSUE MATCHES "42.1")
   		 set(CPACK_SYSTEM_NAME "leap421")
			 set(CPACK_GENERATOR   "RPM")
			 message("-- This is an openSUSE Leap 42.1 system")
			 set(CPACK_RPM_PACKAGE_REQUIRES   "libpython3_4m1_0, libgmp10, libuuid1, libsqlite3-0, libgtkmm-3_0-1, libboost_system1_61_0, libboost_filesystem1_61_0, libboost_program_options1_61_0, libboost_regex1_61_0, libstdc++6, python3-matplotlib, texlive-dvipng, texlive, texlive-ytableau")
		  endif()
      endif()
      if(LINUX_ISSUE MATCHES "Debian")
        set(CPACK_GENERATOR   "DEB")
        set(IS_DEBIAN_PACKAGE TRUE)
		  if(PACKAGING_MODE)
			 set(PYTHON_SITE_PATH  "/usr/lib/python3/dist-packages")
			 set(INSTALL_LATEX_DIR  "/usr/share/texmf")
		  endif()
		  if(LINUX_ISSUE MATCHES "8")
   		 set(CPACK_SYSTEM_NAME "jessie")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.55.0, libboost-filesystem1.55.0, libboost-program-options1.55.0, libboost-regex1.55.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   		 message("-- This is a Debian Jessie 8.x system")
		  endif()
		  if(LINUX_ISSUE MATCHES "9")
   		 set(CPACK_SYSTEM_NAME "stretch")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.62.0, libboost-filesystem1.62.0, libboost-program-options1.62.0, libboost-regex1.62.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   		 message("-- This is a Debian Stretch 9.x system")
		  endif()
		  if(LINUX_ISSUE MATCHES "buster")
   		 set(CPACK_SYSTEM_NAME "buster")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.67.0, libboost-filesystem1.67.0, libboost-program-options1.67.0, libboost-regex1.67.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   		 message("-- This is a Debian Buster 10.x system")
		  endif()
		  if(LINUX_ISSUE MATCHES "10")
   		 set(CPACK_SYSTEM_NAME "buster")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.67.0, libboost-filesystem1.67.0, libboost-program-options1.67.0, libboost-regex1.67.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   		 message("-- This is a Debian Buster 10.x system")
		  endif()
		endif()
      if(LINUX_ISSUE MATCHES "Ubuntu")
        set(CPACK_GENERATOR   "DEB")
        set(IS_DEBIAN_PACKAGE TRUE)
		  if(PACKAGING_MODE)
			 set(PYTHON_SITE_PATH  "/usr/lib/python3/dist-packages")
			 set(INSTALL_LATEX_DIR  "/usr/share/texmf")
		  endif()
		  if(LINUX_ISSUE MATCHES "14.04")
   		 set(CPACK_SYSTEM_NAME "trusty")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.54.0, libboost-filesystem1.54.0, libboost-program-options1.54.0, libboost-regex1.54.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python-sympy")
   		 message("-- This is an Ubuntu 14.04 system")
		  endif()
		  if(LINUX_ISSUE MATCHES "16.04")
   		 set(CPACK_SYSTEM_NAME "xenial")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.58.0, libboost-filesystem1.58.0, libboost-program-options1.58.0, libboost-regex1.58.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-math-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   	  message("-- This is an Ubuntu 16.04 system")
		  endif()
		  if(LINUX_ISSUE MATCHES "17.10")
   		 set(CPACK_SYSTEM_NAME "artful")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.62.0, libboost-filesystem1.62.0, libboost-program-options1.62.0, libboost-regex1.62.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-math-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   	  message("-- This is an Ubuntu 17.10 system")
		  endif()
		  if(LINUX_ISSUE MATCHES "18.04")
   		 set(CPACK_SYSTEM_NAME "bionic")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.65.1, libboost-filesystem1.65.1, libboost-program-options1.65.1, libboost-regex1.65.1, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-math-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   	  message("-- This is an Ubuntu 18.04 system")
		  endif()
		  if(LINUX_ISSUE MATCHES "20.04")
   		 set(CPACK_SYSTEM_NAME "focal")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.71.0, libboost-filesystem1.71.0, libboost-program-options1.71.0, libboost-regex1.71.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   	  message("-- This is an Ubuntu 20.04 system")
		  endif()
		  if(LINUX_ISSUE MATCHES "22.04")
   		 set(CPACK_SYSTEM_NAME "jammy")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.74.0, libboost-filesystem1.74.0, libboost-program-options1.74.0, libboost-regex1.74.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
   	  message("-- This is an Ubuntu 22.04 system")
		  endif()
      endif()
      if(LINUX_ISSUE MATCHES "Mint")
         set(CPACK_GENERATOR "DEB")
         set(IS_DEBIAN_PACKAGE TRUE)
		  if(PACKAGING_MODE)
			 set(PYTHON_SITE_PATH   "/usr/lib/python3/dist-packages")
			 set(INSTALL_LATEX_DIR  "/usr/share/texmf")
		  endif()
		  if(LINUX_ISSUE MATCHES "20")
   		 message("-- This is a Linux Mint 20 system")
   		 set(CPACK_SYSTEM_NAME "ulyana")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.71.0, libboost-filesystem1.71.0, libboost-program-options1.71.0, libboost-regex1.71.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
		  endif()
		  if(LINUX_ISSUE MATCHES "19")
   		 message("-- This is a Linux Mint 19 system")
   		 set(CPACK_SYSTEM_NAME "tessa")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.65.1, libboost-filesystem1.65.1, libboost-program-options1.65.1, libboost-regex1.65.1, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
		  endif()
		  if(LINUX_ISSUE MATCHES "18")
   		 message("-- This is a Linux Mint 18 system")
   		 set(CPACK_SYSTEM_NAME "sarah")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.58.0, libboost-filesystem1.58.0, libboost-program-options1.58.0, libboost-regex1.58.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1v5, texlive, texlive-latex-extra, texlive-math-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy, python3-gmpy2")
		  endif()
		  if(LINUX_ISSUE MATCHES "17")
   		 set(CPACK_SYSTEM_NAME "qiana")
   		 message("-- This is a Linux Mint 17 system")
			 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libgmpxx4ldbl, libboost-system1.54.0, libboost-filesystem1.54.0, libboost-program-options1.54.0, libboost-regex1.54.0, libstdc++6, uuid-runtime, libgtkmm-3.0-1, texlive, texlive-latex-extra, texlive-math-extra, texlive-science, python3-matplotlib, python3-mpmath, dvipng, python3-sympy")
		  endif()
      endif()
   endif()
endif()

# Ensure that on Windows we also install the libraries provided
# by Visual Studio, e.g. MSVCnnn.DLL. This does mean that the installer
# will now contain both the normal and the debug libraries, but better
# to have both than to have none.
#   set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
# That didn't work... Commented out for future reference.

include (InstallRequiredSystemLibraries)

set(CPACK_SET_DESTDIR true)
set(CPACK_INSTALL_PREFIX /usr)
set(CPACK_PACKAGE_NAME           "cadabra2")
set(CPACK_RESOURCE_FILE_LICENSE  "${CMAKE_CURRENT_SOURCE_DIR}/doc/license.txt")
set(CPACK_RPM_PACKAGE_LICENSE    "GPLv3")
set(CPACK_PACKAGE_VERSION_MAJOR  "${CADABRA_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR  "${CADABRA_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH  "${CADABRA_VERSION_PATCH}")
if(NOT "${CADABRA_VERSION_TWEAK}" STREQUAL "0")
  set(CPACK_PACKAGE_VERSION_TWEAK  "${CADABRA_VERSION_TWEAK}")
  set(CPACK_PACKAGE_VERSION        "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_TWEAK}")
  message("-- Building tweak version")
else()
  message("-- Building normal version (no tweak)")
endif()
set(CPACK_PACKAGE_VENDOR         "Kasper Peeters")
set(CPACK_PACKAGE_CONTACT        "Kasper Peeters <kasper.peeters@phi-sci.com>")
set(CPACK_STRIP_FILES            ON)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_BINARY_DIR}/postinst)
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/postinst)
#set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /usr /usr/lib64 /usr/lib64/python2.7 /usr/bin /usr/lib /usr/share /usr/share/texlive)
unset(CPACK_RPM_PACKAGE_RELOCATABLE)

#xdg-desktop-menu install <install>/share/applications/MyApp.desktop

set(CPACK_DEBIAN_PACKAGE_SECTION "math")
set(CPACK_RPM_PACKAGE_GROUP      "Applications/Productivity")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "field-theory motivated computer algebra system")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/description)
include(CPack)