diff options
author | Caleb Maclennan | 2020-02-28 11:11:00 +0300 |
---|---|---|
committer | Caleb Maclennan | 2020-02-28 11:22:51 +0300 |
commit | 2e05ad5becbdf8c591e6640e8d73fd5c4dd483a9 (patch) | |
tree | acdf5d3a9f775ff7ef279adf203424c4558f5511 | |
parent | b65838a5b833a3abec70de89ac0ea05a382b19a6 (diff) | |
download | aur-2e05ad5becbdf8c591e6640e8d73fd5c4dd483a9.tar.gz |
Move install hooks to backed subpackages
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | pagure-mariadb.install | 27 | ||||
-rw-r--r-- | pagure-postgresql.install (renamed from pagure.install) | 15 |
4 files changed, 40 insertions, 18 deletions
@@ -1,9 +1,8 @@ pkgbase = pagure pkgdesc = A git-centered forge based on python using pygit2 pkgver = 5.8.1 - pkgrel = 0.13 + pkgrel = 0.14 url = https://pagure.io/pagure - install = pagure.install arch = any license = GPL2 checkdepends = python-tox @@ -61,15 +60,19 @@ pkgname = pagure-apache pkgname = pagure-postgresql pkgdesc = A git-centered forge based on python using pygit2 (PostgreSQL backend configuration) + install = pagure-postgresql.install depends = pagure=5.8.1 depends = postresql depends = python-psycopg2 provides = pagure-backend + conflicts = pagure-mariadb pkgname = pagure-mariadb pkgdesc = A git-centered forge based on python using pygit2 (MariaDB backend configuration) + install = pagure-mariadb.install depends = pagure=5.8.1 depends = mariadb depends = python-mysqlclient provides = pagure-backend + conflicts = pagure-postgresql @@ -7,7 +7,7 @@ pkgbase=pagure pkgname=("$pkgbase" "$pkgbase-apache" "$pkgbase-postgresql" "$pkgbase-mariadb") pkgver=5.8.1 -pkgrel=0.13 +pkgrel=0.14 pkgdesc="A git-centered forge based on python using pygit2" arch=("any") url="https://pagure.io/$pkgbase" @@ -51,7 +51,6 @@ makedepends=('python-setuptools') checkdepends=('python-tox') source=("https://releases.pagure.org/$pkgbase/$pkgbase-$pkgver.tar.gz" "https://src.fedoraproject.org/rpms/pagure/raw/master/f/0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch") -install="$pkgbase.install" sha256sums=('5e150bad0a3f932d265cb59d46c8b6a532be0f757aab695a8c37df3f5f4db687' 'c1da9e6ae2255f7896920ecb261f18c59f8ad6ba5726a8484f6287ae3962c854') @@ -96,12 +95,14 @@ package_pagure-postgresql() { pkgdesc+=" (PostgreSQL backend configuration)" depends=("$pkgbase=$pkgver" 'postresql' 'python-psycopg2') # alternative: python-pg8000 provides=("$pkgbase-backend") - cd "$pkgbase-$pkgver" + conflicts=("$pkgbase-mariadb") + install="$pkgbase-postgresql.install" } package_pagure-mariadb() { pkgdesc+=" (MariaDB backend configuration)" depends=("$pkgbase=$pkgver" 'mariadb' 'python-mysqlclient') # alternative: python-pymysql provides=("$pkgbase-backend") - cd "$pkgbase-$pkgver" + conflicts=("$pkgbase-postgresql") + install="$pkgbase-mariadb.install" } diff --git a/pagure-mariadb.install b/pagure-mariadb.install new file mode 100644 index 000000000000..bcebf6952767 --- /dev/null +++ b/pagure-mariadb.install @@ -0,0 +1,27 @@ +post_install() { + cat <<- EOF + Te setup using MariaDB use: + + \$ sudo mysql -u root -p + mysql> create database pagure; + mysql> grant all privileges on pagure.* to pagure identified by '--PagureDBUserPW--'; + mysql> flush privileges; + mysql> exit + + Configure Pagure in /etc/pagure/pagure.cfg and /etc/pagure/alembic.ini + + Once configured, populate the database: + + \$ python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini + EOF +} + +post_upgrade() { + cat <<- EOF + Update Pagure database format using: + + \$ python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg + EOF +} + +# vim : ts=4 sw=4 noet diff --git a/pagure.install b/pagure-postgresql.install index 2a9e2abd74e6..3ba0fec95fa2 100644 --- a/pagure.install +++ b/pagure-postgresql.install @@ -1,6 +1,5 @@ post_install() { cat <<- EOF - Either MariaDB or PostgreSQL must be configured and running. To setup using PostreSQL, use: \$ sudo -u postgres psql @@ -12,19 +11,11 @@ post_install() { GRANT ALL PRIVILEGES ON ALL sequences IN SCHEMA public TO pagure; \\q - Te setup using MariaDB use: + Configure Pagure in /etc/pagure/pagure.cfg and /etc/pagure/alembic.ini - \$ sudo mysql -u root -p - mysql> create database pagure; - mysql> grant all privileges on pagure.* to pagure identified by '--PagureDBUserPW--'; - mysql> flush privileges; - mysql> exit + Once configured, populate the database: - Configure Pagure is /etc/pagure/pagure.cfg and /etc/pagure/alembic.ini - - Once configured with the correct backend, populate the database: - - python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini + \$ python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini EOF } |