Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #27 from AppImage/feature/rpm
Browse files Browse the repository at this point in the history
Also generate and upload RPM
  • Loading branch information
TheAssassin committed Nov 11, 2018
2 parents 189b800 + 0f4d524 commit a3b100b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -15,6 +15,7 @@ matrix:
- libcurl3
- libbsd-dev
- libcairo-dev
- rpm
- env: ARCH=i386
addons:
apt:
Expand All @@ -35,14 +36,15 @@ matrix:
- libpng-dev:i386
- libfreetype6-dev:i386
- libfontconfig1-dev:i386
- rpm

script:
- bash -xe travis/travis-build.sh

after_success:
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- if [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- bash upload.sh appimaged*.AppImage* appimaged*.deb*
- bash upload.sh appimaged*.AppImage* appimaged*.deb* appimaged*.rpm*

branches:
except:
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -57,3 +57,6 @@ add_subdirectory(src)

# include packaging configuration
include(cmake/cpack_debs.cmake)
include(cmake/cpack_rpms.cmake)
# CPack must be included once only, after setting all the variables
include(CPack)
2 changes: 0 additions & 2 deletions cmake/cpack_debs.cmake
Expand Up @@ -41,5 +41,3 @@ set(CPACK_DEBIAN_APPIMAGED_PACKAGE_DEPENDS "libarchive13, libc6 (>= 2.4), libgli

set(CPACK_COMPONENTS_ALL appimaged)
set(CPACK_DEB_COMPONENT_INSTALL ON)

include(CPack)
40 changes: 40 additions & 0 deletions cmake/cpack_rpms.cmake
@@ -0,0 +1,40 @@
# required for DEB-DEFAULT to work as intended
cmake_minimum_required(VERSION 3.6)

# allow building RPM packages on non-RPM systems
if(DEFINED ENV{ARCH})
set(CPACK_RPM_PACKAGE_ARCHITECTURE $ENV{ARCH})
if(CPACK_RPM_PACKAGE_ARCHITECTURE MATCHES "i686")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "i386")
elseif(CPACK_RPM_PACKAGE_ARCHITECTURE MATCHES "amd64")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
endif()
endif()

# override default package naming
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)

# versioning
set(CPACK_PACKAGE_VERSION ${APPIMAGED_VERSION})

# use git hash as package release
set(CPACK_RPM_PACKAGE_RELEASE "git${APPIMAGED_GIT_COMMIT}")

# append build ID, similar to AppImage naming
if(DEFINED ENV{TRAVIS_BUILD_NUMBER})
set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}~travis$ENV{TRAVIS_BUILD_NUMBER}")
else()
set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}~local")
endif()

set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")

set(CPACK_RPM_PACKAGE_NAME "appimaged")
set(CPACK_RPM_PACKAGE_SUMMARY
"Optional AppImage daemon for desktop integration. Integrates AppImages into the desktop, e.g., installs icons and menu entries.")

set(CPACK_RPM_PACKAGE_REQUIRES "libarchive13, libc6 >= 2.4, libglib2.0-0, zlib1g, fuse")

set(CPACK_COMPONENTS_ALL appimaged)
set(CPACK_RPM_COMPONENT_INSTALL ON)
5 changes: 4 additions & 1 deletion travis/travis-build.sh
Expand Up @@ -57,6 +57,9 @@ make -j$(nproc)
# make .deb
cpack -V -G DEB

# make .rpm
cpack -V -G RPM

# make AppImages
mkdir -p appdir
make install DESTDIR=appdir
Expand All @@ -73,4 +76,4 @@ export SIGN=1
export VERBOSE=1
linuxdeploy/AppRun --appdir appdir --output appimage

mv appimaged*.{AppImage,deb}* "$OLD_CWD/"
mv appimaged*.{AppImage,deb,rpm}* "$OLD_CWD/"

0 comments on commit a3b100b

Please sign in to comment.