Skip to content

Commit b95c3bf

Browse files
authored
Merge pull request #1350 from bluca/pkgs
Problem: debian packages out of date
2 parents ade0c4d + ea00777 commit b95c3bf

File tree

9 files changed

+48
-67
lines changed

9 files changed

+48
-67
lines changed

CMakeLists.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
########################################################################
77
# Project setup
88
########################################################################
9-
cmake_minimum_required(VERSION 2.8.12)
9+
cmake_minimum_required(VERSION 2.8...4.0)
1010
project(zproject)
1111
enable_language(C)
1212
enable_testing()
1313

14-
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
14+
include(GNUInstallDirs)
15+
1516
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
1617
# Select flags
1718
if(MSVC)
@@ -51,7 +52,7 @@ if (NOT HAVE_NET_IF_H)
5152
CHECK_INCLUDE_FILE("net/if.h" HAVE_NET_IF_H)
5253
endif()
5354

54-
file(REMOVE "${SOURCE_DIR}/src/platform.h")
55+
file(REMOVE "${PROJECT_SOURCE_DIR}/src/platform.h")
5556

5657
file(WRITE "${PROJECT_BINARY_DIR}/platform.h.in" "
5758
#cmakedefine HAVE_LINUX_WIRELESS_H
@@ -68,7 +69,7 @@ if (WIN32)
6869
#so the sources have to be compiled as c++
6970
if (MSVC AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
7071
enable_language(CXX)
71-
file(GLOB sources "${SOURCE_DIR}/src/*.c")
72+
file(GLOB sources "${PROJECT_SOURCE_DIR}/src/*.c")
7273
set_source_files_properties(
7374
${sources}
7475
PROPERTIES LANGUAGE CXX
@@ -94,7 +95,7 @@ if (CYGWIN)
9495
set(MORE_LIBRARIES)
9596
endif()
9697

97-
list(APPEND CMAKE_MODULE_PATH "${SOURCE_DIR}")
98+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
9899
set(OPTIONAL_LIBRARIES)
99100
set(OPTIONAL_LIBRARIES_STATIC)
100101

@@ -126,7 +127,7 @@ set (zproject_headers
126127
)
127128

128129
source_group ("Header Files" FILES ${zproject_headers})
129-
install(FILES ${zproject_headers} DESTINATION include)
130+
install(FILES ${zproject_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
130131

131132
########################################################################
132133
# executables
@@ -197,31 +198,30 @@ include(CTest)
197198
# cleanup
198199
########################################################################
199200
if (NOT TARGET distclean)
200-
add_custom_target (distclean @echo Cleaning for source distribution)
201+
if (CMAKE_VERSION VERSION_LESS 3.17)
202+
set(rm_command rm -rf)
203+
else()
204+
set(rm_command ${CMAKE_COMMAND} -E rm -rf --)
205+
endif()
206+
set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt
207+
${PROJECT_BINARY_DIR}/cmake_install.cmake
208+
${PROJECT_BINARY_DIR}/Makefile
209+
${PROJECT_BINARY_DIR}/CMakeFiles
210+
${PROJECT_BINARY_DIR}/CTestTestfile.cmake
211+
${PROJECT_BINARY_DIR}/DartConfiguration.tcl
212+
${PROJECT_BINARY_DIR}/Testing
213+
${PROJECT_BINARY_DIR}/compile_commands.json
214+
${PROJECT_BINARY_DIR}/platform.h
215+
${PROJECT_BINARY_DIR}/src/libzproject.pc
216+
${PROJECT_BINARY_DIR}/src/libzproject.so
217+
${PROJECT_BINARY_DIR}/src/zproject_selftest
218+
)
219+
add_custom_target(distclean
220+
COMMAND ${rm_command} CMakeTmp ${cmake_generated}
221+
COMMENT Cleaning for source distribution
222+
)
201223
endif()
202224

203-
set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt
204-
${PROJECT_BINARY_DIR}/cmake_install.cmake
205-
${PROJECT_BINARY_DIR}/Makefile
206-
${PROJECT_BINARY_DIR}/CMakeFiles
207-
${PROJECT_BINARY_DIR}/CTestTestfile.cmake
208-
${PROJECT_BINARY_DIR}/DartConfiguration.tcl
209-
${PROJECT_BINARY_DIR}/Testing
210-
${PROJECT_BINARY_DIR}/compile_commands.json
211-
${PROJECT_BINARY_DIR}/platform.h
212-
${PROJECT_BINARY_DIR}/src/libzproject.pc
213-
${PROJECT_BINARY_DIR}/src/libzproject.so
214-
${PROJECT_BINARY_DIR}/src/zproject_selftest
215-
)
216-
217-
add_custom_command(
218-
DEPENDS clean
219-
COMMENT "distribution clean"
220-
COMMAND rm
221-
ARGS -rf CMakeTmp ${cmake_generated}
222-
TARGET distclean
223-
)
224-
225225
include(ClangFormat OPTIONAL)
226226

227227
########################################################################

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
7575
[With GCC Code Coverage reporting])],
7676
[ZPROJECT_GCOV="$withval"])
7777

78-
if test "x${ZPROJECT_GCOV}" = "xyes"; then
78+
if test "x${ZPROJECT_GCOV}" == "xyes"; then
7979
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
8080

8181
if test "x${ZPROJECT_ORIG_CFLAGS}" != "xnone"; then
@@ -94,7 +94,7 @@ AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes
9494
[Build with GCC Address Sanitizer instrumentation])],
9595
[ZPROJECT_ASAN="$enableval"])
9696

97-
if test "x${ZPROJECT_ASAN}" = "xyes"; then
97+
if test "x${ZPROJECT_ASAN}" == "xyes"; then
9898
CFLAGS="${CFLAGS} -fsanitize=address"
9999
CXXFLAGS="${CXXFLAGS} -fsanitize=address"
100100

@@ -114,7 +114,7 @@ AC_ARG_ENABLE([bindings-python],
114114
[ZPROJECT_BINDINGS_PYTHON=$enableval],
115115
[ZPROJECT_BINDINGS_PYTHON=no])
116116

117-
if test "x$ZPROJECT_BINDINGS_PYTHON" = "xyes"; then
117+
if test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then
118118
AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true)
119119
AC_MSG_RESULT([yes])
120120
else

packaging/debian/compat

Lines changed: 0 additions & 1 deletion
This file was deleted.

packaging/debian/control

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ Section: net
1414
Priority: optional
1515
Maintainer: zproject Developers <[email protected]>
1616
Standards-Version: 4.0.1.0
17-
Build-Depends: debhelper (>= 9),
18-
pkg-config,
17+
Build-Depends: debhelper-compat (= 12),
18+
pkgconf | pkg-config,
1919
generator-scripting-language,
20-
asciidoc-base | asciidoc, xmlto,
21-
dh-autoreconf
20+
asciidoc-base <!nodoc>, xmlto <!nodoc>,
2221

2322
Package: zproject
2423
Architecture: any

packaging/debian/zproject.dsc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Source: zproject
44
Version: 1.1.0-0.1
55
Maintainer: zproject Developers <[email protected]>
66
Architecture: any
7-
Build-Depends: debhelper (>= 9),
8-
pkg-config,
7+
Build-Depends: debhelper-compat (= 12),
8+
pkgconf | pkg-config,
99
generator-scripting-language,
10-
asciidoc-base | asciidoc, xmlto,
11-
dh-autoreconf
10+
asciidoc-base <!nodoc>, xmlto <!nodoc>,
1211

1312
Files:
1413
7697688bf65a35bc33ae2db51ebb0e3b 818110 zproject.tar.gz

packaging/obs/_service

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
<param name="files">*/packaging/debian/changelog</param>
2424
<param name="outfilename">debian.changelog</param>
2525
</service>
26-
<service name="extract_file" mode="buildtime">
27-
<param name="archive">*.tar</param>
28-
<param name="files">*/packaging/debian/compat</param>
29-
<param name="outfilename">debian.compat</param>
30-
</service>
3126
<service name="extract_file" mode="buildtime">
3227
<param name="archive">*.tar</param>
3328
<param name="files">*/packaging/debian/control</param>

zproject_autotools.gsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ AC_ARG_ENABLE([$(name)],
10881088
AM_CONDITIONAL([ENABLE_$(NAME:c)], [test x$enable_$(name:c) != xno])
10891089
AM_COND_IF([ENABLE_$(NAME:c)], [AC_MSG_NOTICE([ENABLE_$(NAME:c) defined])])
10901090

1091+
.else
10911092
AM_CONDITIONAL([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [test x$enable_$(project.prefix:c)_selftest != xno])
10921093
AM_COND_IF([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [AC_MSG_NOTICE([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST defined])])
10931094

zproject_debian.gsl

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ $(project.name:lower) ($(->version.major).$(->version.minor).$(->version.patch)-
2626
* Initial packaging.
2727

2828
-- $(project.name) Developers <$(project.email)> Wed, 31 Dec 2014 00:00:00 +0000
29-
.output "packaging/debian/compat"
30-
10
3129
.output "packaging/debian/control"
3230
#
3331
# $(project.name) - $(project.description?'':)
@@ -41,8 +39,8 @@ Section: net
4139
Priority: optional
4240
Maintainer: $(project.name) Developers <$(project.email)>
4341
Standards-Version: 4.0.1.0
44-
Build-Depends: debhelper (>= 9),
45-
pkg-config,
42+
Build-Depends: debhelper-compat (= 12),
43+
pkgconf | pkg-config,
4644
.for project.use
4745
.if defined(use.debian_name)
4846
. if !(use.debian_name = '')
@@ -65,15 +63,13 @@ Build-Depends: debhelper (>= 9),
6563
.endif
6664
.if systemd ?= 1
6765
.# necessary for systemd.pc to get unit install path
68-
systemd,
66+
systemd-dev | systemd,
6967
.endif
7068
.if python_cffi ?= 1
7169
dh-python <!nopython>,
7270
python3-all-dev <!nopython>, python3-cffi <!nopython>, python3-setuptools <!nopython>,
7371
.endif
74-
.- NOTE: after support for Debian 7 and Ubuntu 12.04 is dropped, <!nodoc> can be added to each of the following
75-
asciidoc-base | asciidoc, xmlto,
76-
dh-autoreconf
72+
asciidoc-base <!nodoc>, xmlto <!nodoc>,
7773
.if project.exports_classes | ( project.has_classes & project.has_main )
7874
.# NOTE: Now for at least some compilers the symbol visibility seems to
7975
.# be managed in the shared library files, not the "exportedness" - so
@@ -305,6 +301,7 @@ override_dh_auto_configure:
305301
dh_auto_configure -- \\
306302
.if systemd ?= 1
307303
--with-systemd-units \\
304+
--with-systemdsystemunitdir=/lib/systemd/system \\
308305
.endif
309306
.for project.use where use.optional
310307
--with-$(use.libname)=yes \\
@@ -314,9 +311,6 @@ override_dh_auto_configure:
314311

315312
%:
316313
dh $@ \\
317-
.if systemd ?= 1
318-
--with systemd \\
319-
.endif
320314
.if python_cffi ?= 1
321315
\$(WITH_PYTHON) \\
322316
.endif
@@ -407,8 +401,8 @@ Source: $(project.name)
407401
Version: $(->version.major).$(->version.minor).$(->version.patch)-0.1
408402
Maintainer: $(project.name) Developers <$(project.email)>
409403
Architecture: any
410-
Build-Depends: debhelper (>= 9),
411-
pkg-config,
404+
Build-Depends: debhelper-compat (= 12),
405+
pkgconf | pkg-config,
412406
.for project.use
413407
.if defined(use.debian_name)
414408
. if !(use.debian_name = '')
@@ -427,14 +421,13 @@ Build-Depends: debhelper (>= 9),
427421
,
428422
.endfor
429423
.if systemd ?= 1
430-
systemd,
424+
systemd-dev | systemd,
431425
.endif
432426
.if python_cffi ?= 1
433427
dh-python <!nopython>,
434428
python3-all-dev <!nopython>, python3-cffi <!nopython>, python3-setuptools <!nopython>,
435429
.endif
436-
asciidoc-base | asciidoc, xmlto,
437-
dh-autoreconf
430+
asciidoc-base <!nodoc>, xmlto <!nodoc>,
438431

439432
Files:
440433
7697688bf65a35bc33ae2db51ebb0e3b 818110 $(string.replace (project.name, "_|-"):lower).tar.gz

zproject_obs.gsl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ register_target ("obs", "service for Open Build Service")
4141
<param name="files">*/packaging/debian/changelog</param>
4242
<param name="outfilename">debian.changelog</param>
4343
</service>
44-
<service name="extract_file" mode="buildtime">
45-
<param name="archive">*.tar</param>
46-
<param name="files">*/packaging/debian/compat</param>
47-
<param name="outfilename">debian.compat</param>
48-
</service>
4944
<service name="extract_file" mode="buildtime">
5045
<param name="archive">*.tar</param>
5146
<param name="files">*/packaging/debian/control</param>

0 commit comments

Comments
 (0)