summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeka Der <jekader@gmail.com>2014-10-12 20:00:11 +0200
committerJeka Der <jekader@gmail.com>2014-10-12 20:00:11 +0200
commited13a59665f6c2ebdff6c18251ffa661c2367eb4 (patch)
tree63375011a338cf83d465019eaa8a11e956818d7d
parentb5f2555c2027d3e39e7b0b2bc5bf2d1a9880efcb (diff)
downloadfake_ilo-ed13a59665f6c2ebdff6c18251ffa661c2367eb4.tar.gz
fixed makefile, updated README
-rw-r--r--Makefile20
-rw-r--r--README.md47
-rw-r--r--fake_ilo2
3 files changed, 56 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index ea7eb3c..6e477de 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,18 @@
+bindir=$(DESTDIR)/usr/bin
+sysconfdir=$(DESTDIR)/etc
+
all:
+# openssl req -x509 -newkey rsa:2048 -keyout $(sysconfdir)/server.key -out $(sysconfdir)/server.crt -nodes -days 9999 -subj "/C=MD/ST=Chisinau/L=Chisinau/O=IT/CN=www.example.com"
+ openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -nodes -days 9999 -subj "/C=MD/ST=Chisinau/L=Chisinau/O=IT/CN=www.example.com"
echo "Nothing to compile, please run make install"
-install:
- mkdir -p /etc/fake_ilo/
- openssl req -x509 -newkey rsa:2048 -keyout /etc/fake_ilo/server.key -out /etc/fake_ilo/server.crt -nodes -days 9999 -subj "/C=MD/ST=Chisinau/L=Chisinau/O=IT/CN=www.example.com"
- cp ilo.py /usr/local/bin/
+install: all
+# env
+ mkdir -p $(sysconfdir)/fake_ilo/
+ install -m 0755 ilo.py $(bindir)
+ install -m 0755 fake_ilo $(sysconfdir)/init.d/
+ install -m 0600 server.key $(sysconfdir)/fake_ilo/
+ install -m 0600 server.crt $(sysconfdir)/fake_ilo/
+
+clean:
+ rm -f server.key
+ rm -f server.crt
diff --git a/README.md b/README.md
index 87f8f5f..a7d1f7f 100644
--- a/README.md
+++ b/README.md
@@ -25,20 +25,51 @@ This script was made for testing purposes only with no security in mind. The qua
INSTALL:
--------
-1. copy ilo.py to /usr/local/bin/ and make it executable
-2. copy fake_ilo to /etc/init.d/ and make it executable
-3. create configuration directory:
+a) as .deb file:
- `# mkdir /etc/fake_ilo/`
+1. install dependencies:
+ `$ sudo apt-get install git devscripts debhelper make`
-4. go into the config directory and generate a self-signed certificate by running this command. Data provided in the requested fields is not important: oVirt does not verify certificates:
+2. fetch the source and build the package:
- `# cd /etc/fake_ilo/`
+ `$ git clone https://github.com/jekader/fake_ilo.git`
+ `$ tar -cjf fake-ilo_0.0.1.orig.tar.bz2 fake_ilo/`
+ `$ cd fake_ilo`
+ `$ debuild -us -uc`
- `# openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -nodes -days 9999`
-5. register the init script (Debian):
+3. install the resulting .deb
+ `$ sudo dpkg -i ../fake-ilo_0.0.1-1_amd64.deb`
+
+b) manually:
+
+1. install dependencies:
+ `$ sudo apt-get install git make`
+
+2. fetch the source and build the package:
+
+ `$ git clone https://github.com/jekader/fake_ilo.git`
+ `$ cd fake_ilo`
+ `$ make`
+ `$ sudo make install`
+
+ENABLE:
+-------
+
+register the init script (Debian):
`update-rc.d fake_ilo enable`
+
+
+CUSTOM CERTIFICATE:
+-------------------
+
+The install script creates a default certificate which should be enough for testing. To replace it, follwo the steps:
+
+1. go into the config directory and generate a self-signed certificate by running this command. Data provided in the requested fields is not important: oVirt does not verify certificates:
+
+ `# cd /etc/fake_ilo/`
+
+ `# openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -nodes -days 9999`
USAGE:
------
diff --git a/fake_ilo b/fake_ilo
index 2cc7626..34e226f 100644
--- a/fake_ilo
+++ b/fake_ilo
@@ -13,7 +13,7 @@
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/local/bin/ilo.py
+DAEMON=/usr/bin/ilo.py
NAME=fake_ilo
DESC="iLO emulator"