Skip to content

Commit

Permalink
cmake: Remove all cpack options including IPK generation
Browse files Browse the repository at this point in the history
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
  • Loading branch information
arfoll committed Mar 5, 2018
1 parent 2deaa73 commit ae2371c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 343 deletions.
62 changes: 0 additions & 62 deletions CMakeLists.txt
Expand Up @@ -134,8 +134,6 @@ option (ONEWIRE "Add Onewire support to mraa." ON)
option (JSONPLAT "Add Platform loading via a json file." ON)
option (IMRAA "Add Imraa support to mraa." OFF)
option (FTDI4222 "Build with FTDI FT4222 subplatform support." OFF)
option (IPK "Generate IPK using CPack" OFF)
option (RPM "Generate RPM using CPack" OFF)
option (ENABLEEXAMPLES "Disable building of examples" ON)
option (INSTALLTOOLS "Install all tools" ON)
option (BUILDTESTS "Override the addition of tests" ON)
Expand Down Expand Up @@ -197,66 +195,6 @@ if (BUILDDOC)
endif (DOXYGEN_FOUND AND DOXYGEN_VERSION VERSION_GREATER "1.8")
endif ()

if (IPK)
# Get target package arch from Yocto ADT sysroot if set or host OS, mapping to Ubuntu name if necessary
if (DEFINED ENV{OECORE_TARGET_SYSROOT})
GET_FILENAME_COMPONENT (DETECTED_SYSROOT $ENV{OECORE_TARGET_SYSROOT} NAME)
string (REGEX REPLACE "-poky-linux" "" TARGET_ARCH "${DETECTED_SYSROOT}")
else ()
# debian uses amd64 to denote x86_64
if (DETECTED_ARCH STREQUAL "x86_64")
set (TARGET_ARCH "amd64")
else ()
set (TARGET_ARCH ${DETECTED_ARCH})
endif ()
endif ()
message (STATUS "INFO - Package arch is ${TARGET_ARCH}")

set(CPACK_GENERATOR "DEB")
set(OPKG_ARCH ${TARGET_ARCH})
set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR})
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel IoT-Devkit") #required
set(mraa_PACKAGE_ON_TAG ".")
if ("${VERSION_COMMIT}" STREQUAL "")
set(mraa_PACKAGE_ON_TAG "")
endif()
set(CPACK_PACKAGE_VERSION
"${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH}${mraa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
set(CPACK_PACKAGE_NAME "mraa")
set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${TARGET_ARCH})
set(CPACK_SYSTEM_NAME ${TARGET_ARCH})
set(CPACK_DEBIAN_PACKAGE_PROVIDES "mraa-dev, mraa-dbg, mraa-doc")
set(CPACK_DEBIAN_PACKAGE_REPLACES "${CPACK_DEBIAN_PACKAGE_PROVIDES}, libmraa, libmraa-dev, libmraa-doc")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS ${CPACK_DEBIAN_PACKAGE_PROVIDES})
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
include (CPack)
endif()

if (RPM)
message (STATUS "INFO - Enabled RPM packaging for ${DETECTED_ARCH}")
set(CMAKE_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_NAME "libmraa${mraa_VERSION_MAJOR}")
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_VERSION
"${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH}${mraa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
set(CPACK_PACKAGE_CONTACT "Intel IoT-Devkit")
set(CPACK_PACKAGE_VENDOR "Intel IoT-Devkit")
set(CPACK_RPM_PACKAGE_PROVIDES "${CPACK_PACKAGE_NAME}-devel")
# Get distro tag (e.g. 'fc20') by parsing output of rpm --showrc
EXECUTE_PROCESS(
COMMAND rpm --showrc
COMMAND grep -w dist
COMMAND sed -e "s/\\t./ /"
COMMAND awk "{printf \"%s\", \$NF}"
OUTPUT_VARIABLE DIST_TAG
)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${DIST_TAG}.${DETECTED_ARCH}")
include(CPack)
endif()

add_subdirectory (src)
if (ENABLEEXAMPLES)
add_subdirectory (examples)
Expand Down
22 changes: 0 additions & 22 deletions README.md
Expand Up @@ -123,28 +123,6 @@ in /usr/lib.
Subplatforms (i.e. Firmata) have to be added manually with this kind of install
from your application, as shown in [this example](examples/javascript/firmata.js).

Installing on Intel 32bit Yocto based opkg image
------------------------------------------------

See the section below on compiling or use our repository to install on a glibc
based yocto poky image that supports opkg. Adding this repository is as simple
as and you'll have the latest stable tagged build of mraa installed!

``` bash
echo "src mraa-upm http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586" > /etc/opkg/mraa-upm.conf
opkg update
opkg install mraa
```

If you would like to get the latest & greatest builds from master HEAD you can
use our -dev repository

```bash
echo "src mraa-upm http://iotdk.intel.com/repos/3.5/intelgalactic-dev/opkg/i586" > /etc/opkg/mraa-upm.conf
opkg update
opkg install mraa
```

Compiling
=========

Expand Down
222 changes: 0 additions & 222 deletions cmake/modules/CPackDeb.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions docker-compose.yaml
Expand Up @@ -21,8 +21,6 @@ services:
- JSONPLAT=${JSONPLAT:-OFF}
- IMRAA=${IMRAA:-OFF}
- FTDI4222=${FTDI4222:-OFF}
- IPK=${IPK:-OFF}
- RPM=${RPM:-OFF}
- ENABLEEXAMPLES=${ENABLEEXAMPLES:-OFF}
- INSTALLTOOLS=${INSTALLTOOLS:-ON}
- CC=${CC:-clang-3.8}
Expand Down Expand Up @@ -105,20 +103,6 @@ services:
- FTDI4222=ON
command: bash -c "./scripts/run-cmake.sh && make -Cbuild"

ipk:
extends: all
environment:
- IPK=ON
- ENABLEEXAMPLES=ON
command: bash -c "./scripts/run-cmake.sh && make -Cbuild package"

rpm:
extends: all
environment:
- RPM=ON
- ENABLEEXAMPLES=ON
command: bash -c "./scripts/run-cmake.sh && make -Cbuild package"

python2:
extends: base
image: inteliotdevkit/mraa-python
Expand Down
17 changes: 0 additions & 17 deletions docs/building.md
Expand Up @@ -164,23 +164,6 @@ java -cp $DIR_WHERE_YOU_INSTALLED_MRAA/mraa.jar:. Example

If you want to add or improve Java bindings for mraa, please follow the <a href="https://github.com/intel-iot-devkit/upm/blob/master/docs/creating_java_bindings.md">Creating Java Bindings Guide</a>.

## Building an IPK/RPM package using `cpack`

You can get `cpack` to generate an IPK or RPM package fairly easily if you have
the correct packaging tools

~~~~~~~~~~~~~{.sh}
cmake -DIPK=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make package
~~~~~~~~~~~~~

To use RPM simply enable the RPM option. You'll need `rpmbuild` installed on your
build machine.

~~~~~~~~~~~~~{.sh}
cmake -DRPM=ON -DCMAKE_INSTALL_PREFIX=/usr ..
~~~~~~~~~~~~~

## Building for the Android Things Peripheralmanager Client

Requirements:
Expand Down
2 changes: 0 additions & 2 deletions scripts/build-android.sh
Expand Up @@ -72,8 +72,6 @@ cmake \
-DJSONPLAT=$JSONPLAT \
-DIMRAA=$IMRAA \
-DFTDI4222=$FTDI4222 \
-DIPK=$IPK \
-DRPM=$RPM \
-DENABLEEXAMPLES=$ENABLEEXAMPLES \
-DINSTALLTOOLS=$INSTALLTOOLS \
-DBUILDTESTS=$BUILDTESTS \
Expand Down
2 changes: 0 additions & 2 deletions scripts/run-cmake.sh
Expand Up @@ -17,8 +17,6 @@ cmake \
-DJSONPLAT=$JSONPLAT \
-DIMRAA=$IMRAA \
-DFTDI4222=$FTDI4222 \
-DIPK=$IPK \
-DRPM=$RPM \
-DENABLEEXAMPLES=$ENABLEEXAMPLES \
-DINSTALLTOOLS=$INSTALLTOOLS \
-DBUILDTESTS=$BUILDTESTS \
Expand Down

0 comments on commit ae2371c

Please sign in to comment.