build: use sury packages for x86

This commit is contained in:
nachoparker 2018-10-22 19:21:46 -06:00
parent b3069cb353
commit 0f425ff6d7
6 changed files with 38 additions and 20 deletions

3
Vagrantfile vendored
View File

@ -2,7 +2,7 @@
# vi: set ft=ruby :
#
# Vagrantfile test the NCP curl installer
# Vagrantfile for the NCP Debian VM
#
# Instructions: vagrant up; vagrant ssh
#
@ -41,6 +41,7 @@ Vagrant.configure("2") do |config|
install_script post-inst.sh
cd -
rm -r /tmp/nextcloudpi
systemctl disable sshd
poweroff
SHELL

View File

@ -34,7 +34,7 @@ vagrant destroy -f
vagrant up --provider=libvirt --provision
sudo chown "$USER" "$VM"
sudo cp --reflink=auto --sparse=auto "$VM" "$IMG"
sudo cp -a --reflink=auto --sparse=auto "$VM" "$IMG"
## pack

View File

@ -20,8 +20,11 @@ Internet access is required for this configuration to complete."
install()
{
# workaround until Sury has PHP7.2-redis armhf
[[ "$(uname -m)" == "x86_64" ]] && local RELEASE=stretch || local RELEASE=buster
apt-get update
apt-get install -t buster --no-install-recommends -y make gcc libc-dev
apt-get install -t $RELEASE --no-install-recommends -y make gcc libc-dev
local TMPDIR="$( mktemp -d /tmp/noip.XXXXXX )"
cd "$TMPDIR"

View File

@ -38,11 +38,14 @@ install()
# During build, this step is run before ncp.sh. Avoid executing twice
[[ -f /usr/lib/systemd/system/nc-provisioning.service ]] && return 0
# workaround until Sury has PHP7.2-redis armhf
[[ "$(uname -m)" == "x86_64" ]] && local RELEASE=stretch || local RELEASE=buster
# Optional packets for Nextcloud and Apps
apt-get update
$APTINSTALL lbzip2 iputils-ping
$APTINSTALL -t buster php-smbclient # for external storage
$APTINSTALL -t buster imagemagick php${PHPVER}-imagick php${PHPVER}-exif # for gallery
$APTINSTALL -t $RELEASE php-smbclient # for external storage
$APTINSTALL -t $RELEASE imagemagick php${PHPVER}-imagick php${PHPVER}-exif # for gallery
# POSTFIX
@ -57,7 +60,7 @@ install()
}
$APTINSTALL redis-server
$APTINSTALL -t buster php${PHPVER}-redis
$APTINSTALL -t $RELEASE php${PHPVER}-redis
local REDIS_CONF=/etc/redis/redis.conf
local REDISPASS="default"

View File

@ -20,8 +20,11 @@ This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'"
install()
{
# workaround until Sury has PHP7.2-redis armhf
[[ "$(uname -m)" == "x86_64" ]] && local RELEASE=stretch || local RELEASE=buster
apt-get update
apt-get install --no-install-recommends -y -t buster samba
apt-get install --no-install-recommends -y -t $RELEASE samba
update-rc.d smbd disable
update-rc.d nmbd disable

34
lamp.sh
View File

@ -25,23 +25,31 @@ export DEBIAN_FRONTEND=noninteractive
install()
{
# GET DEBIAN BUSTER SOURCES
# GET PHP 7.2 SOURCES
##########################################
# Raspbian still doesn't support Buster -> http://archive.raspberrypi.org/debian/dists/
# Debian Buster repository keys are not in the Raspbian Stretch keyring. Install the Debian keyring
[[ -f /usr/bin/raspi-config ]] && {
echo "deb https://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
apt-get --allow-unauthenticated update
$APTINSTALL --allow-unauthenticated debian-archive-keyring
}
# workaround until Sury has PHP7.2-redis armhf
[[ "$(uname -m)" == "x86_64" ]] && local RELEASE=stretch || local RELEASE=buster
echo "deb http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
cat > /etc/apt/preferences.d/10-ncp-buster <<EOF
## Raspbian
if [[ -f /usr/bin/raspi-config ]]; then
echo "deb http://mirrordirector.raspbian.org/raspbian/ buster main contrib non-free rpi" > /etc/apt/sources.list.d/ncp-buster.list
## x86
elif [[ "$(uname -m)" == "x86_64" ]]; then
$APTINSTALL apt-transport-https
echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
## armhf
else
echo "deb http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
cat > /etc/apt/preferences.d/10-ncp-buster <<EOF
Package: *
Pin: release n=stretch
Pin-Priority: 600
EOF
fi
# INSTALL
##########################################
@ -50,9 +58,9 @@ EOF
$APTINSTALL apt-utils cron
$APTINSTALL apache2
$APTINSTALL -t buster php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm php${PHPVER}-cli php${PHPVER}-opcache \
php${PHPVER}-mbstring php${PHPVER}-xml php${PHPVER}-zip php${PHPVER}-fileinfo php${PHPVER}-ldap \
php${PHPVER}-intl php${PHPVER}-bz2 php${PHPVER}-json
$APTINSTALL -t $RELEASE php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm php${PHPVER}-cli php${PHPVER}-opcache \
php${PHPVER}-mbstring php${PHPVER}-xml php${PHPVER}-zip php${PHPVER}-fileinfo php${PHPVER}-ldap \
php${PHPVER}-intl php${PHPVER}-bz2 php${PHPVER}-json
mkdir -p /run/php