Skip to content

Instantly share code, notes, and snippets.

@igricart
Last active November 17, 2020 14:01
Show Gist options
  • Select an option

  • Save igricart/56fcaddb8b7be581c22a27e300298103 to your computer and use it in GitHub Desktop.

Select an option

Save igricart/56fcaddb8b7be581c22a27e300298103 to your computer and use it in GitHub Desktop.

Create a debian pkg out of CMakeFiles/CMakeLists.txt

The following script is meant to be used to create a debian package out of a CMake project well defined

  GNU nano 2.9.3                                                                                 build_deb_from_cmake.sh                                                                                 Modified  

export DEBMAIL="your@amazing-email.com"
export DEBFULLNAME="Ignacio Ricart"
export DEB_BUILD_OPTIONS=nocheck
export DEB_CFLAGS_MAINT_APPEND="-Wno-sizeof-pointer-memaccess -Wno-stringop-truncation"

#### Go to the source folder or build folder and execute the following #####
dh_make -p packgae-name_version --createorig -s -y 
# Attention to the name (package-name-always-with-hifen_VERSION_WITH_UNDERSCORE)
#### modify  your debian rule  file at  debian/rule

# ATTENTION TO THE TAB instead of SPACE
#%:
#       dh $@
#override_dh_usrlocal:
#       dh $@
#
#override_dh_shlibdeps:
#       dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

### Now build your deb package as follows
dpkg-buildpackage -b -uc

## your debian package is the folder ../

## Install your deb file if it fails due to dependency issues

sudo apt install -yy -o Dpkg::Options::="--force-overwrite" ../your-deb-file.deb

In case of TAB error, the following message will be shown

debian/rules:24: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment