From fa06ce428d58ea0f5c9e6907eb97a5b3dca4f388 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Mon, 3 Sep 2018 15:54:06 +0900
Subject: [PATCH] Update package script

---
 scripts/package | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/package b/scripts/package
index c13be07..8731205 100755
--- a/scripts/package
+++ b/scripts/package
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 PKGNAME='ocs-url'
 
@@ -10,7 +10,7 @@ PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
 
 BUILDDIR="${PROJDIR}/build_${PKGNAME}"
 
-ci_ubuntu_deb() { # docker-image: ubuntu:14.04
+ubuntu_deb() { # docker-image: ubuntu:14.04
     apt update -qq
     apt -y install curl git
     apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
@@ -34,7 +34,7 @@ build_ubuntu_deb() {
     debuild -uc -us -b
 }
 
-ci_fedora_rpm() { # docker-image: fedora:20
+fedora_rpm() { # docker-image: fedora:20
     yum -y install curl git
     yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
     yum -y install rpm-build
@@ -57,7 +57,7 @@ build_fedora_rpm() {
     rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
 }
 
-ci_opensuse_rpm() { # docker-image: opensuse:42.1
+opensuse_rpm() { # docker-image: opensuse:42.1
     zypper --non-interactive refresh
     zypper --non-interactive install curl git
     zypper --non-interactive install make automake gcc gcc-c++ libtool libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qtdeclarative-devel
@@ -81,7 +81,7 @@ build_opensuse_rpm() {
     rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
 }
 
-ci_archlinux_pkg() { # docker-image: base/archlinux:latest
+archlinux_pkg() { # docker-image: base/archlinux:latest
     pacman -Syu --noconfirm
     pacman -S --noconfirm curl git
     pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
@@ -106,13 +106,13 @@ build_archlinux_pkg() {
 }
 
 export_srcarchive() {
-    if [[ "${1}" ]]; then
+    if [ "${1}" ]; then
         $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${1}" HEAD)
     fi
 }
 
 transfer_file() {
-    if [[ -f "${1}" ]]; then
+    if [ -f "${1}" ]; then
         filename="$(basename "${1}")"
         transferlog="${PROJDIR}/transfer.log"
         echo "Uploading ${filename}" >> "${transferlog}"
@@ -121,6 +121,6 @@ transfer_file() {
     fi
 }
 
-if [[ "${1}" = 'ci_'* || "${1}" = 'build_'* ]]; then
+if [ "${1}" ]; then
     ${1}
 fi
-- 
GitLab