Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
b3efd44f
Commit
b3efd44f
authored
Sep 08, 2017
by
Ed Reel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PGDATA constant and use throughout
- Remove pgctl bash script - Add alias for ~/.bashrc
parent
de079d1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
packages/postgres.rb
packages/postgres.rb
+22
-18
No files found.
packages/postgres.rb
View file @
b3efd44f
...
...
@@ -16,31 +16,34 @@ class Postgres < Package
depends_on
'readline'
depends_on
'zlibpkg'
# Feel free to change this directory prior to compiling.
PGDATA
=
"
#{
CREW_PREFIX
}
/data/pgsql"
def
self
.
build
system
"sed -i 's,PGDATA=
\"
/usr/local/pgsql/data
\"
,PGDATA=
\"
#{
PGDATA
}
\"
,' contrib/start-scripts/linux"
system
"./configure \
--prefix=
#{
CREW_PREFIX
}
\
--libdir=
#{
CREW_LIB_PREFIX
}
"
system
"echo '#!/bin/bash' > pgctl"
system
"echo 'if [
\"
$1
\"
==
\"
--help
\"
]; then' >> pgctl"
system
"echo ' pg_ctl --help' >> pgctl"
system
"echo 'else' >> pgctl"
system
"echo ' pg_ctl -D
#{
CREW_PREFIX
}
/pgsql/data
\"
$@
\"
' >> pgctl"
system
"echo 'fi' >> pgctl"
system
"chmod +x pgctl"
system
"make world"
end
def
self
.
install
unless
Dir
.
exists?
"
#{
CREW_PREFIX
}
/pgsql/data"
system
"mkdir"
,
"-p"
,
"
#{
CREW_DEST_PREFIX
}
/pgsql/data"
system
"chmod"
,
"700"
,
"
#{
CREW_DEST_PREFIX
}
/pgsql/data"
# This conditional is needed for installation only.
unless
Dir
.
exists?
"
#{
PGDATA
}
"
system
"mkdir"
,
"-p"
,
"
#{
PGDATA
}
"
system
"chmod"
,
"700"
,
"
#{
PGDATA
}
"
end
system
"make"
,
"DESTDIR=
#{
CREW_DEST_DIR
}
"
,
"install-world"
system
"cp"
,
"pgctl"
,
"
#{
CREW_DEST_PREFIX
}
/bin"
end
def
self
.
postinstall
system
"initdb -D
#{
CREW_PREFIX
}
/pgsql/data"
unless
File
.
exists?
"
#{
CREW_PREFIX
}
/pgsql/data/PG_VERSION"
# This conditional is needed for installation only. If this package is updated in the future,
# there is no need to initialize the data directory and display messages again.
unless
File
.
exists?
"
#{
PGDATA
}
/PG_VERSION"
system
"initdb -D
#{
PGDATA
}
"
puts
puts
"To complete the installation, execute the following:"
.
lightblue
puts
"echo 'alias pgctl=
\"
pg_ctl -D
#{
PGDATA
}
\"
' >> ~/.bashrc && source ~/.bashrc"
.
lightblue
puts
puts
"To start postgres: pgctl -l logfile start"
.
lightblue
puts
"To stop postgres: pgctl stop"
.
lightblue
...
...
@@ -48,4 +51,5 @@ class Postgres < Package
puts
"Connect to database: psql <dbname>"
.
lightblue
puts
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment