Add Line of Text to Section of Rules File












2















I'm trying to write a bash script to automate the install of nginx with pagespeed module.



Part of this requires me to add this: --add-module=$(MODULESDIR)/ngx_pagespeed to a section of the /usr/src/nginx/nginx-X.X.6/debian/rules file.



Each section is similar to:



light_configure_flags := 
$(common_configure_flags)
--with-http_gzip_static_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_req_module
--without-http_limit_conn_module
--without-http_memcached_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_userid_module
--without-http_uwsgi_module
--add-module=$(MODULESDIR)/nginx-echo


Full file is here:
https://jsfiddle.net/72hL5pya/1/ (sorry, didn't know where else to put it)



And each section is *_configure_flags



there are a number of these sections for each "version" of nginx to compile (light, full, extras, etc...)



So that last --add-module= line is different in each section.



How can I append the --add-module=$(MODULESDIR)/ngx_pagespeed to each?



NOTE:
Looks like as of whatever date, the structure of this rules file has changed.



#!/usr/bin/make -f

#export DH_VERBOSE=1
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
WITH_HTTP2 := $(shell printf
"Source: nginxnBuild-Depends: libssl-dev (>= 1.0.1)n" |
dpkg-checkbuilddeps - >/dev/null 2>&1 &&
echo "--with-http_v2_module")
PKGS = nginx nginx-dbg
nginx-module-xslt nginx-module-geoip nginx-module-image-filter
nginx-module-perl nginx-module-njs
COMMON_CONFIGURE_ARGS :=
--prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--modules-path=/usr/lib/nginx/modules
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic
--with-http_perl_module=dynamic
--add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx
--with-threads
--with-stream
--with-stream_ssl_module
--with-http_slice_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-ipv6
$(WITH_HTTP2)
--with-cc-opt="$(CFLAGS)"
--with-ld-opt="$(LDFLAGS)"

%:
dh $@

override_dh_auto_configure: configure_debug

override_dh_strip:
dh_strip --dbg-package=nginx-dbg

override_dh_auto_build:
dh_auto_build
mv objs/nginx objs/nginx-debug
mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so
mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so
mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so
mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so
mv objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so objs/src/http/modules/perl/blib/arch/auto/nginx/nginx-debug.so
mv objs/ngx_http_js_module.so objs/ngx_http_js_module-debug.so
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
dh_auto_build

configure_debug:
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
--with-debug

override_dh_auto_install:
sed -e 's/%%PROVIDES%%/nginx/g'
-e 's/%%DEFAULTSTART%%/2 3 4 5/g'
-e 's/%%DEFAULTSTOP%%/0 1 6/g'
< debian/init.d.in > debian/init.d
dh_auto_install
mkdir -p debian/nginx/etc/init.d debian/nginx/etc/default
debian/nginx/usr/lib/nginx/modules
sed -e 's/%%PROVIDES%%/nginx-debug/g'
-e 's/%%DEFAULTSTART%%//g'
-e 's/%%DEFAULTSTOP%%/0 1 2 3 4 5 6/g'
< debian/init.d.in > debian/debug.init.d
/usr/bin/install -m 755 debian/debug.init.d
debian/nginx/etc/init.d/nginx-debug
/usr/bin/install -m 644 debian/nginx-debug.default
debian/nginx/etc/default/nginx-debug
/usr/bin/install -m 644 debian/nginx.conf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/win-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-win debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/mime.types debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/scgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/fastcgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/uwsgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 html/index.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 html/50x.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 debian/nginx.vh.default.conf
debian/nginx/etc/nginx/conf.d/default.conf
/usr/bin/install -m 755 objs/nginx debian/nginx/usr/sbin/
/usr/bin/install -m 755 objs/nginx-debug debian/nginx/usr/sbin/
cd debian/nginx/etc/nginx && /bin/ln -s
../../usr/lib/nginx/modules modules && cd -

override_dh_gencontrol:
for p in $(PKGS); do
if [ -e debian/$$p.version ]; then
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p -v`cat debian/$$p.version`~`lsb_release -cs`;
else
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p ;
fi ;
done

override_dh_clean:
dh_clean
rm -f debian/*init.d









share|improve this question

























  • how do you define a "section"? Is it something following a line ending := ?

    – glenn jackman
    Dec 17 '15 at 21:11













  • not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

    – Kevin
    Dec 17 '15 at 21:21











  • added it to jsfiddle (only because it was the only thing I could think of :) )

    – Kevin
    Dec 17 '15 at 21:33
















2















I'm trying to write a bash script to automate the install of nginx with pagespeed module.



Part of this requires me to add this: --add-module=$(MODULESDIR)/ngx_pagespeed to a section of the /usr/src/nginx/nginx-X.X.6/debian/rules file.



Each section is similar to:



light_configure_flags := 
$(common_configure_flags)
--with-http_gzip_static_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_req_module
--without-http_limit_conn_module
--without-http_memcached_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_userid_module
--without-http_uwsgi_module
--add-module=$(MODULESDIR)/nginx-echo


Full file is here:
https://jsfiddle.net/72hL5pya/1/ (sorry, didn't know where else to put it)



And each section is *_configure_flags



there are a number of these sections for each "version" of nginx to compile (light, full, extras, etc...)



So that last --add-module= line is different in each section.



How can I append the --add-module=$(MODULESDIR)/ngx_pagespeed to each?



NOTE:
Looks like as of whatever date, the structure of this rules file has changed.



#!/usr/bin/make -f

#export DH_VERBOSE=1
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
WITH_HTTP2 := $(shell printf
"Source: nginxnBuild-Depends: libssl-dev (>= 1.0.1)n" |
dpkg-checkbuilddeps - >/dev/null 2>&1 &&
echo "--with-http_v2_module")
PKGS = nginx nginx-dbg
nginx-module-xslt nginx-module-geoip nginx-module-image-filter
nginx-module-perl nginx-module-njs
COMMON_CONFIGURE_ARGS :=
--prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--modules-path=/usr/lib/nginx/modules
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic
--with-http_perl_module=dynamic
--add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx
--with-threads
--with-stream
--with-stream_ssl_module
--with-http_slice_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-ipv6
$(WITH_HTTP2)
--with-cc-opt="$(CFLAGS)"
--with-ld-opt="$(LDFLAGS)"

%:
dh $@

override_dh_auto_configure: configure_debug

override_dh_strip:
dh_strip --dbg-package=nginx-dbg

override_dh_auto_build:
dh_auto_build
mv objs/nginx objs/nginx-debug
mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so
mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so
mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so
mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so
mv objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so objs/src/http/modules/perl/blib/arch/auto/nginx/nginx-debug.so
mv objs/ngx_http_js_module.so objs/ngx_http_js_module-debug.so
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
dh_auto_build

configure_debug:
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
--with-debug

override_dh_auto_install:
sed -e 's/%%PROVIDES%%/nginx/g'
-e 's/%%DEFAULTSTART%%/2 3 4 5/g'
-e 's/%%DEFAULTSTOP%%/0 1 6/g'
< debian/init.d.in > debian/init.d
dh_auto_install
mkdir -p debian/nginx/etc/init.d debian/nginx/etc/default
debian/nginx/usr/lib/nginx/modules
sed -e 's/%%PROVIDES%%/nginx-debug/g'
-e 's/%%DEFAULTSTART%%//g'
-e 's/%%DEFAULTSTOP%%/0 1 2 3 4 5 6/g'
< debian/init.d.in > debian/debug.init.d
/usr/bin/install -m 755 debian/debug.init.d
debian/nginx/etc/init.d/nginx-debug
/usr/bin/install -m 644 debian/nginx-debug.default
debian/nginx/etc/default/nginx-debug
/usr/bin/install -m 644 debian/nginx.conf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/win-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-win debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/mime.types debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/scgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/fastcgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/uwsgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 html/index.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 html/50x.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 debian/nginx.vh.default.conf
debian/nginx/etc/nginx/conf.d/default.conf
/usr/bin/install -m 755 objs/nginx debian/nginx/usr/sbin/
/usr/bin/install -m 755 objs/nginx-debug debian/nginx/usr/sbin/
cd debian/nginx/etc/nginx && /bin/ln -s
../../usr/lib/nginx/modules modules && cd -

override_dh_gencontrol:
for p in $(PKGS); do
if [ -e debian/$$p.version ]; then
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p -v`cat debian/$$p.version`~`lsb_release -cs`;
else
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p ;
fi ;
done

override_dh_clean:
dh_clean
rm -f debian/*init.d









share|improve this question

























  • how do you define a "section"? Is it something following a line ending := ?

    – glenn jackman
    Dec 17 '15 at 21:11













  • not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

    – Kevin
    Dec 17 '15 at 21:21











  • added it to jsfiddle (only because it was the only thing I could think of :) )

    – Kevin
    Dec 17 '15 at 21:33














2












2








2








I'm trying to write a bash script to automate the install of nginx with pagespeed module.



Part of this requires me to add this: --add-module=$(MODULESDIR)/ngx_pagespeed to a section of the /usr/src/nginx/nginx-X.X.6/debian/rules file.



Each section is similar to:



light_configure_flags := 
$(common_configure_flags)
--with-http_gzip_static_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_req_module
--without-http_limit_conn_module
--without-http_memcached_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_userid_module
--without-http_uwsgi_module
--add-module=$(MODULESDIR)/nginx-echo


Full file is here:
https://jsfiddle.net/72hL5pya/1/ (sorry, didn't know where else to put it)



And each section is *_configure_flags



there are a number of these sections for each "version" of nginx to compile (light, full, extras, etc...)



So that last --add-module= line is different in each section.



How can I append the --add-module=$(MODULESDIR)/ngx_pagespeed to each?



NOTE:
Looks like as of whatever date, the structure of this rules file has changed.



#!/usr/bin/make -f

#export DH_VERBOSE=1
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
WITH_HTTP2 := $(shell printf
"Source: nginxnBuild-Depends: libssl-dev (>= 1.0.1)n" |
dpkg-checkbuilddeps - >/dev/null 2>&1 &&
echo "--with-http_v2_module")
PKGS = nginx nginx-dbg
nginx-module-xslt nginx-module-geoip nginx-module-image-filter
nginx-module-perl nginx-module-njs
COMMON_CONFIGURE_ARGS :=
--prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--modules-path=/usr/lib/nginx/modules
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic
--with-http_perl_module=dynamic
--add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx
--with-threads
--with-stream
--with-stream_ssl_module
--with-http_slice_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-ipv6
$(WITH_HTTP2)
--with-cc-opt="$(CFLAGS)"
--with-ld-opt="$(LDFLAGS)"

%:
dh $@

override_dh_auto_configure: configure_debug

override_dh_strip:
dh_strip --dbg-package=nginx-dbg

override_dh_auto_build:
dh_auto_build
mv objs/nginx objs/nginx-debug
mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so
mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so
mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so
mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so
mv objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so objs/src/http/modules/perl/blib/arch/auto/nginx/nginx-debug.so
mv objs/ngx_http_js_module.so objs/ngx_http_js_module-debug.so
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
dh_auto_build

configure_debug:
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
--with-debug

override_dh_auto_install:
sed -e 's/%%PROVIDES%%/nginx/g'
-e 's/%%DEFAULTSTART%%/2 3 4 5/g'
-e 's/%%DEFAULTSTOP%%/0 1 6/g'
< debian/init.d.in > debian/init.d
dh_auto_install
mkdir -p debian/nginx/etc/init.d debian/nginx/etc/default
debian/nginx/usr/lib/nginx/modules
sed -e 's/%%PROVIDES%%/nginx-debug/g'
-e 's/%%DEFAULTSTART%%//g'
-e 's/%%DEFAULTSTOP%%/0 1 2 3 4 5 6/g'
< debian/init.d.in > debian/debug.init.d
/usr/bin/install -m 755 debian/debug.init.d
debian/nginx/etc/init.d/nginx-debug
/usr/bin/install -m 644 debian/nginx-debug.default
debian/nginx/etc/default/nginx-debug
/usr/bin/install -m 644 debian/nginx.conf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/win-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-win debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/mime.types debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/scgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/fastcgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/uwsgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 html/index.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 html/50x.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 debian/nginx.vh.default.conf
debian/nginx/etc/nginx/conf.d/default.conf
/usr/bin/install -m 755 objs/nginx debian/nginx/usr/sbin/
/usr/bin/install -m 755 objs/nginx-debug debian/nginx/usr/sbin/
cd debian/nginx/etc/nginx && /bin/ln -s
../../usr/lib/nginx/modules modules && cd -

override_dh_gencontrol:
for p in $(PKGS); do
if [ -e debian/$$p.version ]; then
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p -v`cat debian/$$p.version`~`lsb_release -cs`;
else
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p ;
fi ;
done

override_dh_clean:
dh_clean
rm -f debian/*init.d









share|improve this question
















I'm trying to write a bash script to automate the install of nginx with pagespeed module.



Part of this requires me to add this: --add-module=$(MODULESDIR)/ngx_pagespeed to a section of the /usr/src/nginx/nginx-X.X.6/debian/rules file.



Each section is similar to:



light_configure_flags := 
$(common_configure_flags)
--with-http_gzip_static_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_req_module
--without-http_limit_conn_module
--without-http_memcached_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_userid_module
--without-http_uwsgi_module
--add-module=$(MODULESDIR)/nginx-echo


Full file is here:
https://jsfiddle.net/72hL5pya/1/ (sorry, didn't know where else to put it)



And each section is *_configure_flags



there are a number of these sections for each "version" of nginx to compile (light, full, extras, etc...)



So that last --add-module= line is different in each section.



How can I append the --add-module=$(MODULESDIR)/ngx_pagespeed to each?



NOTE:
Looks like as of whatever date, the structure of this rules file has changed.



#!/usr/bin/make -f

#export DH_VERBOSE=1
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
WITH_HTTP2 := $(shell printf
"Source: nginxnBuild-Depends: libssl-dev (>= 1.0.1)n" |
dpkg-checkbuilddeps - >/dev/null 2>&1 &&
echo "--with-http_v2_module")
PKGS = nginx nginx-dbg
nginx-module-xslt nginx-module-geoip nginx-module-image-filter
nginx-module-perl nginx-module-njs
COMMON_CONFIGURE_ARGS :=
--prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--modules-path=/usr/lib/nginx/modules
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic
--with-http_perl_module=dynamic
--add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx
--with-threads
--with-stream
--with-stream_ssl_module
--with-http_slice_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-ipv6
$(WITH_HTTP2)
--with-cc-opt="$(CFLAGS)"
--with-ld-opt="$(LDFLAGS)"

%:
dh $@

override_dh_auto_configure: configure_debug

override_dh_strip:
dh_strip --dbg-package=nginx-dbg

override_dh_auto_build:
dh_auto_build
mv objs/nginx objs/nginx-debug
mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so
mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so
mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so
mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so
mv objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so objs/src/http/modules/perl/blib/arch/auto/nginx/nginx-debug.so
mv objs/ngx_http_js_module.so objs/ngx_http_js_module-debug.so
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
dh_auto_build

configure_debug:
CFLAGS="" ./configure $(COMMON_CONFIGURE_ARGS)
--with-debug

override_dh_auto_install:
sed -e 's/%%PROVIDES%%/nginx/g'
-e 's/%%DEFAULTSTART%%/2 3 4 5/g'
-e 's/%%DEFAULTSTOP%%/0 1 6/g'
< debian/init.d.in > debian/init.d
dh_auto_install
mkdir -p debian/nginx/etc/init.d debian/nginx/etc/default
debian/nginx/usr/lib/nginx/modules
sed -e 's/%%PROVIDES%%/nginx-debug/g'
-e 's/%%DEFAULTSTART%%//g'
-e 's/%%DEFAULTSTOP%%/0 1 2 3 4 5 6/g'
< debian/init.d.in > debian/debug.init.d
/usr/bin/install -m 755 debian/debug.init.d
debian/nginx/etc/init.d/nginx-debug
/usr/bin/install -m 644 debian/nginx-debug.default
debian/nginx/etc/default/nginx-debug
/usr/bin/install -m 644 debian/nginx.conf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/win-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-utf debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/koi-win debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/mime.types debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/scgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/fastcgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 conf/uwsgi_params debian/nginx/etc/nginx/
/usr/bin/install -m 644 html/index.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 html/50x.html
debian/nginx/usr/share/nginx/html/
/usr/bin/install -m 644 debian/nginx.vh.default.conf
debian/nginx/etc/nginx/conf.d/default.conf
/usr/bin/install -m 755 objs/nginx debian/nginx/usr/sbin/
/usr/bin/install -m 755 objs/nginx-debug debian/nginx/usr/sbin/
cd debian/nginx/etc/nginx && /bin/ln -s
../../usr/lib/nginx/modules modules && cd -

override_dh_gencontrol:
for p in $(PKGS); do
if [ -e debian/$$p.version ]; then
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p -v`cat debian/$$p.version`~`lsb_release -cs`;
else
dpkg-gencontrol -p$$p -ldebian/changelog -Tdebian/$$p.substvars -Pdebian/$$p ;
fi ;
done

override_dh_clean:
dh_clean
rm -f debian/*init.d






shell-script text-processing compiling make






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 5 '17 at 13:42









Jeff Schaller

41.3k1056131




41.3k1056131










asked Dec 17 '15 at 20:29









KevinKevin

1019




1019













  • how do you define a "section"? Is it something following a line ending := ?

    – glenn jackman
    Dec 17 '15 at 21:11













  • not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

    – Kevin
    Dec 17 '15 at 21:21











  • added it to jsfiddle (only because it was the only thing I could think of :) )

    – Kevin
    Dec 17 '15 at 21:33



















  • how do you define a "section"? Is it something following a line ending := ?

    – glenn jackman
    Dec 17 '15 at 21:11













  • not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

    – Kevin
    Dec 17 '15 at 21:21











  • added it to jsfiddle (only because it was the only thing I could think of :) )

    – Kevin
    Dec 17 '15 at 21:33

















how do you define a "section"? Is it something following a line ending := ?

– glenn jackman
Dec 17 '15 at 21:11







how do you define a "section"? Is it something following a line ending := ?

– glenn jackman
Dec 17 '15 at 21:11















not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

– Kevin
Dec 17 '15 at 21:21





not really sure. I'll throw the whole "rules" file up on something and link here to it. few minutes

– Kevin
Dec 17 '15 at 21:21













added it to jsfiddle (only because it was the only thing I could think of :) )

– Kevin
Dec 17 '15 at 21:33





added it to jsfiddle (only because it was the only thing I could think of :) )

– Kevin
Dec 17 '15 at 21:33










3 Answers
3






active

oldest

votes


















3














If it doesn't matter where in the list of options the new one goes, you could



sed '/_configure_flags *:=/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \
' file


light_configure_flags := 
--add-module=$(MODULESDIR)/ngx_pagespeed
$(common_configure_flags)
--with-http_gzip_static_module
...




To add after the "common_configure_flags" line, you could:



sed -r '
# when the line ends with a backslash
# add the new line with a backslash
/$(common_configure_flags)[[:blank:]]*\$/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \

# when the line does not end with a backslash,
# add a backslash, then
# add the new line without a backslash
/$(common_configure_flags)[[:blank:]]*$/ {
s/$/ \/
a
--add-module=$(MODULESDIR)/ngx_pagespeed
}
' file





share|improve this answer


























  • yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

    – Kevin
    Dec 18 '15 at 18:17











  • How would I do this to add it directly after the `$(common_configure_flags) ` line?

    – Kevin
    Dec 22 '15 at 14:01











  • Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

    – Kevin
    Dec 22 '15 at 14:24











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58



















1














I needed to add multiple lines and could not get sed to work so used awk instead:



awk '/full_configure_flags :=/{print $0 RS 
" --add-dynamic-module=/opt/ngx_http_split_clients/ngx_http_split_clients_module.c" RS
" --with-http_addition_module" RS
" --with-http_sub_module" RS
" --with-http_flv_module" RS
" --with-http_mp4_module" RS
" --with-http_gunzip_module" RS
" --with-http_random_index_module" RS
" --with-http_secure_link_module" RS
" --with-http_stub_status_module" RS
" --with-mail" RS
" --with-mail_ssl_module" RS
" --with-file-aio" RS
" --with-ipv6" RS
" --with-http_spdy_module" RS
" --with-cc-opt";next}1' /opt/rebuildnginx/nginx-1.10.2/debian/rules


This SO post was useful when figuring out syntax.






share|improve this answer


























  • Welcome to Unix.stackexchange!

    – Stephen Rauch
    Jan 30 '17 at 3:04



















1














Some digging around points to the rules file being at present available here.



Since the package-specific configures appear to inherit via the $(common_configure_flags) statement, modifying only that block may suffice:



$ perl -00 -ple 's{$}{ \nttt--add-module=$(MODULESDIR)/ngx_pagespeed} if m/common_configure_flags :=/' rules > nu
$ diff -u rules nu
--- rules 2015-12-17 14:49:12.000000000 -0800
+++ nu 2015-12-17 14:52:52.171942309 -0800
@@ -47,7 +47,8 @@
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
- --with-http_auth_request_module
+ --with-http_auth_request_module
+ --add-module=$(MODULESDIR)/ngx_pagespeed


This solution treats the file contents in turns of paragraphs (-00 -p), and adds the necessary data at the end of each (and appropriate backwhacking, newline, and tabbery), but only for the paragraph that matches the common_configure_flags := bit. To target each section (instead of just the common one), one would need to fiddle around with the if regular expression as appropriate.






share|improve this answer


























  • I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

    – Kevin
    Dec 22 '15 at 14:02











  • Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

    – Kevin
    Dec 22 '15 at 14:25











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f250036%2fadd-line-of-text-to-section-of-rules-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














If it doesn't matter where in the list of options the new one goes, you could



sed '/_configure_flags *:=/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \
' file


light_configure_flags := 
--add-module=$(MODULESDIR)/ngx_pagespeed
$(common_configure_flags)
--with-http_gzip_static_module
...




To add after the "common_configure_flags" line, you could:



sed -r '
# when the line ends with a backslash
# add the new line with a backslash
/$(common_configure_flags)[[:blank:]]*\$/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \

# when the line does not end with a backslash,
# add a backslash, then
# add the new line without a backslash
/$(common_configure_flags)[[:blank:]]*$/ {
s/$/ \/
a
--add-module=$(MODULESDIR)/ngx_pagespeed
}
' file





share|improve this answer


























  • yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

    – Kevin
    Dec 18 '15 at 18:17











  • How would I do this to add it directly after the `$(common_configure_flags) ` line?

    – Kevin
    Dec 22 '15 at 14:01











  • Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

    – Kevin
    Dec 22 '15 at 14:24











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58
















3














If it doesn't matter where in the list of options the new one goes, you could



sed '/_configure_flags *:=/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \
' file


light_configure_flags := 
--add-module=$(MODULESDIR)/ngx_pagespeed
$(common_configure_flags)
--with-http_gzip_static_module
...




To add after the "common_configure_flags" line, you could:



sed -r '
# when the line ends with a backslash
# add the new line with a backslash
/$(common_configure_flags)[[:blank:]]*\$/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \

# when the line does not end with a backslash,
# add a backslash, then
# add the new line without a backslash
/$(common_configure_flags)[[:blank:]]*$/ {
s/$/ \/
a
--add-module=$(MODULESDIR)/ngx_pagespeed
}
' file





share|improve this answer


























  • yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

    – Kevin
    Dec 18 '15 at 18:17











  • How would I do this to add it directly after the `$(common_configure_flags) ` line?

    – Kevin
    Dec 22 '15 at 14:01











  • Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

    – Kevin
    Dec 22 '15 at 14:24











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58














3












3








3







If it doesn't matter where in the list of options the new one goes, you could



sed '/_configure_flags *:=/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \
' file


light_configure_flags := 
--add-module=$(MODULESDIR)/ngx_pagespeed
$(common_configure_flags)
--with-http_gzip_static_module
...




To add after the "common_configure_flags" line, you could:



sed -r '
# when the line ends with a backslash
# add the new line with a backslash
/$(common_configure_flags)[[:blank:]]*\$/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \

# when the line does not end with a backslash,
# add a backslash, then
# add the new line without a backslash
/$(common_configure_flags)[[:blank:]]*$/ {
s/$/ \/
a
--add-module=$(MODULESDIR)/ngx_pagespeed
}
' file





share|improve this answer















If it doesn't matter where in the list of options the new one goes, you could



sed '/_configure_flags *:=/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \
' file


light_configure_flags := 
--add-module=$(MODULESDIR)/ngx_pagespeed
$(common_configure_flags)
--with-http_gzip_static_module
...




To add after the "common_configure_flags" line, you could:



sed -r '
# when the line ends with a backslash
# add the new line with a backslash
/$(common_configure_flags)[[:blank:]]*\$/ a
--add-module=$(MODULESDIR)/ngx_pagespeed \

# when the line does not end with a backslash,
# add a backslash, then
# add the new line without a backslash
/$(common_configure_flags)[[:blank:]]*$/ {
s/$/ \/
a
--add-module=$(MODULESDIR)/ngx_pagespeed
}
' file






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 22 '15 at 14:30

























answered Dec 18 '15 at 1:15









glenn jackmanglenn jackman

51.5k572111




51.5k572111













  • yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

    – Kevin
    Dec 18 '15 at 18:17











  • How would I do this to add it directly after the `$(common_configure_flags) ` line?

    – Kevin
    Dec 22 '15 at 14:01











  • Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

    – Kevin
    Dec 22 '15 at 14:24











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58



















  • yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

    – Kevin
    Dec 18 '15 at 18:17











  • How would I do this to add it directly after the `$(common_configure_flags) ` line?

    – Kevin
    Dec 22 '15 at 14:01











  • Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

    – Kevin
    Dec 22 '15 at 14:24











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58

















yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

– Kevin
Dec 18 '15 at 18:17





yeah, I don't think it would matter. I have to build-out a new server to test this and @thrig's solution may be a few days

– Kevin
Dec 18 '15 at 18:17













How would I do this to add it directly after the `$(common_configure_flags) ` line?

– Kevin
Dec 22 '15 at 14:01





How would I do this to add it directly after the `$(common_configure_flags) ` line?

– Kevin
Dec 22 '15 at 14:01













Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

– Kevin
Dec 22 '15 at 14:24





Changed to: sed '/common_configure_flags *:=/ a --add-module=$(MODULESDIR)/ngx_pagespeed \ ' file worked like a champ. thanks a ton

– Kevin
Dec 22 '15 at 14:24













Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

– Kevin
Oct 17 '16 at 12:58





Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

– Kevin
Oct 17 '16 at 12:58













1














I needed to add multiple lines and could not get sed to work so used awk instead:



awk '/full_configure_flags :=/{print $0 RS 
" --add-dynamic-module=/opt/ngx_http_split_clients/ngx_http_split_clients_module.c" RS
" --with-http_addition_module" RS
" --with-http_sub_module" RS
" --with-http_flv_module" RS
" --with-http_mp4_module" RS
" --with-http_gunzip_module" RS
" --with-http_random_index_module" RS
" --with-http_secure_link_module" RS
" --with-http_stub_status_module" RS
" --with-mail" RS
" --with-mail_ssl_module" RS
" --with-file-aio" RS
" --with-ipv6" RS
" --with-http_spdy_module" RS
" --with-cc-opt";next}1' /opt/rebuildnginx/nginx-1.10.2/debian/rules


This SO post was useful when figuring out syntax.






share|improve this answer


























  • Welcome to Unix.stackexchange!

    – Stephen Rauch
    Jan 30 '17 at 3:04
















1














I needed to add multiple lines and could not get sed to work so used awk instead:



awk '/full_configure_flags :=/{print $0 RS 
" --add-dynamic-module=/opt/ngx_http_split_clients/ngx_http_split_clients_module.c" RS
" --with-http_addition_module" RS
" --with-http_sub_module" RS
" --with-http_flv_module" RS
" --with-http_mp4_module" RS
" --with-http_gunzip_module" RS
" --with-http_random_index_module" RS
" --with-http_secure_link_module" RS
" --with-http_stub_status_module" RS
" --with-mail" RS
" --with-mail_ssl_module" RS
" --with-file-aio" RS
" --with-ipv6" RS
" --with-http_spdy_module" RS
" --with-cc-opt";next}1' /opt/rebuildnginx/nginx-1.10.2/debian/rules


This SO post was useful when figuring out syntax.






share|improve this answer


























  • Welcome to Unix.stackexchange!

    – Stephen Rauch
    Jan 30 '17 at 3:04














1












1








1







I needed to add multiple lines and could not get sed to work so used awk instead:



awk '/full_configure_flags :=/{print $0 RS 
" --add-dynamic-module=/opt/ngx_http_split_clients/ngx_http_split_clients_module.c" RS
" --with-http_addition_module" RS
" --with-http_sub_module" RS
" --with-http_flv_module" RS
" --with-http_mp4_module" RS
" --with-http_gunzip_module" RS
" --with-http_random_index_module" RS
" --with-http_secure_link_module" RS
" --with-http_stub_status_module" RS
" --with-mail" RS
" --with-mail_ssl_module" RS
" --with-file-aio" RS
" --with-ipv6" RS
" --with-http_spdy_module" RS
" --with-cc-opt";next}1' /opt/rebuildnginx/nginx-1.10.2/debian/rules


This SO post was useful when figuring out syntax.






share|improve this answer















I needed to add multiple lines and could not get sed to work so used awk instead:



awk '/full_configure_flags :=/{print $0 RS 
" --add-dynamic-module=/opt/ngx_http_split_clients/ngx_http_split_clients_module.c" RS
" --with-http_addition_module" RS
" --with-http_sub_module" RS
" --with-http_flv_module" RS
" --with-http_mp4_module" RS
" --with-http_gunzip_module" RS
" --with-http_random_index_module" RS
" --with-http_secure_link_module" RS
" --with-http_stub_status_module" RS
" --with-mail" RS
" --with-mail_ssl_module" RS
" --with-file-aio" RS
" --with-ipv6" RS
" --with-http_spdy_module" RS
" --with-cc-opt";next}1' /opt/rebuildnginx/nginx-1.10.2/debian/rules


This SO post was useful when figuring out syntax.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 23 '17 at 12:39









Community

1




1










answered Jan 30 '17 at 2:53









Felix EveFelix Eve

1113




1113













  • Welcome to Unix.stackexchange!

    – Stephen Rauch
    Jan 30 '17 at 3:04



















  • Welcome to Unix.stackexchange!

    – Stephen Rauch
    Jan 30 '17 at 3:04

















Welcome to Unix.stackexchange!

– Stephen Rauch
Jan 30 '17 at 3:04





Welcome to Unix.stackexchange!

– Stephen Rauch
Jan 30 '17 at 3:04











1














Some digging around points to the rules file being at present available here.



Since the package-specific configures appear to inherit via the $(common_configure_flags) statement, modifying only that block may suffice:



$ perl -00 -ple 's{$}{ \nttt--add-module=$(MODULESDIR)/ngx_pagespeed} if m/common_configure_flags :=/' rules > nu
$ diff -u rules nu
--- rules 2015-12-17 14:49:12.000000000 -0800
+++ nu 2015-12-17 14:52:52.171942309 -0800
@@ -47,7 +47,8 @@
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
- --with-http_auth_request_module
+ --with-http_auth_request_module
+ --add-module=$(MODULESDIR)/ngx_pagespeed


This solution treats the file contents in turns of paragraphs (-00 -p), and adds the necessary data at the end of each (and appropriate backwhacking, newline, and tabbery), but only for the paragraph that matches the common_configure_flags := bit. To target each section (instead of just the common one), one would need to fiddle around with the if regular expression as appropriate.






share|improve this answer


























  • I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

    – Kevin
    Dec 22 '15 at 14:02











  • Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

    – Kevin
    Dec 22 '15 at 14:25











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58
















1














Some digging around points to the rules file being at present available here.



Since the package-specific configures appear to inherit via the $(common_configure_flags) statement, modifying only that block may suffice:



$ perl -00 -ple 's{$}{ \nttt--add-module=$(MODULESDIR)/ngx_pagespeed} if m/common_configure_flags :=/' rules > nu
$ diff -u rules nu
--- rules 2015-12-17 14:49:12.000000000 -0800
+++ nu 2015-12-17 14:52:52.171942309 -0800
@@ -47,7 +47,8 @@
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
- --with-http_auth_request_module
+ --with-http_auth_request_module
+ --add-module=$(MODULESDIR)/ngx_pagespeed


This solution treats the file contents in turns of paragraphs (-00 -p), and adds the necessary data at the end of each (and appropriate backwhacking, newline, and tabbery), but only for the paragraph that matches the common_configure_flags := bit. To target each section (instead of just the common one), one would need to fiddle around with the if regular expression as appropriate.






share|improve this answer


























  • I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

    – Kevin
    Dec 22 '15 at 14:02











  • Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

    – Kevin
    Dec 22 '15 at 14:25











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58














1












1








1







Some digging around points to the rules file being at present available here.



Since the package-specific configures appear to inherit via the $(common_configure_flags) statement, modifying only that block may suffice:



$ perl -00 -ple 's{$}{ \nttt--add-module=$(MODULESDIR)/ngx_pagespeed} if m/common_configure_flags :=/' rules > nu
$ diff -u rules nu
--- rules 2015-12-17 14:49:12.000000000 -0800
+++ nu 2015-12-17 14:52:52.171942309 -0800
@@ -47,7 +47,8 @@
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
- --with-http_auth_request_module
+ --with-http_auth_request_module
+ --add-module=$(MODULESDIR)/ngx_pagespeed


This solution treats the file contents in turns of paragraphs (-00 -p), and adds the necessary data at the end of each (and appropriate backwhacking, newline, and tabbery), but only for the paragraph that matches the common_configure_flags := bit. To target each section (instead of just the common one), one would need to fiddle around with the if regular expression as appropriate.






share|improve this answer















Some digging around points to the rules file being at present available here.



Since the package-specific configures appear to inherit via the $(common_configure_flags) statement, modifying only that block may suffice:



$ perl -00 -ple 's{$}{ \nttt--add-module=$(MODULESDIR)/ngx_pagespeed} if m/common_configure_flags :=/' rules > nu
$ diff -u rules nu
--- rules 2015-12-17 14:49:12.000000000 -0800
+++ nu 2015-12-17 14:52:52.171942309 -0800
@@ -47,7 +47,8 @@
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
- --with-http_auth_request_module
+ --with-http_auth_request_module
+ --add-module=$(MODULESDIR)/ngx_pagespeed


This solution treats the file contents in turns of paragraphs (-00 -p), and adds the necessary data at the end of each (and appropriate backwhacking, newline, and tabbery), but only for the paragraph that matches the common_configure_flags := bit. To target each section (instead of just the common one), one would need to fiddle around with the if regular expression as appropriate.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 31 at 16:01









Stephen Kitt

171k24386462




171k24386462










answered Dec 17 '15 at 23:00









thrigthrig

24.9k23157




24.9k23157













  • I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

    – Kevin
    Dec 22 '15 at 14:02











  • Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

    – Kevin
    Dec 22 '15 at 14:25











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58



















  • I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

    – Kevin
    Dec 22 '15 at 14:02











  • Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

    – Kevin
    Dec 22 '15 at 14:25











  • Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

    – Kevin
    Oct 17 '16 at 12:58

















I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

– Kevin
Dec 22 '15 at 14:02





I apologize, but I cannot count on perl being installed, otherwise this is extremely viable, and probably more efficient than sed

– Kevin
Dec 22 '15 at 14:02













Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

– Kevin
Dec 22 '15 at 14:25





Sorry I couldn't give you "points", if there was a way to split an acceptance, you would've gotten it too.

– Kevin
Dec 22 '15 at 14:25













Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

– Kevin
Oct 17 '16 at 12:58





Sorry to bring up an older topic, but this is no longer working. I'll post the new 'rules' in the quesiton

– Kevin
Oct 17 '16 at 12:58


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f250036%2fadd-line-of-text-to-section-of-rules-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?