Fri, 07 Sep 2012 19:08:07 +0200
Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.
1 #!@l_prefix@/bin/openpkg rc
2 ##
3 ## rc.drupal -- Run-Commands
4 ##
6 %config
7 drupal_enable="$openpkg_rc_def"
8 drupal_cron="@l_drupal_cron@"
9 drupal_backup="daily"
11 %status -u @l_susr@ -o
12 drupal_usable="no"
13 drupal_active="no"
14 @l_prefix@/sbin/apache -t \
15 -f @l_prefix@/etc/drupal/drupal-apache.conf 2>/dev/null && \
16 drupal_usable="yes"
17 [ -f @l_prefix@/var/drupal/run/apache.pid ] && \
18 kill -0 `cat @l_prefix@/var/drupal/run/apache.pid` && \
19 drupal_active="yes"
20 echo "drupal_enable=\"$drupal_enable\""
21 echo "drupal_usable=\"$drupal_usable\""
22 echo "drupal_active=\"$drupal_active\""
24 %start -u @l_susr@
25 rcService drupal enable yes || exit 0
26 rcService drupal active yes && exit 0
27 @l_prefix@/sbin/apache \
28 -f @l_prefix@/etc/drupal/drupal-apache.conf
30 %stop -u @l_susr@
31 rcService drupal enable yes || exit 0
32 rcService drupal active no && exit 0
33 [ -f @l_prefix@/var/drupal/run/apache.pid ] && \
34 kill -TERM `cat @l_prefix@/var/drupal/run/apache.pid`
35 sleep 2
37 %restart -u @l_susr@
38 rcService drupal enable yes || exit 0
39 rcService drupal active no && exit 0
40 rc drupal stop start
42 %quarterly -u @l_rusr@
43 rcService drupal enable yes || exit 0
44 if [ ".$drupal_cron" = .yes ]; then
45 @l_prefix@/sbin/drupal-cron
46 fi
48 %hourly -u @l_rusr@
49 rcService drupal enable yes || exit 0
50 if [ ".$drupal_backup" = .hourly ]; then
51 @l_prefix@/sbin/drupal-setup backup || exit $?
52 fi
54 %daily -u @l_rusr@
55 rcService drupal enable yes || exit 0
56 if [ ".$drupal_backup" = .daily ]; then
57 @l_prefix@/sbin/drupal-setup backup || exit $?
58 fi
60 %weekly -u @l_rusr@
61 rcService drupal enable yes || exit 0
62 if [ ".$drupal_backup" = .weekly ]; then
63 @l_prefix@/sbin/drupal-setup backup || exit $?
64 fi