blob: 44a8bad9ffb8e104906eb2bf79670cffefdf2a78 [file] [log] [blame]
Michal Vasko4cb2d722020-04-23 13:49:16 +02001set(PACKAGE "libnetconf2")
2set(PACKAGE_BRIEF "libnetconf2 library")
3set(PACKAGE_DESC ${LIBNETCONF2_DESC})
4set(PACKAGE_DBG_DESC "libnetconf2 library debug symbols.")
5set(PACKAGE_DEV_BRIEF "Headers of libnetconf2 library")
6set(PACKAGE_DEV_DESC "libnetconf2 library headers for C.")
7
8set(GITHUB_URL "https://github.com/cesnet/libnetconf2")
9
10find_program(DEB_BUILDER NAMES debuild)
11find_program(RPM_BUILDER NAMES rpmbuild)
12
13# setup package build
14configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.spec.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.spec)
15configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.dsc.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.dsc)
16configure_file(${PROJECT_SOURCE_DIR}/packages/debian.control.in ${PROJECT_BINARY_DIR}/build-packages/debian.control @ONLY)
17configure_file(${PROJECT_SOURCE_DIR}/packages/debian.rules.in ${PROJECT_BINARY_DIR}/build-packages/debian.rules)
18configure_file(${PROJECT_SOURCE_DIR}/packages/debian.compat
19 ${PROJECT_BINARY_DIR}/build-packages/debian.compat COPYONLY)
20configure_file(${PROJECT_SOURCE_DIR}/packages/debian.copyright
21 ${PROJECT_BINARY_DIR}/build-packages/debian.copyright COPYONLY)
22configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.rpmlintrc
23 ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.rpmlintrc COPYONLY)
24configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}.install
25 ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}.install COPYONLY)
26configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}-dev.install
27 ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}-dev.install COPYONLY)
28
29if(NOT DEB_BUILDER)
30 message(STATUS "Missing tools (devscripts, debhelper package) for building DEB package.")
31else()
32 # target for local build deb package
33 message(STATUS "To build local DEB package, use \"build-deb\" target.")
34 add_custom_target(build-deb
35 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
36 COMMAND build-packages/local-deb.sh
37 )
38 configure_file(${PROJECT_SOURCE_DIR}/packages/local-deb.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-deb.sh @ONLY)
39endif()
40
41if(NOT RPM_BUILDER)
42 message(STATUS "Missing tools (rpm package) for building RPM package.")
43else()
44 # target for local build rpm package
45 message(STATUS "To build local RPM package, use \"build-rpm\" target.")
46 string(REPLACE ${PROJECT_SOURCE_DIR} "." EXCLUDE_BUILD_DIR ${PROJECT_BINARY_DIR})
47 add_custom_target(build-rpm
48 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
49 COMMAND build-packages/local-rpm.sh
50 )
51 configure_file(${PROJECT_SOURCE_DIR}/packages/local-rpm.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-rpm.sh @ONLY)
52endif()