1 include ..
/..
/Makefile.omd
5 DIR
= $(NAME
)-$(VERSION
)
6 FCGI_FILE
="mod_fcgid-2.3.9"
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
)
23 REPLACE_PHP_FCGI_BIN
=$(PHP_FCGI_BIN
)
25 # Try to find the apxs binary
27 ifeq ("$(wildcard $(APXS))","")
30 ifneq ("$(wildcard /usr/sbin/apxs2)","")
34 VERSIONLT7
:= $(shell expr
$(DISTRO_VERSION
) \
<= 7)
35 ifeq ($(DISTRO_NAME
),CENTOS
)
36 ifeq ($(VERSIONLT7
), 1)
40 ifeq ($(DISTRO_NAME
),REDHAT
)
41 ifeq ($(VERSIONLT7
), 1)
45 ifneq (,$(findstring 11SP
,$(DISTRO_VERSION
)))
49 ifeq ($(CENTOS_WORKAROUND
), 1)
50 # workaround for centos/rh which ignores "php-cgi -d settings"
51 REPLACE_PHP_FCGI_BIN
=$(PHP_FCGI_BIN
) -c
$(OMD_ROOT
)/etc
/apache
/php.ini
55 ifeq ($(INSTALL_FCGID
), 1)
56 APACHE_MODULES
=modfcgid
57 APACHE_MODULES_INSTALL
=modfcgid_install
58 APACHE_FCGID_PATH
=$(OMD_ROOT
)/lib
/apache
/mod_fcgid.so
63 build
: $(APACHE_MODULES
)
64 # Unpack source code, apply patches, call configure, call make
66 install: $(APACHE_MODULES_INSTALL
)
67 # Install software below $(DESTDIR)$(OMD_ROOT)/{bin,lib,share}
68 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
69 if
[ $(APACHE_24_OR_NEWER
) -eq
1 ]; then \
70 install -m
644 apache24.conf
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
/apache.conf
; \
72 install -m
644 apache.conf
$(DESTDIR
)$(OMD_ROOT
)/share
/omd
/apache.conf
; \
76 if
[ $(CENTOS_WORKAROUND
) -eq
1 ]; then \
77 cp
/etc
/php.ini
$(SKEL
)/etc
/apache
/php.ini || exit
1; \
78 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
; \
81 # install a custom apache configuration for apache 2.4 or later
82 if
[ $(APACHE_24_OR_NEWER
) -eq
1 ]; then \
83 mv
$(SKEL
)/etc
/apache
/apache24.conf
$(SKEL
)/etc
/apache
/apache.conf
; \
85 rm $(SKEL
)/etc
/apache
/apache24.conf
; \
89 sed
-i
-e
's|###APACHE_MODULE_DIR###|$(MODULE_DIR)|g' \
90 $(SKEL
)/etc
/apache
/apache.conf
92 # SLES12 has apache 2.4 but does not have the prefork module to be loaded,
93 # so remove this load line for this distro from the apache config
94 if
[ ! -e
$(MODULE_DIR
)/mod_mpm_prefork.so
]; then \
95 sed
-i
'/^LoadModule mpm_prefork_module/d' $(SKEL
)/etc
/apache
/apache.conf
; \
98 sed
-i
-e
's|###APACHE_FCGID_MODULE###|$(APACHE_FCGID_PATH)|g' \
99 $(SKEL
)/etc
/apache
/conf.d
/02_fcgid.conf
101 sed
-i
's|###APACHE_BIN###|$(APACHE_BIN)|g' $(SKEL
)/etc
/init.d
/apache
102 sed
-i
's|###PHP_FCGI_BIN###|$(PHP_FCGI_BIN)|g' $(SKEL
)/etc
/init.d
/apache
103 sed
-i
's|###PHP_FCGI_BIN###|$(REPLACE_PHP_FCGI_BIN)|g' $(SKEL
)/etc
/apache
/php-wrapper
104 # Create working directories
105 mkdir
-p
$(SKEL
)/var
/log
/apache
106 mkdir
-p
$(SKEL
)/var
/www
107 mkdir
-p
$(SKEL
)/tmp
/apache
/run
108 mkdir
-p
$(SKEL
)/tmp
/apache
/fcgid_sock
109 mkdir
-p
$(SKEL
)/tmp
/php
/session
110 mkdir
-p
$(SKEL
)/tmp
/php
/upload
111 mkdir
-p
$(SKEL
)/tmp
/php
/wsdl-cache
114 # Remove files created by build/install
118 tar zxf
$(FCGI_FILE
).
tar.gz
119 cd
$(FCGI_FILE
) && patch
-p1
< ..
/patches
/0001-fcgid_proc_unix.c.patch
120 cd
$(FCGI_FILE
) && patch
-p1
< ..
/patches
/0002-fcgid_pm_unix.c.patch
121 cd
$(FCGI_FILE
) && APXS
=$(APXS
) .
/configure.apxs
122 CPATH
="/usr/include/apache2-worker" $(MAKE
) -C
$(FCGI_FILE
)
125 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/apache
126 cp
$(FCGI_FILE
)/modules
/fcgid
/.libs
/mod_fcgid.so
$(DESTDIR
)$(OMD_ROOT
)/lib
/apache
/