diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2018-01-06 20:56:52 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-01-06 20:56:52 +0300 |
commit | 7cf52228f39c78bda7d2402faf8faf4ee7d4a6e5 (patch) | |
tree | fedd697ea85b86a3351a552c86af7e9d0f4b4f0a /cmake | |
parent | e6c7f245411e9ddd8781315b4e2359f418e4339d (diff) | |
download | accel-ppp-7cf52228f39c78bda7d2402faf8faf4ee7d4a6e5.tar.gz accel-ppp-7cf52228f39c78bda7d2402faf8faf4ee7d4a6e5.zip |
cmake: reworked debian related package generation rules
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/debian/debian.cmake | 44 | ||||
-rwxr-xr-x | cmake/debian/postinst | 2 |
2 files changed, 31 insertions, 15 deletions
diff --git a/cmake/debian/debian.cmake b/cmake/debian/debian.cmake index e0e3393..5c994e2 100644 --- a/cmake/debian/debian.cmake +++ b/cmake/debian/debian.cmake @@ -1,8 +1,16 @@ SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr") SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}) -if (BUILD_DRIVER_ONLY) - if (BUILD_PPTP_DRIVER) +if (NOT DEFINED MODULES_KDIR) + execute_process( + COMMAND uname -r + COMMAND tr -d '\n' + OUTPUT_VARIABLE MODULES_KDIR + ) +endif() + +if (BUILD_PPTP_DRIVER) + if (BUILD_DRIVER_ONLY) SET(CPACK_PACKAGE_VERSION_MAJOR "0") SET(CPACK_PACKAGE_VERSION_MINOR "8") SET(CPACK_PACKAGE_VERSION_PATCH "5") @@ -11,29 +19,35 @@ if (BUILD_DRIVER_ONLY) SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-pptp kernel module") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst") - #INSTALL(DIRECTORY lib/modules/${DEBIAN_KDIR}/extra) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/driver/driver/pptp.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra) - #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "linux-image (= ${LINUX_IMAGE})") - endif (BUILD_PPTP_DRIVER) - - if (BUILD_IPOE_DRIVER) + endif () + #INSTALL(DIRECTORY lib/modules/${DEBIAN_KDIR}/extra) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/driver/driver/pptp.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra) + #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "linux-image (= ${LINUX_IMAGE})") +endif (BUILD_PPTP_DRIVER) + +if (BUILD_IPOE_DRIVER) + if (BUILD_DRIVER_ONLY) SET(CPACK_PACKAGING_INSTALL_PREFIX "/") SET(CPACK_PACKAGE_NAME "accel-ppp-ipoe-kmod") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp IPoE kernel module") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst") - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ipoe/driver/ipoe.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra) - endif (BUILD_IPOE_DRIVER) + endif () + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ipoe/driver/ipoe.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra) +endif (BUILD_IPOE_DRIVER) - if (BUILD_VLAN_MON_DRIVER) +if (BUILD_VLAN_MON_DRIVER) + if (BUILD_DRIVER_ONLY) SET(CPACK_PACKAGING_INSTALL_PREFIX "/") SET(CPACK_PACKAGE_NAME "accel-ppp-vlan_mon-kmod") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp vlan monitoring kernel module") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst") - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon/driver/vlan_mon.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra) - endif (BUILD_VLAN_MON_DRIVER) -else (BUILD_DRIVER_ONLY) + endif () + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon/driver/vlan_mon.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra) +endif (BUILD_VLAN_MON_DRIVER) + +if (NOT BUILD_DRIVER_ONLY) SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/conffiles") if (CPACK_TYPE STREQUAL Debian6) @@ -45,4 +59,4 @@ else (BUILD_DRIVER_ONLY) INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-init DESTINATION /etc/init.d RENAME accel-ppp) INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-default DESTINATION /etc/default RENAME accel-ppp) endif (CPACK_TYPE STREQUAL Debian6) -endif (BUILD_DRIVER_ONLY) +endif () diff --git a/cmake/debian/postinst b/cmake/debian/postinst index cc38181..0c38b0d 100755 --- a/cmake/debian/postinst +++ b/cmake/debian/postinst @@ -5,4 +5,6 @@ chmod +x /etc/init.d/accel-ppp mkdir /var/log/accel-ppp > /dev/null 2>&1 mkdir /var/lib/accel-ppp > /dev/null 2>&1 +depmod + exit 0 |