Skip to contentSkip to conversation

fixed the syslog-ng to work in yocto

PATCH In review [email protected] 2 participants 2 messages May 2, 2013 – May 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixed the syslog-ng to work in yocto

From: Jingting Zhou <a0221004@ares-ubuntu>

---
 .../packagegroup-arago-base-tisdk-server-extra.bb  |    1 +
 .../recipes-bsp/syslog-ng/syslog-ng.inc            |   31 ++++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk-server-extra.bb +1 -0
index 6dbf8ee..46db7c2 100755
@@ -66,6 +66,7 @@ RDEPENDS_${PN} = "\
     ptpd \
     vsftpd \
     syslog-ng \	
+	syslog-ng-plugins \
     dtc \
     strongswan \ 
     strongswan-plugins \ 
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +26 -5
index 584e4a4..5e3e41d 100755
@@ -7,12 +7,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5"
 # update-rc.d and update-alternatives is important
 RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
 
-INC_PR = "r9"
+INC_PR = "r10"
 
 inherit autotools
 
 SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz"
-
+ 
 noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}"
 
 EXTRA_OECONF = " \
@@ -25,14 +25,25 @@ EXTRA_OECONF = " \
   --disable-linux-caps \
   --disable-pcre \
   --disable-sql \
+  --disable-tcp-wrapper \
 "
+# disabled tcp-wrapper lib
 
-do_configure_prepend() {
-        eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
+do_configure_prepend() { 
+		eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
 }
 
 # rename modules.conf because it breaks update-modules 
 # see http://lists.linuxtogo.org/pipermail/openembedded-devel/2011-October/035537.html
+
+do_compile_prepend() {
+	cd ${WORKDIR}/syslog-ng-3.2.5/
+	sed -i "s/\#define PATH\_MODULEDIR \"\/usr\/lib\/syslog-ng\"/\#define PATH\_MODULEDIR \"\/usr\/lib\/syslog-ng\/plugins\"/" config.h
+	cd -
+}
+
+# changed the default PATH_MODULEDIR, added an extra level
+
 do_install_append() {
         mv ${D}/${sysconfdir}/modules.conf ${D}/${sysconfdir}/scl-modules.conf
         sed -i "s#@include 'modules.conf'#@include 'scl-modules.conf'#g" ${D}/${sysconfdir}/scl.conf
@@ -40,14 +51,23 @@ do_install_append() {
         install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf
         install -d ${D}/${sysconfdir}/init.d
         install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN}
+		mkdir ${D}/${libdir}/syslog-ng/plugins/
+		mv ${D}/${libdir}/syslog-ng/*.so ${D}/${libdir}/syslog-ng/plugins/
 }
 
+PACKAGES += "${PN}-plugins"
+FILES_${PN}-plugins += "${libdir}/syslog-ng/plugins/*.so"
+INSANE_SKIP_${PN}-plugins = "dev-so"
+
+# somehow the yocto doesn't allow so files in ${libdir}/syslog-ng/*.so, add another plugins level as in strongswan package
+
 FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
             ${sysconfdir} ${sharedstatedir} ${localstatedir} \
             ${base_bindir}/* ${base_sbindir}/* \
             ${base_libdir}/*${SOLIBS} \
-            ${datadir}/${BPN} ${libdir}/${BPN}/*${SOLIBS} \
+            ${datadir}/${BPN} \
             ${datadir}/include/scl/ ${datadir}/xsd"
+			
 FILES_${PN}-dev += "${libdir}/${BPN}/lib*.la ${libdir}/${BPN}/*${SOLIBSDEV}"
 CONFFILES_${PN} = "${sysconfdir}/${PN}.conf ${sysconfdir}/scl.conf ${sysconfdir}/scl-modules.conf"
 
@@ -88,3 +108,4 @@ pkg_postrm_${PN} () {
                 fi
         fi
 }
+
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 1 line · On Thu, May 02, 2013 at 12:23:58PM -0400, [email protected] wrote:

From: Jingting Zhou <a0221004@ares-ubuntu>

Same comments as with previous patch, although commit description here should be more extended - "fixed syslog-ng to work in yocto" is not the correct one. Add a short description of what you're changing (packaging plugins separately) and then, if needed, a more detailed explanation of what and why you are making changes.

Quoted 11 lines
---
 .../packagegroup-arago-base-tisdk-server-extra.bb  |    1 +
 .../recipes-bsp/syslog-ng/syslog-ng.inc            |   31 ++++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk-server-extra.bb +0 -0
index 6dbf8ee..46db7c2 100755

meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk-server-extra.bb RDEPENDS_${PN} = "\ · line 69

Quoted 4 lines
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk-server-extra.bb +1 -0
@@ -66,6 +66,7 @@ RDEPENDS_${PN} = "\
     ptpd \
     vsftpd \
     syslog-ng \	
+	syslog-ng-plugins \

Please keep the whitespaces consistent. The above lines use spaces and you add a line that uses tabs.

Quoted 9 lines
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk-server-extra.bb +0 -0
     dtc \
     strongswan \ 
     strongswan-plugins \ 
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +0 -0
index 584e4a4..5e3e41d 100755
@@ -7,12 +7,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5"
 # update-rc.d and update-alternatives is important

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5" · line 15

Quoted 10 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +2 -2
 RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
 
-INC_PR = "r9"
+INC_PR = "r10"
 
 inherit autotools
 
 SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz"
-
+ 

^^^^^^^ Extra whitespace at the end of the line - even git will complain about this.

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc EXTRA_OECONF = " \ · line 30

Quoted 10 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +2 -0
 noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}"
 
 EXTRA_OECONF = " \
@@ -25,14 +25,25 @@ EXTRA_OECONF = " \
   --disable-linux-caps \
   --disable-pcre \
   --disable-sql \
+  --disable-tcp-wrapper \
 "
+# disabled tcp-wrapper lib

It is possible to comment out things like that, if you plan on reverting the change later. Otherwise it's better to just delete the line.

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc EXTRA_OECONF = " \ · line 33

Quoted 4 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +2 -2
-do_configure_prepend() {
-        eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
+do_configure_prepend() { 
+		eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"

What is the change here? Seems the first line adds a space at the end and the second one changes the whitespace indentation. Is it on purpose?

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc EXTRA_OECONF = " \ · line 42

Quoted 9 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +5 -0
 }
 
 # rename modules.conf because it breaks update-modules 
 # see http://lists.linuxtogo.org/pipermail/openembedded-devel/2011-October/035537.html
+
+do_compile_prepend() {
+	cd ${WORKDIR}/syslog-ng-3.2.5/
+	sed -i "s/\#define PATH\_MODULEDIR \"\/usr\/lib\/syslog-ng\"/\#define PATH\_MODULEDIR \"\/usr\/lib\/syslog-ng\/plugins\"/" config.h
+	cd -

No need to cd in and cd out. Just sed directly in the file.

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc EXTRA_OECONF = " \ · line 45

Quoted 3 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +3 -0
+}
+
+# changed the default PATH_MODULEDIR, added an extra level

Any particular reason for the above?

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc do_install_append() { · line 55

Quoted 10 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +3 -0
+
 do_install_append() {
         mv ${D}/${sysconfdir}/modules.conf ${D}/${sysconfdir}/scl-modules.conf
         sed -i "s#@include 'modules.conf'#@include 'scl-modules.conf'#g" ${D}/${sysconfdir}/scl.conf
@@ -40,14 +51,23 @@ do_install_append() {
         install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf
         install -d ${D}/${sysconfdir}/init.d
         install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN}
+		mkdir ${D}/${libdir}/syslog-ng/plugins/
+		mv ${D}/${libdir}/syslog-ng/*.so ${D}/${libdir}/syslog-ng/plugins/

Whitespaces.

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc do_install_append() { · line 62

Quoted 7 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +5 -0
 }
 
+PACKAGES += "${PN}-plugins"
+FILES_${PN}-plugins += "${libdir}/syslog-ng/plugins/*.so"
+INSANE_SKIP_${PN}-plugins = "dev-so"
+
+# somehow the yocto doesn't allow so files in ${libdir}/syslog-ng/*.so, add another plugins level as in strongswan package

Hmm, can you provide more specifics to the above statement? Was there an error message? What was the prooblem? I would understand *.so from ${libdir} automatically going to ${PN}-dev, but not from ${libdir}/syslog-ng/

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc do_install_append() { · line 49

Quoted 5 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +0 -1
 FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
             ${sysconfdir} ${sharedstatedir} ${localstatedir} \
             ${base_bindir}/* ${base_sbindir}/* \
             ${base_libdir}/*${SOLIBS} \
-            ${datadir}/${BPN} ${libdir}/${BPN}/*${SOLIBS} \

The part you are removing ${libdir}/${BPN}/*${SOLIBS} was responsible for packaging /usr/lib/syslog-ng/*.so.* files into the main package. That would cover versioned libraries, but not unversioned .so ones, such as plugins.

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc do_install_append() { · line 71

Quoted 4 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +2 -0
+            ${datadir}/${BPN} \
             ${datadir}/include/scl/ ${datadir}/xsd"
+			
 FILES_${PN}-dev += "${libdir}/${BPN}/lib*.la ${libdir}/${BPN}/*${SOLIBSDEV}"

And this line has ${libdir}/${BPN}/*${SOLIBSDEV}, that translates into:
/usr/lib/syslog-ng/*.so that would package your plugins into the syslog-ng-dev package, before you moved them to one level deeper. So, I would suggest reworking this patch to create ${PN}-plugins (syslog-ng-plugins) package like you started, but not necessarily moving them into a separate directory...

meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc pkg_postrm_${PN} () { · line 111

Quoted 7 lines
meta-arago-extras/recipes-bsp/syslog-ng/syslog-ng.inc +1 -0
 CONFFILES_${PN} = "${sysconfdir}/${PN}.conf ${sysconfdir}/scl.conf ${sysconfdir}/scl-modules.conf"
 
@@ -88,3 +108,4 @@ pkg_postrm_${PN} () {
                 fi
         fi
 }
+

Empty line at the end of the file? Not that it's critical, but git will complain here as well...

Signature · 1 line
Denys