[luci/pkg-update] initscript: trailing whitespace removed
by Jan Pokorný
commit 85e389d36bbb4b73155e35e5855c537acade9935
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Wed Oct 27 15:50:31 2010 +0200
initscript: trailing whitespace removed
init.d/luci | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/init.d/luci b/init.d/luci
index eb10532..422f238 100755
--- a/init.d/luci
+++ b/init.d/luci
@@ -19,7 +19,7 @@
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/sbin"
-# Defaults for luci. These can be overridden by the contents of
+# Defaults for luci. These can be overridden by the contents of
# /etc/sysconfig/luci (or /etc/default/luci on deb-based distributions)
# Local configuration "macros" used in other configuration fields below
13 years, 6 months
[luci/pkg-update] initscript: not generate priv./public part of cert
by Jan Pokorný
commit acb4f8158826f48f8ba72cecd7f1a7134e1914ec
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Wed Oct 27 15:45:45 2010 +0200
initscript: not generate priv./public part of cert
- no need for regenerating of private/public part of certificate if the
final certificate already exists
-> private/public parts are generated only when the certificate itself
is missing
init.d/luci | 69 +++++++++++++++++++++++++++++------------------------------
1 files changed, 34 insertions(+), 35 deletions(-)
---
diff --git a/init.d/luci b/init.d/luci
index cfd8469..eb10532 100755
--- a/init.d/luci
+++ b/init.d/luci
@@ -58,49 +58,48 @@ fi
[ -w /var/lib/luci ] || exit 4
# Create the luci database if luci has not previously run (or the database
-# has disappeared).
+# has disappeared), similarly for its SSL certificate
luci_init() {
- if [ ! -f "$LUCI_CERT_PRIV" ]; then
- /usr/bin/openssl genrsa -out "$LUCI_CERT_PRIV" "$LUCI_CERT_KEY_BITS" >&/dev/null
- if [ $? -ne 0 ] ; then
- rm -f -- "$LUCI_CERT_PRIV" >& /dev/null
- echo "Unable to generate the luci private certificate file."
- return 1
- fi
- chmod 600 "$LUCI_CERT_PRIV"
- chown $LUCI_USER:$LUCI_GROUP "$LUCI_CERT_PRIV"
- if [ $? -ne 0 ]; then
- echo "Unable to change ownership of the luci private certificate file."
- rm -f -- "$LUCI_CERT_PRIV" >& /dev/null
- return 1
- fi
- fi
-
- if [ ! -f "$LUCI_CERT_PUB" ]; then
- /usr/bin/openssl req -new -x509 -key "$LUCI_CERT_PRIV" -out "$LUCI_CERT_PUB" -days "$LUCI_CERT_KEY_LIFE_DAYS" -set_serial "$(/bin/date +%s)" -config "$LUCI_CERT_CONFIG"
- if [ $? -ne 0 ]; then
- rm -f -- "$LUCI_CERT_PUB" >& /dev/null
- echo "Unable to generate the luci public certificate file."
- return 1
+ # Verify existence of SSL certificate
+ if [ ! -f "$LUCI_CERT_PEM" ]; then
+ # Verify existence of private and public parts of certificate first
+ if [ ! -f "$LUCI_CERT_PRIV" ]; then
+ /usr/bin/openssl genrsa -out "$LUCI_CERT_PRIV" "$LUCI_CERT_KEY_BITS" >&/dev/null
+ if [ $? -ne 0 ] ; then
+ rm -f -- "$LUCI_CERT_PRIV" >& /dev/null
+ echo "Unable to generate the luci private certificate file."
+ return 1
+ fi
+ chmod 600 "$LUCI_CERT_PRIV"
+ chown $LUCI_USER:$LUCI_GROUP "$LUCI_CERT_PRIV"
+ if [ $? -ne 0 ]; then
+ echo "Unable to change ownership of the luci private certificate file."
+ rm -f -- "$LUCI_CERT_PRIV" >& /dev/null
+ return 1
+ fi
fi
-
- chmod 600 "$LUCI_CERT_PUB"
- chown $LUCI_USER:$LUCI_GROUP "$LUCI_CERT_PUB"
- if [ $? -ne 0 ]; then
- rm -f -- "$LUCI_CERT_PUB" >& /dev/null
- echo "Unable to change ownership of the luci public certificate file."
- return 1
+ if [ ! -f "$LUCI_CERT_PUB" ]; then
+ /usr/bin/openssl req -new -x509 -key "$LUCI_CERT_PRIV" -out "$LUCI_CERT_PUB" -days "$LUCI_CERT_KEY_LIFE_DAYS" -set_serial "$(/bin/date +%s)" -config "$LUCI_CERT_CONFIG"
+ if [ $? -ne 0 ]; then
+ rm -f -- "$LUCI_CERT_PUB" >& /dev/null
+ echo "Unable to generate the luci public certificate file."
+ return 1
+ fi
+ chmod 600 "$LUCI_CERT_PUB"
+ chown $LUCI_USER:$LUCI_GROUP "$LUCI_CERT_PUB"
+ if [ $? -ne 0 ]; then
+ rm -f -- "$LUCI_CERT_PUB" >& /dev/null
+ echo "Unable to change ownership of the luci public certificate file."
+ return 1
+ fi
fi
- fi
-
- if [ ! -f "$LUCI_CERT_PEM" ]; then
+ # Generate the SSL certificate for end use
cat $LUCI_CERT_PRIV $LUCI_CERT_PUB > $LUCI_CERT_PEM
if [ $? -ne 0 ]; then
rm -f -- "$LUCI_CERT_PEM" >& /dev/null
echo "Unable to generate the luci host certificate file."
return 1
fi
-
chmod 600 "$LUCI_CERT_PEM"
chown $LUCI_USER:$LUCI_GROUP "$LUCI_CERT_PEM"
if [ $? -ne 0 ]; then
@@ -110,13 +109,13 @@ luci_init() {
fi
fi
+ # Verify the existence of luci database
if [ ! -f "$LUCI_DB_FILE" ]; then
/usr/bin/paster setup-app "$LUCI_CONFIG_FILE" >& /dev/null
if [ $? -ne 0 ]; then
echo "Unable to create the luci database file."
return 1
fi
-
chown $LUCI_USER:$LUCI_GROUP "$LUCI_DB_FILE"
if [ $? -ne 0 ]; then
echo "Unable to change ownership of the luci database file."
13 years, 6 months
[luci/pkg-update] revert on file from previous commit
by Jan Pokorný
commit 2f468077d1f2a6b707e5bb43edc874ad983551de
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Wed Oct 27 15:21:05 2010 +0200
revert on file from previous commit
- the change in this file was not meant to be committed
luci/config/middleware.py | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/luci/config/middleware.py b/luci/config/middleware.py
index e82c698..8afab93 100644
--- a/luci/config/middleware.py
+++ b/luci/config/middleware.py
@@ -43,10 +43,5 @@ def make_app(global_conf, full_stack=True, **app_conf):
app_conf.get('who.log_file','stdout'),
app_conf.get('who.log_level','debug')
)
-
- print "----"
- print global_conf
- print "---"
- print app_conf
-
+
return app
13 years, 6 months
[luci/pkg-update] config: little enhancements
by Jan Pokorný
commit faa815fdee252936247a3e58684558897399c58c
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Wed Oct 27 15:17:23 2010 +0200
config: little enhancements
init.d/luci | 17 ++++++++++-------
init.d/luci.sysconfig | 31 +++++++++++++------------------
luci/config/middleware.py | 7 ++++++-
3 files changed, 29 insertions(+), 26 deletions(-)
---
diff --git a/init.d/luci b/init.d/luci
index 779c23c..cfd8469 100755
--- a/init.d/luci
+++ b/init.d/luci
@@ -18,33 +18,36 @@
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/sbin"
+
# Defaults for luci. These can be overridden by the contents of
# /etc/sysconfig/luci (or /etc/default/luci on deb-based distributions)
-LUCI_USER=luci
-LUCI_GROUP=luci
-
-LUCI_HTTPS_PORT=8084
+# Local configuration "macros" used in other configuration fields below
LUCI_DATA_DIR="/var/lib/luci"
LUCI_CONF_DIR="/var/lib/luci/etc"
LUCI_LOG_DIR="/var/log/luci"
LUCI_CERT_DIR="$LUCI_DATA_DIR/certs"
+# Run specific configuration
+LUCI_USER=luci
+LUCI_GROUP=luci
+LUCI_HTTPS_PORT=8084
+
+# Locations of files used during the run
LUCI_CONFIG_FILE="$LUCI_CONF_DIR/luci.ini"
LUCI_DB_FILE="$LUCI_DATA_DIR/data/luci.db"
LUCI_PID_FILE="$LUCI_DATA_DIR/data/luci.pid"
LUCI_PASTER_LOG="$LUCI_LOG_DIR/luci.log"
-LUCI_CERT_CONFIG="$LUCI_CONF_DIR/cacert.config"
+# SSL certificate specific configuration
LUCI_CERT_PRIV="$LUCI_CERT_DIR/privkey.pem"
LUCI_CERT_PUB="$LUCI_CERT_DIR/cacert.pem"
LUCI_CERT_PEM="$LUCI_CERT_DIR/host.pem"
+LUCI_CERT_CONFIG="$LUCI_CONF_DIR/cacert.config"
LUCI_CERT_KEY_LIFE_DAYS='1825'
LUCI_CERT_KEY_BITS='2048'
-LUCI_MAX_WAIT=30
-
if [ -d /etc/sysconfig ]; then
[ -f /etc/sysconfig/luci ] && . /etc/sysconfig/luci
elif [ -d /etc/default ]; then
diff --git a/init.d/luci.sysconfig b/init.d/luci.sysconfig
index 22b965c..bca2a81 100755
--- a/init.d/luci.sysconfig
+++ b/init.d/luci.sysconfig
@@ -1,12 +1,13 @@
# User serviceable configuration of luci
#
-# This file uses a bit awkward structure because it is meant to be parseable
-# by both shell and Python's ConfigParser. If you want to change some provided
-# configuration item (i.e. explicitly redefine luci's defaults for this item),
-# uncomment particular line and set your value.
+# This configuration file uses a rather uncommon structure because it is
+# intended to be parseable by both shell and Python's ConfigParser. If you
+# want to change any configuration item provided (i.e. to explicitly redefine
+# luci's defaults for this item), uncomment particular line and set your
+# value.
#
# Please modify user configurable items only, do not change anything else!
-# All user configurable items have "Change this to set..." above them.
+# All user configurable items have "Change this to set..." comment above them.
#
# Remember to restart luci for the changes to take effect.
@@ -31,13 +32,13 @@
#LUCI_CERT_CONFIG="path_to/cert_config"
# Change this to set how long the certificate will be valid (since generation)
-#LUCI_CERT_KEY_LIFE_DAYS='1825'
+#LUCI_CERT_KEY_LIFE_DAYS='1826'
# Change this to set bit-length of the private key for generating certificate
#LUCI_CERT_KEY_BITS='2048'
# Do NOT change, provides shell/ConfigParser compatibility for sections below
-SERVER_CONF=`cat <<"#END#"
+SERVER_CONF=`cat -E <<"#END#"
[server:main]
@@ -46,13 +47,13 @@ SERVER_CONF=`cat <<"#END#"
# Change this to set the host where server facilities for luci to be listening;
# this is useful when the host has more interfaces while luci should run only
-# at a specific one, given the IP address of this interface (0.0.0.0 => all)
+# at a specific one, given the IP address of this interface (0.0.0.0 => any)
#host = 0.0.0.0
# Change this to set the port where server facilities for luci to be listening
-port = 4567
+#port = 4443
-# Do NOT change, pointing back to the main configuration file incl. defaults
+# Do NOT change this necessary pointer back to the main configuration file
use = config:%(__file__)s
@@ -60,15 +61,9 @@ use = config:%(__file__)s
# LUCI APPLICATION SPECIFIC CONFIGURATION SECTION
# Python's ConfigParser syntax (no quoted strings, but generally more relaxed)
-# Change this to set the host where server facilities for luci to be listening;
-# this is useful when the host has more interfaces while luci should run only
-# at a specific one, given the IP address of this interface (0.0.0.0 => all)
-#host = 0.0.0.0
-
-# Change this to set the port where server facilities for luci to be listening
-#port = 4567
+# (This section may be utilized in the future.)
-# Do NOT change, pointing back to the main configuration file incl. defaults
+# Do NOT change this necessary pointer back to the main configuration file
use = config:%(__file__)s
diff --git a/luci/config/middleware.py b/luci/config/middleware.py
index 8afab93..e82c698 100644
--- a/luci/config/middleware.py
+++ b/luci/config/middleware.py
@@ -43,5 +43,10 @@ def make_app(global_conf, full_stack=True, **app_conf):
app_conf.get('who.log_file','stdout'),
app_conf.get('who.log_level','debug')
)
-
+
+ print "----"
+ print global_conf
+ print "---"
+ print app_conf
+
return app
13 years, 6 months
[luci/pkg-update] config: initial work on config. out of initscript
by Jan Pokorný
commit ba000c60738c3e2ba17ace5dbb19fca7b594c460
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Tue Oct 26 14:55:30 2010 +0200
config: initial work on config. out of initscript
config/luci.ini | 75 +++++++++++++++++++++++++++++++-----------
development.ini | 85 ++++++++++++++-----------------------------------
init.d/luci.sysconfig | 76 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 155 insertions(+), 81 deletions(-)
---
diff --git a/config/luci.ini b/config/luci.ini
index 7ee0634..7f53c4a 100644
--- a/config/luci.ini
+++ b/config/luci.ini
@@ -1,26 +1,61 @@
# luci - Pylons environment configuration
#
# The %(here)s variable will be replaced with the parent directory of this file
-#
-# This file is for deployment specific config options -- other configuration
-# that is always required for the app is done in the config directory,
-# and generally should not be modified by end users.
+
[DEFAULT]
+# Global defaults
+
debug = false
# Uncomment and replace with the address which should receive any error reports
#email_to = you(a)yourdomain.com
#smtp_server = localhost
#error_email_from = paste@localhost
+# Paths
+sysconfig_file = /etc/sysconfig/luci
+
+# Server defaults
+def_srv_host = 0.0.0.0
+def_srv_port = 8084
+def_srv_ssl_pem = /var/lib/luci/certs/host.pem
+
+# Application defaults
+def_app_foo = bar
+
+#
+# SERVER CONFIGURATIONS
+#
+
[server:main]
+# Main server configuration
+
use = egg:Paste#http
-host = 0.0.0.0
-ssl_pem = /var/lib/luci/certs/host.pem
-port = 8084
+
+# Following will be set only if not already (i.e. no overriding)
+host = %(def_srv_host)s
+port = %(def_srv_port)s
+ssl_pem = %(def_srv_ssl_pem)s
+
+[server:init]
+# Server configuration considering user config. (initscript usage)
+
+use = config:%(sysconfig_file)s
+
+# Add items that should not be overriden from "use" config. target, e.g.:
+# ssl_pem = %(def_srv_ssl_pem)s
+
+
+#
+# APPLICATION CONFIGURATIONS
+#
[app:main]
+# Main application configuration
+
use = egg:luci
+
+# Following will be set only if not already (i.e. no overriding)
full_stack = false
cache_dir = /var/lib/luci/data
beaker.session.key = luci
@@ -40,27 +75,27 @@ sqlalchemy.echo = false
sqlalchemy.echo_pool = false
sqlalchemy.pool_recycle = 3600
-templating.mako.reloadfromdisk = false
-
-# the compiled template dir is a directory that must be readable by your
-# webserver. It will be used to store the resulting templates once compiled
-# by the TemplateLookup system.
-# During development you generally don't need this option since paste's HTTP
-# server will have access to you development directories, but in production
-# you'll most certainly want to have apache or nginx to write in a directory
-# that does not contain any source code in any form for obvious security reasons.
-#
-#templating.mako.compiled_templates_dir = /some/dir/where/webserver/has/access
-
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
# Debug mode will enable the interactive debugging tool, allowing ANYONE to
# execute malicious code after an exception is raised.
set debug = false
-# Logging configuration
+[app:init]
+# Application configuration considering user config. (initscript usage)
+
+use = config:%(sysconfig_file)s
+
+# Add items that should not be overriden from "use" config. target, e.g.:
+# foo = %(def_app_foo)s
+
+
+#
+# LOGGING CONFIGURATION
+#
# Add additional loggers, handlers, formatters here
# Uses python's logging config file format
# http://docs.python.org/lib/logging-config-fileformat.html
+#
[loggers]
keys = root, luci, sqlalchemy, auth, tgi18n
diff --git a/development.ini b/development.ini
index 9ec7814..8973d45 100644
--- a/development.ini
+++ b/development.ini
@@ -1,88 +1,51 @@
-#
# luci - Pylons development environment configuration
#
# The %(here)s variable will be replaced with the parent directory of this file
-#
-# This file is for deployment specific config options -- other configuration
-# that is always required for the app is done in the config directory,
-# and generally should not be modified by end users.
+
[DEFAULT]
+# Global defaults
+
debug = true
# Uncomment and replace with the address which should receive any error reports
#email_to = you(a)yourdomain.com
smtp_server = localhost
error_email_from = paste@localhost
+foo = bar
-[server:main]
-use = egg:Paste#http
-host = 0.0.0.0
-port = 8080
-[app:main]
-use = egg:luci
-full_stack = true
-#lang = ru
-cache_dir = %(here)s/data
-beaker.session.key = luci
-beaker.session.secret = somesecret
-who.config_file = %(here)s/config/who.ini
-who.log_level = warning
-who.log_file = stdout
+#
+# SERVER CONFIGURATIONS
+#
-# If you'd like to fine-tune the individual locations of the cache data dirs
-# for the Cache data, or the Session saves, un-comment the desired settings
-# here:
-#beaker.cache.data_dir = %(here)s/data/cache
-#beaker.session.data_dir = %(here)s/data/sessions
+[server:main]
+use = config:%(here)s/luci.ini
-# pick the form for your database
-# %(here) may include a ':' character on Windows environments; this can
-# invalidate the URI when specifying a SQLite db via path name
-# sqlalchemy.url=postgres://username:password@hostname:port/databasename
-# sqlalchemy.url=mysql://username:password@hostname:port/databasename
+#
+# APPLICATION CONFIGURATIONS
+#
-# If you have sqlite, here's a simple default to get you started
-# in development
+[app:main]
+use = config:%(here)s/luci.ini
+full_stack = true
+cache_dir = %(here)s/data
+who.config_file = %(here)s/config/who.ini
+beaker.cache.data_dir = %(here)s/data/cache
+beaker.session.data_dir = %(here)s/data/sessions
sqlalchemy.url = sqlite:///%(here)s/devdata.db
-#echo shouldn't be used together with the logging module.
-sqlalchemy.echo = false
-sqlalchemy.echo_pool = false
-sqlalchemy.pool_recycle = 3600
-
-# if you are using Mako and want to be able to reload
-# the mako template from disk during the development phase
-# you should say 'true' here
-# This option is only used for mako templating engine
-# WARNING: if you want to deploy your application using a zipped egg
-# (ie: if your application's setup.py defines zip-safe=True, then you
-# MUST put "false" for the production environment because there will
-# be no disk and real files to compare time with.
-# On the contrary if your application defines zip-safe=False and is
-# deployed in an unzipped manner, then you can leave this option to true
-templating.mako.reloadfromdisk = true
-
-# the compiled template dir is a directory that must be readable by your
-# webserver. It will be used to store the resulting templates once compiled
-# by the TemplateLookup system.
-# During development you generally don't need this option since paste's HTTP
-# server will have access to you development directories, but in production
-# you'll most certainly want to have apache or nginx to write in a directory
-# that does not contain any source code in any form for obvious security reasons.
-#
-#templating.mako.compiled_templates_dir = /some/dir/where/webserver/has/access
-# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
-# Debug mode will enable the interactive debugging tool, allowing ANYONE to
-# execute malicious code after an exception is raised.
set debug = true
-# Logging configuration
+
+#
+# LOGGING CONFIGURATION
+#
# Add additional loggers, handlers, formatters here
# Uses python's logging config file format
# http://docs.python.org/lib/logging-config-fileformat.html
+#
[loggers]
keys = root, luci, sqlalchemy, auth, tgi18n
diff --git a/init.d/luci.sysconfig b/init.d/luci.sysconfig
new file mode 100755
index 0000000..22b965c
--- /dev/null
+++ b/init.d/luci.sysconfig
@@ -0,0 +1,76 @@
+# User serviceable configuration of luci
+#
+# This file uses a bit awkward structure because it is meant to be parseable
+# by both shell and Python's ConfigParser. If you want to change some provided
+# configuration item (i.e. explicitly redefine luci's defaults for this item),
+# uncomment particular line and set your value.
+#
+# Please modify user configurable items only, do not change anything else!
+# All user configurable items have "Change this to set..." above them.
+#
+# Remember to restart luci for the changes to take effect.
+
+
+[ ]
+# GENERIC CONFIGURATION SECTION
+# Shell syntax (i.e. FOO=bar, BAZ="white space string")
+
+# Change this to set user effectively running server facilities for luci
+#LUCI_USER=luci
+
+# Change this to set group effectively running server facilities for luci
+#LUCI_GROUP=luci
+
+# Change this to set log file for luci
+#LUCI_PASTER_LOG="path_to/log_file"
+
+# Change this to set a directory used for generating certificate (if missing)
+#LUCI_CERT_DIR="path_to/cert_dir"
+
+# Change this to set a template used for generating certificate (if missing)
+#LUCI_CERT_CONFIG="path_to/cert_config"
+
+# Change this to set how long the certificate will be valid (since generation)
+#LUCI_CERT_KEY_LIFE_DAYS='1825'
+
+# Change this to set bit-length of the private key for generating certificate
+#LUCI_CERT_KEY_BITS='2048'
+
+# Do NOT change, provides shell/ConfigParser compatibility for sections below
+SERVER_CONF=`cat <<"#END#"
+
+
+[server:main]
+# SERVER SPECIFIC CONFIGURATION SECTION
+# Python's ConfigParser syntax (no quoted strings, but generally more relaxed)
+
+# Change this to set the host where server facilities for luci to be listening;
+# this is useful when the host has more interfaces while luci should run only
+# at a specific one, given the IP address of this interface (0.0.0.0 => all)
+#host = 0.0.0.0
+
+# Change this to set the port where server facilities for luci to be listening
+port = 4567
+
+# Do NOT change, pointing back to the main configuration file incl. defaults
+use = config:%(__file__)s
+
+
+[app:main]
+# LUCI APPLICATION SPECIFIC CONFIGURATION SECTION
+# Python's ConfigParser syntax (no quoted strings, but generally more relaxed)
+
+# Change this to set the host where server facilities for luci to be listening;
+# this is useful when the host has more interfaces while luci should run only
+# at a specific one, given the IP address of this interface (0.0.0.0 => all)
+#host = 0.0.0.0
+
+# Change this to set the port where server facilities for luci to be listening
+#port = 4567
+
+# Do NOT change, pointing back to the main configuration file incl. defaults
+use = config:%(__file__)s
+
+
+# Do NOT remove this last line:
+#END#`
13 years, 6 months
[luci/pkg-update] spec: initscripts must not be marked with %config
by Jan Pokorný
commit 4e2a4143fa85bf805d7862466cb8a09640e404fa
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Oct 25 15:19:24 2010 +0200
spec: initscripts must not be marked with %config
- see: http://fedoraproject.org/wiki/Packaging:SysVInitScript#Initscript_packaging
luci.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/luci.spec b/luci.spec
index d96fdb4..13886c1 100644
--- a/luci.spec
+++ b/luci.spec
@@ -80,6 +80,7 @@ rm -rf %{buildroot}
%{python_sitelib}/%{name}/
%{python_sitelib_arch}/LuciPAM-1.0-py%{pyver}.egg-info
%{python_sitelib_arch}/lucipam.so
+%{_sysconfdir}/rc.d/init.d/luci
%config(noreplace) /etc/pam.d/luci
%config(noreplace) %{_localstatedir}/lib/luci/etc/luci.ini
@@ -87,7 +88,6 @@ rm -rf %{buildroot}
%config(noreplace) %{_localstatedir}/lib/luci/etc/cacert.config
%attr(0600,%{username},%{groupname}) %{_localstatedir}/lib/luci/etc/cacert.config
%attr(0750,%{username},%{groupname}) %{_localstatedir}/lib/luci
-%config(noreplace) %{_sysconfdir}/rc.d/init.d/luci
%dir /var/log/luci
%attr(0750,%{username},%{groupname}) /var/log/luci
13 years, 6 months
[luci/pkg-update] spec: fix "cd bar && foo; cd.." if no such bar
by Jan Pokorný
commit ccd996a0adf1eed4173ae9ea80df26a250547377
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Oct 25 14:58:25 2010 +0200
spec: fix "cd bar && foo; cd.." if no such bar
- uses pushd, popd
luci.spec | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/luci.spec b/luci.spec
index 1a09ffc..d96fdb4 100644
--- a/luci.spec
+++ b/luci.spec
@@ -61,9 +61,13 @@ python setup.py build
rm -rf %{buildroot}
mkdir -p %{buildroot}/var/log/luci
python setup.py install --skip-build --root %{buildroot}
-cd init.d && make DESTDIR=%{buildroot} RUNUSER=%{username} RUNGROUP=%{groupname} install;cd ..
-cd config && make DESTDIR=%{buildroot} install;cd ..
-cd lucipam && python setup.py install --root %{buildroot}; cd ..
+pushd -n "$(pwd)" >/dev/null
+cd init.d && make DESTDIR=%{buildroot} RUNUSER=%{username} RUNGROUP=%{groupname} install
+popd >/dev/null; pushd -n "$(pwd)" >/dev/null
+cd config && make DESTDIR=%{buildroot} install
+popd >/dev/null; pushd -n "$(pwd)" >/dev/null
+cd lucipam && python setup.py install --root %{buildroot}
+popd >/dev/null
%clean
rm -rf %{buildroot}
13 years, 6 months
[luci/pkg-update] spec/initscript makefile: fixed sed command
by Jan Pokorný
commit e65734cd94d66d22e781290dcad8421501601726
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Oct 25 14:46:03 2010 +0200
spec/initscript makefile: fixed sed command
init.d/Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/init.d/Makefile b/init.d/Makefile
index 1f390d1..cf60c63 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -12,7 +12,7 @@ install: set_usergroup
/usr/bin/install ${TARGET} ${sysconfdir}/rc.d/init.d
set_usergroup:
- sed -ni "s/\(LUCI_USER=\)[^$]*$/\1${RUN_USER}/;" \
- "s/\(LUCI_GROUP=\)[^$]*$/\1${RUN_GROUP}/;" ${TARGET}
+ sed -ni -e "s/\(LUCI_USER=\)[^$]*$/\1${RUN_USER}/;" \
+ -e "s/\(LUCI_GROUP=\)[^$]*$/\1${RUN_GROUP}/;" ${TARGET}
clean:
13 years, 6 months
[luci/pkg-update] spec/initscript makefile: user/group parameterized
by Jan Pokorný
commit 4e38820d062a7fcea3cd0c09637dde982a64cdae
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Oct 25 14:35:01 2010 +0200
spec/initscript makefile: user/group parameterized
init.d/Makefile | 10 +++++++++-
luci.spec | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/init.d/Makefile b/init.d/Makefile
index 0fdd546..1f390d1 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -1,10 +1,18 @@
TARGET = luci
+RUN_USER ?= luci
+RUN_GROUP ?= ${RUN_USER}
sysconfdir ?= ${DESTDIR}/etc
+.PHONY = all install set_group clean
+
all:
-install:
+install: set_usergroup
/usr/bin/install -d ${sysconfdir}/rc.d/init.d
/usr/bin/install ${TARGET} ${sysconfdir}/rc.d/init.d
+set_usergroup:
+ sed -ni "s/\(LUCI_USER=\)[^$]*$/\1${RUN_USER}/;" \
+ "s/\(LUCI_GROUP=\)[^$]*$/\1${RUN_GROUP}/;" ${TARGET}
+
clean:
diff --git a/luci.spec b/luci.spec
index ad94aac..1a09ffc 100644
--- a/luci.spec
+++ b/luci.spec
@@ -61,7 +61,7 @@ python setup.py build
rm -rf %{buildroot}
mkdir -p %{buildroot}/var/log/luci
python setup.py install --skip-build --root %{buildroot}
-cd init.d && make DESTDIR=%{buildroot} install;cd ..
+cd init.d && make DESTDIR=%{buildroot} RUNUSER=%{username} RUNGROUP=%{groupname} install;cd ..
cd config && make DESTDIR=%{buildroot} install;cd ..
cd lucipam && python setup.py install --root %{buildroot}; cd ..
13 years, 6 months
[luci/pkg-update] spec: added note (man.user/gr.fix not recommended)
by Jan Pokorný
commit 688a892ab5a7451945be8080bd2977502e4950d9
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Oct 25 13:48:06 2010 +0200
spec: added note (man.user/gr.fix not recommended)
luci.spec | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/luci.spec b/luci.spec
index 534fecb..ad94aac 100644
--- a/luci.spec
+++ b/luci.spec
@@ -100,13 +100,13 @@ if [ "$str_groupid" == "$str_groupname" ]; then
fi
# Otherwise everything is already prepared wrt groups (perhaps upgrade)
else
- echo "Error: unexpected state of group \`%{groupname}' (gid %{groupid})"\
+ echo "ERROR: unexpected state of group \`%{groupname}' (gid %{groupid})"\
"encountered (colliding group probably created manually"\
"beforehand)" >&2
- echo "Solution: make sure that there is no group named \`%{groupname}'"\
+ echo "SOLUTION: make sure that there is no group named \`%{groupname}'"\
"and also no group uses gid %{groupid}, then reinstall;"\
"alternatively, make sure that mentioned group name matches"\
- "mentioned gid, then reinstall" >&2
+ "mentioned gid, then reinstall (not recommended)" >&2
group_ready=0
fi
if [ $group_ready -eq 1 ]; then
@@ -122,13 +122,13 @@ if [ $group_ready -eq 1 ]; then
fi
# Otherwise everything is already prepared wrt users (perhaps upgrade)
else
- echo "Error: unexpected state of user \`%{username}'"\
+ echo "ERROR: unexpected state of user \`%{username}'"\
"(uid %{userid}) encountered (colliding user probably created"\
"manually beforehand)" >&2
- echo "Solution: make sure that there is no user named \`%{username}'"\
+ echo "SOLUTION: make sure that there is no user named \`%{username}'"\
"and also no user uses uid %{userid}, then reinstall;"\
"alternatively, make sure that mentioned user name matches"\
- "mentioned uid, then reinstall" >&2
+ "mentioned uid, then reinstall (not recommended)" >&2
fi
fi
exit 0
13 years, 6 months