mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
34 lines
807 B
Bash
Executable file
34 lines
807 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
SPEC_FILE="$1"
|
|
DESKTOP_FILE="$2"
|
|
BUILD_DIRECTORY="$3"
|
|
CONTENTS_DIR="$4"
|
|
APP_FILE_NAME="$5"
|
|
|
|
RPM_BUILD_ROOT=~/rpmbuild
|
|
ARCH=`uname -m`
|
|
|
|
# Work around for `uname -m` returning i686 when rpmbuild uses i386 instead
|
|
if [ "$ARCH" = "i686" ]; then
|
|
ARCH="i386"
|
|
fi
|
|
|
|
# rpmdev-setuptree
|
|
mkdir -p $RPM_BUILD_ROOT/BUILD
|
|
mkdir -p $RPM_BUILD_ROOT/SPECS
|
|
mkdir -p $RPM_BUILD_ROOT/RPMS
|
|
|
|
cp -r "$CONTENTS_DIR/"* "$RPM_BUILD_ROOT/BUILD"
|
|
cp -r "$BUILD_DIRECTORY/icons" "$RPM_BUILD_ROOT/BUILD"
|
|
cp "$SPEC_FILE" "$RPM_BUILD_ROOT/SPECS"
|
|
cp ./N1.sh "$RPM_BUILD_ROOT/BUILD"
|
|
cp "$RPM_BUILD_ROOT/BUILD/N1.sh" "$RPM_BUILD_ROOT/BUILD/$APP_FILE_NAME"
|
|
cp "$DESKTOP_FILE" "$RPM_BUILD_ROOT/BUILD"
|
|
|
|
rpmbuild -ba "$SPEC_FILE"
|
|
cp $RPM_BUILD_ROOT/RPMS/$ARCH/$APP_FILE_NAME-*.rpm "$BUILD_DIRECTORY"
|
|
|
|
rm -rf "$RPM_BUILD_ROOT"
|