Michal Vasko | 4cb2d72 | 2020-04-23 13:49:16 +0200 | [diff] [blame] | 1 | set(PACKAGE "libnetconf2") |
| 2 | set(PACKAGE_BRIEF "libnetconf2 library") |
| 3 | set(PACKAGE_DESC ${LIBNETCONF2_DESC}) |
| 4 | set(PACKAGE_DBG_DESC "libnetconf2 library debug symbols.") |
| 5 | set(PACKAGE_DEV_BRIEF "Headers of libnetconf2 library") |
| 6 | set(PACKAGE_DEV_DESC "libnetconf2 library headers for C.") |
| 7 | |
| 8 | set(GITHUB_URL "https://github.com/cesnet/libnetconf2") |
| 9 | |
| 10 | find_program(DEB_BUILDER NAMES debuild) |
| 11 | find_program(RPM_BUILDER NAMES rpmbuild) |
| 12 | |
| 13 | # setup package build |
| 14 | configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.spec.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.spec) |
| 15 | configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.dsc.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.dsc) |
| 16 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.control.in ${PROJECT_BINARY_DIR}/build-packages/debian.control @ONLY) |
| 17 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.rules.in ${PROJECT_BINARY_DIR}/build-packages/debian.rules) |
| 18 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.compat |
| 19 | ${PROJECT_BINARY_DIR}/build-packages/debian.compat COPYONLY) |
| 20 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.copyright |
| 21 | ${PROJECT_BINARY_DIR}/build-packages/debian.copyright COPYONLY) |
| 22 | configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.rpmlintrc |
| 23 | ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.rpmlintrc COPYONLY) |
| 24 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}.install |
| 25 | ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}.install COPYONLY) |
| 26 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}-dev.install |
| 27 | ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}-dev.install COPYONLY) |
| 28 | |
| 29 | if(NOT DEB_BUILDER) |
| 30 | message(STATUS "Missing tools (devscripts, debhelper package) for building DEB package.") |
| 31 | else() |
| 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) |
| 39 | endif() |
| 40 | |
| 41 | if(NOT RPM_BUILDER) |
| 42 | message(STATUS "Missing tools (rpm package) for building RPM package.") |
| 43 | else() |
| 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) |
| 52 | endif() |