1 include ..
/..
/Makefile.omd
5 DIR
= $(NAME
)-$(VERSION
)
6 FCGI_FILE
="mod_fcgid-2.3.6"
8 MODULE_DIR
=$(APACHE_MODULE_DIR
)
9 ifeq ($(shell uname
-m
),x86_64
)
10 MODULE_DIR
=$(APACHE_MODULE_DIR_64
)
13 APACHE_VERSION
= $(shell $(APACHE_BIN
) -v | awk
'/version/ {print $$3}' | awk
-F
/ '{print $$2}')
14 APACHE_VERSION_MAIN
= $(word 1, $(subst .
, ,$(APACHE_VERSION
)))
15 APACHE_VERSION_SUB
= $(word 2, $(subst .
, ,$(APACHE_VERSION
)))
16 APACHE_24_OR_NEWER
= $(shell [ $(APACHE_VERSION_MAIN
) -ge
2 -a
$(APACHE_VERSION_SUB
) -ge
4 ] && echo
1 || echo
0)
19 APACHE_MODULES_INSTALL
=
20 APACHE_FCGID_PATH
=$(MODULE_DIR
)/$(APACHE_FCGID_MODULE
)
22 REPLACE_PHP_FCGI_BIN
=$(PHP_FCGI_BIN
)
24 # Try to find the apxs binary
26 ifeq ("$(wildcard $(APXS))","")
30 VERSIONLT7
:= $(shell expr
$(DISTRO_VERSION
) \
<= 7)
31 ifeq ($(DISTRO_NAME
),CENTOS
)
32 ifeq ($(VERSIONLT7
), 1)
36 ifeq ($(DISTRO_NAME
),REDHAT
)
37 ifeq ($(VERSIONLT7
), 1)
42 ifeq ($(CENTOS_WORKAROUND
), 1)
44 APACHE_MODULES
=modfcgid
45 APACHE_MODULES_INSTALL
=modfcgid_install
46 APACHE_FCGID_PATH
=$(OMD_ROOT
)/lib
/apache
/mod_fcgid.so
47 # workaround for centos/rh which ignores "php-cgi -d settings"
48 REPLACE_PHP_FCGI_BIN
=$(PHP_FCGI_BIN
) -c
$(OMD_ROOT
)/etc
/apache
/php.ini
53 build
: $(APACHE_MODULES
)
54 # Unpack source code, apply patches, call configure, call make
56 install: $(APACHE_MODULES_INSTALL
)
57 # Install software below $(DESTDIR)$(OMD_ROOT)/{bin,lib,share}
58 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
59 if
[ $(APACHE_24_OR_NEWER
) -eq
1 ]; then \
60 install -m
644 apache24.conf
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
/apache.conf
; \
62 install -m
644 apache.conf
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
/apache.conf
; \
66 if
[ $(CENTOS_WORKAROUND
) -eq
1 ]; then \
67 cp
/etc
/php.ini
$(SKEL
)/etc
/apache
/php.ini || exit
1; \
68 echo
-e
"\n\n; OMD OMD OMD OMD OMD OMD\n\nmemory_limit=64M\n\n[Session]\nsession.save_path=###ROOT###/tmp/php/session\nupload_tmp_dir=###ROOT###/tmp/php/upload\nsoap.wsdl_cache_dir=###ROOT###/tmp/php/wsdl-cache\n" >> $(SKEL
)/etc
/apache
/php.ini
; \
71 # install a custom apache configuration for apache 2.4 or later
72 if
[ $(APACHE_24_OR_NEWER
) -eq
1 ]; then \
73 mv
$(SKEL
)/etc
/apache
/apache24.conf
$(SKEL
)/etc
/apache
/apache.conf
; \
75 rm $(SKEL
)/etc
/apache
/apache24.conf
; \
79 sed
-i
-e
's|###APACHE_MODULE_DIR###|$(MODULE_DIR)|g' \
80 $(SKEL
)/etc
/apache
/apache.conf
82 sed
-i
-e
's|###APACHE_FCGID_MODULE###|$(APACHE_FCGID_PATH)|g' \
83 $(SKEL
)/etc
/apache
/conf.d
/02_fcgid.conf
85 sed
-i
's|###APACHE_BIN###|$(APACHE_BIN)|g' $(SKEL
)/etc
/init.d
/apache
86 sed
-i
's|###PHP_FCGI_BIN###|$(PHP_FCGI_BIN)|g' $(SKEL
)/etc
/init.d
/apache
87 sed
-i
's|###PHP_FCGI_BIN###|$(REPLACE_PHP_FCGI_BIN)|g' $(SKEL
)/etc
/apache
/php-wrapper
88 # Create working directories
89 mkdir
-p
$(SKEL
)/var
/log
/apache
90 mkdir
-p
$(SKEL
)/var
/www
91 mkdir
-p
$(SKEL
)/tmp
/apache
/run
92 mkdir
-p
$(SKEL
)/tmp
/apache
/fcgid_sock
93 mkdir
-p
$(SKEL
)/tmp
/php
/session
94 mkdir
-p
$(SKEL
)/tmp
/php
/upload
95 mkdir
-p
$(SKEL
)/tmp
/php
/wsdl-cache
98 # Remove files created by build/install
99 rm -rf mod_fcgid-2.3
.6
102 tar zxf
$(FCGI_FILE
).
tar.gz
103 patch
-p0
< .
/patches
/0001-fcgid_proc_unix.c.patch
104 patch
-p0
< .
/patches
/0002-fcgid_pm_unix.c.patch
105 cd
$(FCGI_FILE
) && APXS
=$(APXS
) .
/configure.apxs
106 $(MAKE
) -C
$(FCGI_FILE
)
109 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/apache
110 cp
$(FCGI_FILE
)/modules
/fcgid
/.libs
/mod_fcgid.so
$(DESTDIR
)$(OMD_ROOT
)/lib
/apache
/