added method for running firefish on macOS (dev/macos/README.md, dev/macos/build-pgroonga.sh, dev/macos/install.sh, dev/macos/start-postgres.sh, dev/macos/start-redis.sh)

This commit is contained in:
ひでまる 2024-08-26 07:58:10 +09:00
parent 532a493a62
commit 32b86e7285
5 changed files with 74 additions and 0 deletions

52
dev/macos/README.md Normal file
View file

@ -0,0 +1,52 @@
## macOS installation methods
- install redis and postgresql
```bash
./install.sh
```
- build pgroonga
```bash
./build-pgroonga.sh
```
- start redis and postgresql
```bash
./start-postgres.sh
# and
./start-redis.sh
```
- setup detabase
* create db and user
```bash
psql -d postgres -U $USER
```
```sql
-- Create a new PostgreSQL user named 'firefish' with encrypted password.
-- This user will not have superuser, createdb, or createrole privileges.
CREATE USER firefish WITH ENCRYPTED PASSWORD 'password' SUPERUSER NOCREATEDB NOCREATEROLE;
-- Create a new database named 'firefish_db' with UTF8 encoding and owned by the 'firefish' user.
CREATE DATABASE firefish_db WITH ENCODING 'UTF8' OWNER firefish;
```
- enable pgroonga extension
```bash
# enter this command then type password
psql -U firefish -d firefish_db -W
```
```sql
-- This ensures the PGroonga extension is enabled for the database.
CREATE EXTENSION pgroonga;
```

8
dev/macos/build-pgroonga.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
sudo -v
brew install groonga
git clone --recursive https://github.com/pgroonga/pgroonga.git --depth 1
cd pgroonga
make
sudo make install

3
dev/macos/install.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
brew install redis
brew install postgresql@16

9
dev/macos/start-postgres.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/postgresql@16/lib"
export CPPFLAGS="-I/opt/homebrew/opt/postgresql@16/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/postgresql@16/lib/pkgconfig"
LC_ALL="C" /opt/homebrew/opt/postgresql@16/bin/postgres -D /opt/homebrew/var/postgresql@16

2
dev/macos/start-redis.sh Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
redis-server