Main changes include:
 - Avoid using hardcoded paths, even for init scripts
 - Avoid using ./configure script to process script .in files,
   use 'sed' at build time instead
 - Use standardized paths where possible

Signed-off-by: Klaus Heinrich Kiwi <[email protected]>
---
 misc/Makefile.am  |   22 ++++++++++++----------
 misc/pkcsslotd.in |    4 ++--
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/misc/Makefile.am b/misc/Makefile.am
index 9005fcf..d0c6e9b 100644
--- a/misc/Makefile.am
+++ b/misc/Makefile.am
@@ -1,12 +1,14 @@
-if DAEMON
-initdir = /etc/init.d
-init_SCRIPTS = pkcsslotd
-endif
+initddir = $(sysconfdir)/rc.d/init.d
+
+EXTRA_DIST = pkcsslotd.in
 
-install-data-local:
-       mkdir -p $(DESTDIR)/etc/ld.so.conf.d
-       echo "$(libdir)/opencryptoki" \
-       >$(DESTDIR)/etc/ld.so.conf.d/opencryptoki-$(target_cpu).conf
-       echo "$(libdir)/opencryptoki/stdll" \
-       >>$(DESTDIR)/etc/ld.so.conf.d/opencryptoki-$(target_cpu).conf
+if ENABLE_DAEMON
+initd_SCRIPTS = pkcsslotd
 
+CLEANFILES = pkcsslotd
+
+pkcsslotd: pkcsslotd.in
+       @SED@ -e s...@sbindir\@!"@sbindir@"!g < $< > $...@-t
+       @CHMOD@ a+x $...@-t
+       mv $...@-t $@
+endif
diff --git a/misc/pkcsslotd.in b/misc/pkcsslotd.in
index aca3751..f615832 100644
--- a/misc/pkcsslotd.in
+++ b/misc/pkcsslotd.in
@@ -14,8 +14,8 @@
 
 PIDFILE=/var/run/pkcsslotd.pid
 LOCKFILE=/var/lock/subsys/pkcsslotd
-slotdb...@method_path@/pkcsslotd
-confsta...@method_path@/pkcs11_startup
+slotdb...@sbindir@/pkcsslotd
+confsta...@sbindir@/pkcs11_startup
 
 [ -f $SLOTDBIN ] || exit 5
 [ -f $CONFSTART ] || exit 5
-- 
1.6.2.5


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to