Skip to content
Snippets Groups Projects
Commit fa038be2 authored by akiraohgaki's avatar akiraohgaki Committed by GitHub
Browse files

Merge pull request #49 from ocs-url/develop

Develop
parents 3b4a498a d9004aff
No related branches found
No related tags found
No related merge requests found
dist: trusty
sudo: required
services:
- docker
branches:
only:
- master
script:
- mntdir='/mnt/ocs-url'
- docker run --rm -v $(pwd):${mntdir} ubuntu:14.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh ubuntu"
- docker run --rm -v $(pwd):${mntdir} fedora:20 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh fedora"
- docker run --rm -v $(pwd):${mntdir} base/archlinux:latest /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh archlinux"
#- docker run --rm -v $(pwd):${mntdir} ubuntu:16.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh snap"
#- docker run --rm -v $(pwd):${mntdir} --cap-add SYS_ADMIN --device /dev/fuse ubuntu:14.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh appimage"
...@@ -4,75 +4,33 @@ pipelines: ...@@ -4,75 +4,33 @@ pipelines:
- step: - step:
image: ubuntu:14.04 image: ubuntu:14.04
script: script:
- apt update -qq - sh scripts/build-docker.sh ubuntu
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install devscripts debhelper fakeroot
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh ubuntu
custom: custom:
build-ubuntu: build-ubuntu:
- step: - step:
image: ubuntu:14.04 image: ubuntu:14.04
script: script:
- apt update -qq - sh scripts/build-docker.sh ubuntu
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install devscripts debhelper fakeroot
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh ubuntu
build-fedora: build-fedora:
- step: - step:
image: fedora:20 image: fedora:20
script: script:
# dnf >= fedora:22 - sh scripts/build-docker.sh fedora
- yum -y install sudo git curl
- yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
- yum -y install rpm-build
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh fedora
build-archlinux: build-archlinux:
- step: - step:
image: base/archlinux:latest image: base/archlinux:latest
script: script:
- pacman -Syu --noconfirm - sh scripts/build-docker.sh archlinux
- pacman -S --noconfirm sudo git curl
- pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh archlinux
build-snap: build-snap:
- step: - step:
image: ubuntu:16.04 image: ubuntu:16.04
script: script:
- apt update -qq - sh scripts/build-docker.sh snap
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install snapcraft
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh snap
build-appimage: build-appimage:
- step: - step:
image: ubuntu:14.04 image: ubuntu:14.04
script: script:
# Require docker run with --cap-add SYS_ADMIN --device /dev/fuse # Require?: docker run with --cap-add SYS_ADMIN --device /dev/fuse
- echo 'appimage build is disabled currently' - echo 'appimage build is disabled currently'
- exit 1 - exit 1
- apt update -qq - sh scripts/build-docker.sh appimage
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install fuse zsync desktop-file-utils
#- modprobe fuse
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh appimage
#!/bin/bash
################################################################################
# This is wrapper script for build.sh use from inside docker container
################################################################################
PKGUSER='pkgbuilder'
BUILDTYPE=''
if [ "${1}" ]; then
BUILDTYPE="${1}"
fi
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
BUILDSCRIPT="${PROJDIR}/scripts/build.sh"
build_ubuntu() {
# docker-image: ubuntu:14.04
apt update -qq
apt -y install git curl
apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
apt -y install devscripts debhelper fakeroot
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh ${BUILDSCRIPT} ${BUILDTYPE}" ${PKGUSER}
}
build_fedora() {
# docker-image: fedora:20
yum -y install git curl
yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
yum -y install rpm-build
# docker-image: fedora:22
#dnf -y install git curl
#dnf -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
#dnf -y install rpm-build
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh ${BUILDSCRIPT} ${BUILDTYPE}" ${PKGUSER}
}
build_archlinux() {
# docker-image: base/archlinux:latest
pacman -Syu --noconfirm
pacman -S --noconfirm git curl
pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh ${BUILDSCRIPT} ${BUILDTYPE}" ${PKGUSER}
}
build_snap() {
# docker-image: ubuntu:16.04
apt update -qq
apt -y install git curl
apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
apt -y install snapcraft
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh ${BUILDSCRIPT} ${BUILDTYPE}" ${PKGUSER}
}
build_appimage() {
# docker-image: ubuntu:14.04
apt update -qq
apt -y install git curl
apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
apt -y install fuse zsync desktop-file-utils
modprobe fuse
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh ${BUILDSCRIPT} ${BUILDTYPE}" ${PKGUSER}
}
if [ "${BUILDTYPE}" = 'ubuntu' ]; then
build_ubuntu
elif [ "${BUILDTYPE}" = 'fedora' ]; then
build_fedora
elif [ "${BUILDTYPE}" = 'archlinux' ]; then
build_archlinux
elif [ "${BUILDTYPE}" = 'snap' ]; then
build_snap
elif [ "${BUILDTYPE}" = 'appimage' ]; then
build_appimage
else
echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage]"
exit 1
fi
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
# This is utility script to make distribution packages # This is utility script to build distribution packages
################################################################################ ################################################################################
PKGNAME='ocs-url' PKGNAME='ocs-url'
...@@ -19,9 +19,6 @@ BUILDDIR="${PROJDIR}/build_${PKGNAME}_${BUILDVER}_${BUILDTYPE}" ...@@ -19,9 +19,6 @@ BUILDDIR="${PROJDIR}/build_${PKGNAME}_${BUILDVER}_${BUILDTYPE}"
SRCARCHIVE="${BUILDDIR}/${PKGNAME}.tar.gz" SRCARCHIVE="${BUILDDIR}/${PKGNAME}.tar.gz"
################################################################################
# Utility functions
################################################################################
export_srcarchive() { export_srcarchive() {
filepath="${1}" filepath="${1}"
$(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${filepath}" HEAD) $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${filepath}" HEAD)
...@@ -36,98 +33,65 @@ transfer_file() { ...@@ -36,98 +33,65 @@ transfer_file() {
fi fi
} }
################################################################################ build_ubuntu() {
# ubuntu
################################################################################
pre_ubuntu() {
cd "${PROJDIR}" cd "${PROJDIR}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}" export_srcarchive "${SRCARCHIVE}"
}
build_ubuntu() {
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}" tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}" cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}"
cd "${BUILDDIR}/${PKGNAME}" cd "${BUILDDIR}/${PKGNAME}"
debuild -uc -us -b debuild -uc -us -b
}
post_ubuntu() {
transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.deb")" transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.deb")"
} }
################################################################################ build_fedora() {
# fedora
################################################################################
pre_fedora() {
cd "${PROJDIR}" cd "${PROJDIR}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}" export_srcarchive "${SRCARCHIVE}"
}
build_fedora() {
mkdir "${BUILDDIR}/SOURCES" mkdir "${BUILDDIR}/SOURCES"
mkdir "${BUILDDIR}/SPECS" mkdir "${BUILDDIR}/SPECS"
mv "${SRCARCHIVE}" "${BUILDDIR}/SOURCES" mv "${SRCARCHIVE}" "${BUILDDIR}/SOURCES"
cp "${PROJDIR}/pkg/fedora/${PKGNAME}.spec" "${BUILDDIR}/SPECS" cp "${PROJDIR}/pkg/fedora/${PKGNAME}.spec" "${BUILDDIR}/SPECS"
rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec" rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
}
post_fedora() {
transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.rpm")" transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.rpm")"
} }
################################################################################ build_archlinux() {
# archlinux
################################################################################
pre_archlinux() {
cd "${PROJDIR}" cd "${PROJDIR}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}" export_srcarchive "${SRCARCHIVE}"
}
build_archlinux() {
cp "${PROJDIR}/pkg/archlinux/PKGBUILD" "${BUILDDIR}" cp "${PROJDIR}/pkg/archlinux/PKGBUILD" "${BUILDDIR}"
cd "${BUILDDIR}" cd "${BUILDDIR}"
updpkgsums updpkgsums
makepkg -s makepkg -s
}
post_archlinux() {
transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.pkg.tar.xz")" transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.pkg.tar.xz")"
} }
################################################################################ build_snap() {
# snap
################################################################################
pre_snap() {
cd "${PROJDIR}" cd "${PROJDIR}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}" export_srcarchive "${SRCARCHIVE}"
}
build_snap() {
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}" tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
cp "${PROJDIR}/pkg/snap/snapcraft.yaml" "${BUILDDIR}/${PKGNAME}" cp "${PROJDIR}/pkg/snap/snapcraft.yaml" "${BUILDDIR}/${PKGNAME}"
cp -r "${PROJDIR}/pkg/snap/setup" "${BUILDDIR}/${PKGNAME}" cp -r "${PROJDIR}/pkg/snap/setup" "${BUILDDIR}/${PKGNAME}"
cd "${BUILDDIR}/${PKGNAME}" cd "${BUILDDIR}/${PKGNAME}"
snapcraft snapcraft
}
post_snap() {
transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.snap")" transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.snap")"
} }
################################################################################ build_appimage() {
# appimage
################################################################################
pre_appimage() {
cd "${PROJDIR}" cd "${PROJDIR}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}" export_srcarchive "${SRCARCHIVE}"
}
build_appimage() {
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}" tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
cd "${BUILDDIR}/${PKGNAME}" cd "${BUILDDIR}/${PKGNAME}"
sh scripts/import.sh sh scripts/import.sh
...@@ -154,25 +118,20 @@ build_appimage() { ...@@ -154,25 +118,20 @@ build_appimage() {
install -m 755 -p "${BUILDDIR}/${PKGNAME}/pkg/appimage/appimage-desktopintegration_${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun" install -m 755 -p "${BUILDDIR}/${PKGNAME}/pkg/appimage/appimage-desktopintegration_${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
./linuxdeployqt --appimage-extract ./linuxdeployqt --appimage-extract
./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir" ./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir"
}
post_appimage() {
transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.AppImage")" transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.AppImage")"
} }
################################################################################
# Make package
################################################################################
if [ "${BUILDTYPE}" = 'ubuntu' ]; then if [ "${BUILDTYPE}" = 'ubuntu' ]; then
pre_ubuntu && build_ubuntu && post_ubuntu build_ubuntu
elif [ "${BUILDTYPE}" = 'fedora' ]; then elif [ "${BUILDTYPE}" = 'fedora' ]; then
pre_fedora && build_fedora && post_fedora build_fedora
elif [ "${BUILDTYPE}" = 'archlinux' ]; then elif [ "${BUILDTYPE}" = 'archlinux' ]; then
pre_archlinux && build_archlinux && post_archlinux build_archlinux
elif [ "${BUILDTYPE}" = 'snap' ]; then elif [ "${BUILDTYPE}" = 'snap' ]; then
pre_snap && build_snap && post_snap build_snap
elif [ "${BUILDTYPE}" = 'appimage' ]; then elif [ "${BUILDTYPE}" = 'appimage' ]; then
pre_appimage && build_appimage && post_appimage build_appimage
else else
echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage]" echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage]"
exit 1 exit 1
......
DISTFILES += \ DISTFILES += \
$${PWD}/build-docker.sh \
$${PWD}/build.sh \ $${PWD}/build.sh \
$${PWD}/import.sh $${PWD}/import.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment