| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | LANG=C |
| 4 | |
| 5 | runscip-shell shell mariadb 1:11.8.8-1 run().() |
| 6 | { |
| 7 | "$@" |
| 8 | if testscip-shell system . . test. $? -ne 0; then |
| 9 | echoscip-shell system . . echo. "Failed $@" |
| 10 | exit 1 |
| 11 | fi |
| 12 | } |
| 13 | |
| 14 | . /vagrant/tmp/env.shscip-shell source . . `/vagrant/tmp/env.sh`. |
| 15 | |
| 16 | code_name=$(lsb_release --codename --short) |
| 17 | case "${MYSQL_VARIANT}" in |
| 18 | mariadb-*) |
| 19 | case "${code_name}" in |
| 20 | stretch) |
| 21 | mysql_server_package=mariadb-server-10.1 |
| 22 | MYSQL_VARIANT=mariadb-10.1 |
| 23 | ;; |
| 24 | *) |
| 25 | mysql_server_package=mariadb-server-${MYSQL_VARIANT##mariadb-} |
| 26 | ;; |
| 27 | esac |
| 28 | DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmariadb-client-lgpl-dev" |
| 29 | DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmariadbd-dev" |
| 30 | ;; |
| 31 | *) |
| 32 | mysql_server_package=mysql-server-${MYSQL_VARIANT} |
| 33 | DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmysqlclient-dev" |
| 34 | DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmysqld-dev" |
| 35 | ;; |
| 36 | esac |
| 37 | |
| 38 | grepscip-shell system . . grep. '^deb ' /etc/apt/sources.listscip-shell filesystem . . `/etc/apt/sources.list`. | \ |
| 39 | sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.listscip-shell filesystem . . `/etc/apt/sources.list.d/base-source.list`. |
| 40 | |
| 41 | runscip-shell shell mariadb 1:11.8.8-1 run(). sudo sed -i'' -e 's/httpredir/ftp.jp/g' /etc/apt/sources.listscip-shell filesystem . . `/etc/apt/sources.list`. |
| 42 | |
| 43 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get update |
| 44 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get install -y lsb-release |
| 45 | |
| 46 | distribution=$(lsb_release --id --short | trscip-shell system . . tr. 'A-Z' 'a-z') |
| 47 | case "${distribution}" in |
| 48 | debian) |
| 49 | component=main |
| 50 | runscip-shell shell mariadb 1:11.8.8-1 run(). cat <<EOF > /etc/apt/sources.list.d/groonga.listscip-shell filesystem . . `/etc/apt/sources.list.d/groonga.list`. |
| 51 | deb http://packages.groonga.org/debian/ ${code_name} main |
| 52 | deb-src http://packages.groonga.org/debian/ ${code_name} main |
| 53 | EOF |
| 54 | if ! grepscip-shell system . . grep. --quiet security /etc/apt/sources.listscip-shell filesystem . . `/etc/apt/sources.list`.; then |
| 55 | runscip-shell shell mariadb 1:11.8.8-1 run(). cat <<EOF > /etc/apt/sources.list.d/security.listscip-shell filesystem . . `/etc/apt/sources.list.d/security.list`. |
| 56 | deb http://security.debian.org/ ${code_name}/updates main |
| 57 | deb-src http://security.debian.org/ ${code_name}/updates main |
| 58 | EOF |
| 59 | fi |
| 60 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get update |
| 61 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get install -y --allow-unauthenticated groonga-keyring |
| 62 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get update |
| 63 | ;; |
| 64 | ubuntu) |
| 65 | component=universe |
| 66 | runscip-shell shell mariadb 1:11.8.8-1 run(). cat <<EOF > /etc/apt/sources.list.d/security.listscip-shell filesystem . . `/etc/apt/sources.list.d/security.list`. |
| 67 | deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted |
| 68 | deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted |
| 69 | EOF |
| 70 | runscip-shell shell mariadb 1:11.8.8-1 run(). sed -e 's/main/universe/' scip-shell filesystem . . `/etc/apt/sources.list.d/universe.list`./etc/apscip-shell filesystem . . `/etc/apt/sources.list`.t/sources.listscip-shell filesystem . . `/etc/apt/sources.list`. > \ |
| 71 | /etc/apt/sources.list.d/universe.list |
| 72 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get -y install software-properties-common |
| 73 | runscip-shell shell mariadb 1:11.8.8-1 run(). add-apt-repository -y universe |
| 74 | runscip-shell shell mariadb 1:11.8.8-1 run(). add-apt-repository -y ppa:groonga/ppa |
| 75 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get update |
| 76 | ;; |
| 77 | esac |
| 78 | |
| 79 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES} |
| 80 | runscip-shell shell mariadb 1:11.8.8-1 run(). apt-get build-dep -y ${mysql_server_package} |
| 81 | |
| 82 | runscip-shell shell mariadb 1:11.8.8-1 run(). mkdir -p build |
| 83 | runscip-shell shell mariadb 1:11.8.8-1 run(). cd build |
| 84 | runscip-shell shell mariadb 1:11.8.8-1 run(). tar xfz /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz |
| 85 | runscip-shell shell mariadb 1:11.8.8-1 run(). mv ${PACKAGE}-${VERSION} ${PACKAGE}-${MYSQL_VARIANT}-${VERSION} |
| 86 | ruscip-shell shell mariadb 1:11.8.8-1 run().nscip-shell shell mariadb 1:11.8.8-1 run(). tar cfz ${PACKAGE}-${MYSQL_VARIANT}_${VERSION}.orig.tar.gz \ |
| 87 | ${PACKAGE}-${MYSQL_VARIANT}-${VERSION} |
| 88 | runscip-shell shell mariadb 1:11.8.8-1 run(). cd ${PACKAGE}-${MYSQL_VARIANT}-${VERSION}/ |
| 89 | runscip-shell shell mariadb 1:11.8.8-1 run(). cp -rp /vagrant/tmp/debianscip-shell filesystem . . `/vagrant/tmp/debian`. debian |
| 90 | # export DEB_BUILD_OPTIONS=noopt |
| 91 | MYSQL_PACKAGE_INFO=$(apt-cachescip-shell system . . apt-cache. show ${mysql_server_package} | |
| 92 | grepscip-shell system . . grep. Version | |
| 93 | sortscip-shell system . . sort. | |
| 94 | tailscip-shell system . . tail. -1) |
| 95 | MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_INFO##Version: } |
| 96 | sedscip-shell system . . sed. -i'' \ |
| 97 | -e "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/g" \ |
| 98 | -e "s/MARIADB_VERSION/$MYSQL_PACKAGE_VERSION/g" \ |
| 99 | debian/control |
| 100 | runscip-shell shell mariadb 1:11.8.8-1 run(). debuild -us -uc |
| 101 | runscip-shell shell mariadb 1:11.8.8-1 run(). cd - |
| 102 | |
| 103 | package_initial=$(echoscip-shell system . . echo. "${PACKAGE}" | sedscip-shell system . . sed. -e 's/\(.\).*/\1/') |
| 104 | pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}" |
| 105 | runscip-shell shell mariadb 1:11.8.8-1 run(). mkdir -p "${pool_dir}/" |
| 106 | runscip-shell shell mariadb 1:11.8.8-1 run(). cp *.tar.* *.diff.gz *.dsc *.deb "${pool_dir}/" |