-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
120 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ build | |
*.sublime-workspace | ||
*~ | ||
*.deb | ||
|
||
unwrap_deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
# shamelessly stolen from redis | ||
|
||
USER="relevanced" | ||
GROUP="$USER" | ||
|
||
chown $USER:$GROUP /var/lib/relevanced | ||
chown $USER:$GROUP /var/log/relevanced | ||
|
||
# Automatically added by dh_installinit | ||
if [ -x "/etc/init.d/relevanced" ]; then | ||
invoke-rc.d relevanced start || exit $? | ||
fi | ||
# End automatically added section | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# shamelessly stolen from redis | ||
|
||
if [ "$1" = "purge" ] | ||
then | ||
rm -rf /var/lib/relevanced | ||
userdel relevanced | ||
fi | ||
|
||
# In case this system is running systemd, we make systemd reload the unit files | ||
# to pick up changes. | ||
if [ -d /run/systemd/system ] ; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
# shamelessly stolen from redis | ||
|
||
USER="relevanced" | ||
GROUP="$USER" | ||
HOME="/var/lib/relevanced" | ||
|
||
# If we use NIS then errors should be tolerated. | ||
if which ypwhich >/dev/null 2>&1 && ypwhich >/dev/null 2>&1 | ||
then | ||
set +e | ||
fi | ||
|
||
if ! getent group $GROUP >/dev/null | ||
then | ||
addgroup --system $GROUP >/dev/null | ||
fi | ||
|
||
# creating user if it isn't already there | ||
if ! getent passwd $USER >/dev/null | ||
then | ||
adduser \ | ||
--system \ | ||
--disabled-login \ | ||
--ingroup $GROUP \ | ||
--home $HOME \ | ||
--gecos "$USER server" \ | ||
--shell /bin/false \ | ||
$USER >/dev/null | ||
fi | ||
|
||
# end of NIS tolerance zone | ||
set -e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
#shamelessly stolen from redis | ||
|
||
# Automatically added by dh_installinit | ||
if [ -x "/etc/init.d/relevanced" ]; then | ||
invoke-rc.d relevanced stop || exit $? | ||
fi | ||
# End automatically added section |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/var/log/relevanced/*.log { | ||
daily | ||
missingok | ||
copytruncate | ||
rotate 12 | ||
compress | ||
notifempty | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,10 @@ fi | |
OUTPUT_PKG_PATH="$BUILD_DIR/$PACKAGE_NAME-$PACKAGE_VERSION." | ||
|
||
# Config files | ||
INITD_SRC="$SCRIPT_DIR/relevanced.initd" | ||
INITD_SRC="${SCRIPT_DIR}/etc/init.d/relevanced" | ||
INITD_DST="/etc/init.d/relevanced" | ||
JSON_CONFIG_SRC=${SCRIPT_DIR}/etc/relevanced/relevanced.json | ||
LOGROTATE_CONFIG_SRC=${SCRIPT_DIR}/etc/logrotate.d/relevanced | ||
RELEVANCED_LOG_DIR="/var/log/relevanced/" | ||
RELEVANCED_VAR_DIR="/var/lib/relevanced" | ||
RELEVANCED_ETC_DIR="/etc/relevanced" | ||
|
@@ -100,14 +102,18 @@ function main() { | |
mkdir -p $INSTALL_PREFIX/$RELEVANCED_VAR_DIR/data | ||
mkdir -p $INSTALL_PREFIX/$RELEVANCED_LOG_DIR | ||
mkdir -p $INSTALL_PREFIX/$RELEVANCED_ETC_DIR | ||
mkdir -p $INSTALL_PREFIX/etc/logrotate.d | ||
|
||
mkdir -p `dirname $INSTALL_PREFIX$INITD_DST` | ||
cp $SCRIPT_DIR/relevanced.json $INSTALL_PREFIX/$RELEVANCED_ETC_DIR/relevanced.json | ||
cp $INITD_SRC $INSTALL_PREFIX$INITD_DST | ||
cp $JSON_CONFIG_SRC $INSTALL_PREFIX/$RELEVANCED_ETC_DIR/relevanced.json | ||
|
||
cp $INITD_SRC $INSTALL_PREFIX$INITD_DST | ||
chmod g-w $INSTALL_PREFIX$INITD_DST | ||
chmod a+x $INSTALL_PREFIX$INITD_DST | ||
|
||
LOGROTATE_DEST=$INSTALL_PREFIX/etc/logrotate.d/relevanced | ||
cp $LOGROTATE_CONFIG_SRC $LOGROTATE_DEST | ||
chmod 644 $LOGROTATE_DEST | ||
log "creating package" | ||
IFS=',' read -a deps <<< "$PACKAGE_DEPENDENCIES" | ||
PACKAGE_DEPENDENCIES= | ||
|
@@ -128,11 +134,18 @@ function main() { | |
$PACKAGE_DEPENDENCIES \ | ||
-p $OUTPUT_PKG_PATH \ | ||
--config-files etc/relevanced/relevanced.json \ | ||
--config-files etc/init.d/relevanced \ | ||
--config-files etc/logrotate.d/relevanced \ | ||
--before-install ${SCRIPT_DIR}/deb/preinst \ | ||
--after-install ${SCRIPT_DIR}/deb/postinst \ | ||
--before-remove ${SCRIPT_DIR}/deb/prerm \ | ||
--after-remove ${SCRIPT_DIR}/deb/postrm \ | ||
--url http://www.relevanced.org \ | ||
-m [email protected] \ | ||
--license MIT \ | ||
--description \"$DESCRIPTION\" \ | ||
\"$INSTALL_PREFIX/=/\"" | ||
echo "running: $CMD" | ||
eval "$CMD" | ||
log "package created at $OUTPUT_PKG_PATH" | ||
} | ||
|