mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-25 07:47:18 +00:00
chore: Add support for rpm packages (#1425)
* add support for rpm packages. * remove bintray file not my place neither do i have the keys. * Remove last visage of publishing rpm's to bintray. * address review comments. * remove electron installer redhat from optional dependancies and add it to dockerfiles. also remove variable ELECTRON-INSTALLER-REDHAT inline with electron installer debian script. * Add dependancy on libXScrnSaver and remove unsupported fields from config.json. add rpm package to dockerfiles. add dependancy check on rpmbuild to installer script. * change dependancy from lsb-core-noarch to just lsb. * address review comments. * Add bintray target for rpm packages. * Fix missing dependancy removed during conflict resolution.
This commit is contained in:
parent
a7d713c323
commit
f350d28dbd
21
Makefile
21
Makefile
@ -154,10 +154,12 @@ endif
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t debian)
|
||||
TARGET_ARCH_REDHAT = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t redhat)
|
||||
|
||||
PRODUCT_NAME = etcher
|
||||
APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z)
|
||||
APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
APPLICATION_VERSION_REDHAT = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
|
||||
# Fix hard link Appveyor issues
|
||||
CPRF = cp -RLf
|
||||
@ -395,6 +397,12 @@ $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_V
|
||||
./scripts/build/electron-installer-debian-linux.sh -p $< -r "$(TARGET_ARCH)" -o $| \
|
||||
-c scripts/build/debian/config.json
|
||||
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_VERSION_REDHAT)_$(TARGET_ARCH_REDHAT).rpm: \
|
||||
$(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-linux-$(TARGET_ARCH) \
|
||||
| $(BUILD_OUTPUT_DIRECTORY)
|
||||
./scripts/build/electron-installer-redhat-linux.sh -p $< -r "$(TARGET_ARCH)" -o $| \
|
||||
-c scripts/build/redhat/config.json
|
||||
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-win32-$(TARGET_ARCH).zip: \
|
||||
$(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-win32-$(TARGET_ARCH) \
|
||||
| $(BUILD_OUTPUT_DIRECTORY)
|
||||
@ -469,16 +477,20 @@ endif
|
||||
ifeq ($(TARGET_PLATFORM),linux)
|
||||
electron-installer-appimage: $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip
|
||||
electron-installer-debian: $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_VERSION_DEBIAN)_$(TARGET_ARCH_DEBIAN).deb
|
||||
electron-installer-redhat: $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_VERSION_REDHAT)_$(TARGET_ARCH_REDHAT).rpm
|
||||
cli-installer-tar-gz: $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).tar.gz
|
||||
TARGETS += \
|
||||
electron-installer-appimage \
|
||||
electron-installer-debian \
|
||||
electron-installer-redhat \
|
||||
cli-installer-tar-gz
|
||||
PUBLISH_AWS_S3 += \
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip \
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).tar.gz
|
||||
PUBLISH_BINTRAY_DEBIAN += \
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_VERSION_DEBIAN)_$(TARGET_ARCH_DEBIAN).deb
|
||||
PUBLISH_BINTRAY_REDHAT += \
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME_LOWERCASE)-electron_$(APPLICATION_VERSION_REDHAT)_$(TARGET_ARCH_REDHAT).rpm
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),win32)
|
||||
@ -495,7 +507,7 @@ PUBLISH_AWS_S3 += \
|
||||
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip
|
||||
endif
|
||||
|
||||
installers-all: $(PUBLISH_AWS_S3) $(PUBLISH_BINTRAY_DEBIAN)
|
||||
installers-all: $(PUBLISH_AWS_S3) $(PUBLISH_BINTRAY_DEBIAN) $(PUBLISH_BINTRAY_REDHAT)
|
||||
|
||||
ifdef PUBLISH_AWS_S3
|
||||
publish-aws-s3: $(PUBLISH_AWS_S3)
|
||||
@ -530,6 +542,13 @@ publish-bintray-debian: $(PUBLISH_BINTRAY_DEBIAN)
|
||||
TARGETS += publish-bintray-debian
|
||||
endif
|
||||
|
||||
ifdef PUBLISH_BINTRAY_REDHAT
|
||||
publish-bintray-redhat: $(PUBLISH_BINTRAY_REDHAT)
|
||||
# TODO: Update this after we've created ./scripts/publish/bintray-redhat.sh
|
||||
|
||||
TARGETS += publish-bintray-redhat
|
||||
endif
|
||||
|
||||
.PHONY: $(TARGETS)
|
||||
|
||||
cli-develop:
|
||||
|
@ -25,7 +25,7 @@ function usage() {
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -r <architecture>"
|
||||
echo " -t <type (debian|node)>"
|
||||
echo " -t <type (debian|redhat|node)>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -62,6 +62,12 @@ elif [ "$ARGV_TYPE" == "debian" ]; then
|
||||
elif [ "$ARGV_ARCHITECTURE" == "armv7l" ]; then
|
||||
RESULT=armhf
|
||||
fi
|
||||
elif [ "$ARGV_TYPE" == "redhat" ]; then
|
||||
if [ "$ARGV_ARCHITECTURE" == "x86" ]; then
|
||||
RESULT=i386
|
||||
elif [ "$ARGV_ARCHITECTURE" == "x64" ]; then
|
||||
RESULT='x86_64'
|
||||
fi
|
||||
else
|
||||
echo "Unsupported architecture type: $ARGV_TYPE" 1>&2
|
||||
exit 1
|
||||
|
@ -29,7 +29,8 @@ RUN apt-get update \
|
||||
python-software-properties \
|
||||
unzip \
|
||||
xvfb \
|
||||
zip
|
||||
zip \
|
||||
rpm
|
||||
|
||||
# Install a C++11 compiler
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
||||
@ -44,7 +45,7 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||
RUN npm config set unsafe-perm=true
|
||||
|
||||
RUN npm config set spin=false
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1 electron-installer-redhat@0.5.0
|
||||
|
||||
# Python
|
||||
COPY requirements.txt requirements.txt
|
||||
|
@ -28,7 +28,8 @@ RUN apt-get update \
|
||||
python-software-properties \
|
||||
unzip \
|
||||
xvfb \
|
||||
zip
|
||||
zip \
|
||||
rpm
|
||||
|
||||
# Install a C++11 compiler
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
||||
@ -43,7 +44,7 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||
RUN npm config set unsafe-perm=true
|
||||
|
||||
RUN npm config set spin=false
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1 electron-installer-redhat@0.5.0
|
||||
|
||||
# Python
|
||||
COPY requirements.txt requirements.txt
|
||||
|
@ -31,7 +31,9 @@ RUN apt-get update \
|
||||
python-software-properties \
|
||||
unzip \
|
||||
xvfb \
|
||||
zip
|
||||
|
||||
zip \
|
||||
rpm
|
||||
|
||||
# Install a C++11 compiler
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
||||
@ -46,7 +48,7 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||
RUN npm config set unsafe-perm=true
|
||||
|
||||
RUN npm config set spin=false
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1 electron-installer-redhat@0.5.0
|
||||
|
||||
# Python
|
||||
COPY requirements.txt requirements.txt
|
||||
|
76
scripts/build/electron-installer-redhat-linux.sh
Executable file
76
scripts/build/electron-installer-redhat-linux.sh
Executable file
@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
###
|
||||
# Copyright 2017 resin.io
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
###
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
OS=$(uname)
|
||||
if [[ "$OS" != "Linux" ]]; then
|
||||
echo "This script is only meant to be run in GNU/Linux" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./scripts/build/check-dependency.sh electron-installer-redhat
|
||||
|
||||
# electron-installer-redhat is documented as requiring the rpmbuild commands
|
||||
./scripts/build/check-dependency.sh rpmbuild
|
||||
|
||||
function usage() {
|
||||
echo "Usage: $0"
|
||||
echo ""
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -p <application directory>"
|
||||
echo " -r <architecture>"
|
||||
echo " -c <redhat configuration (.json)>"
|
||||
echo " -o <output directory>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_DIRECTORY=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
ARGV_REDHAT_CONFIGURATION=""
|
||||
ARGV_OUTPUT=""
|
||||
|
||||
while getopts ":p:r:c:o:" option; do
|
||||
case $option in
|
||||
p) ARGV_DIRECTORY="$OPTARG" ;;
|
||||
r) ARGV_ARCHITECTURE="$OPTARG" ;;
|
||||
c) ARGV_REDHAT_CONFIGURATION="$OPTARG" ;;
|
||||
o) ARGV_OUTPUT="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$ARGV_DIRECTORY" ] \
|
||||
|| [ -z "$ARGV_ARCHITECTURE" ] \
|
||||
|| [ -z "$ARGV_REDHAT_CONFIGURATION" ] \
|
||||
|| [ -z "$ARGV_OUTPUT" ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
|
||||
REDHAT_ARCHITECTURE=$(./scripts/build/architecture-convert.sh -r "$ARGV_ARCHITECTURE" -t redhat)
|
||||
|
||||
cp scripts/build/redhat/etcher-electron.sh "$ARGV_DIRECTORY"
|
||||
electron-installer-redhat \
|
||||
--src "$ARGV_DIRECTORY" \
|
||||
--dest "$ARGV_OUTPUT" \
|
||||
--config "$ARGV_REDHAT_CONFIGURATION" \
|
||||
--arch "$REDHAT_ARCHITECTURE"
|
||||
rm "$ARGV_DIRECTORY/etcher-electron.sh"
|
15
scripts/build/redhat/config.json
Normal file
15
scripts/build/redhat/config.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "etcher-electron",
|
||||
"productName": "Etcher",
|
||||
"genericName": "Etcher",
|
||||
"homepage": "https://etcher.io/",
|
||||
"icon": "assets/icon.png",
|
||||
"bin": "etcher-electron.sh",
|
||||
"categories": [
|
||||
"Utility"
|
||||
],
|
||||
"requires": [
|
||||
"lsb",
|
||||
"libXScrnSaver"
|
||||
]
|
||||
}
|
4
scripts/build/redhat/etcher-electron.sh
Executable file
4
scripts/build/redhat/etcher-electron.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
export ETCHER_DISABLE_UPDATES=1
|
||||
/usr/share/etcher-electron/etcher "$@"
|
Loading…
x
Reference in New Issue
Block a user