You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.1 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=syslog-ng
  3. PKG_VERSION:=3.37.1
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
  6. PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
  7. PKG_LICENSE_FILES:=COPYING LGPL.txt GPL.txt
  8. PKG_CPE_ID:=cpe:/a:balabit:syslog-ng
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/syslog-ng/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
  11. PKG_HASH:=d67a320cb896cd5d62f24d9e1bec138847fa4618ae13a3946cae2b75c528ee14
  12. PKG_BUILD_PARALLEL:=1
  13. PKG_INSTALL:=1
  14. PKG_BUILD_DEPENDS:= \
  15. HOST_OS_MACOS:fakeuname/host \
  16. PKG_CONFIG_DEPENDS:= \
  17. CONFIG_IPV6 \
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/nls.mk
  20. ifeq ($(CONFIG_HOST_OS_MACOS),y)
  21. include ../../utils/fakeuname/fakeuname.mk
  22. endif
  23. define Package/syslog-ng
  24. SECTION:=admin
  25. CATEGORY:=Administration
  26. TITLE:=A powerful syslog daemon
  27. URL:=https://www.syslog-ng.com/products/open-source-log-management/
  28. DEPENDS:=+libpcre +glib2 +libopenssl +libpthread +librt +zlib +libdbi +libjson-c +libcurl +libuuid +SYSLOGNG_LOGROTATE:logrotate
  29. endef
  30. define Package/syslog-ng/description
  31. syslog-ng reads and logs messages to the system console, log
  32. files, other machines and/or users as specified by its
  33. configuration file.
  34. endef
  35. define Package/syslog-ng/conffiles
  36. /etc/syslog-ng.conf
  37. /etc/syslog-ng.d/
  38. /etc/scl.conf
  39. endef
  40. define Package/syslog-ng/config
  41. config SYSLOGNG_LOGROTATE
  42. bool "Logrotate support"
  43. depends on PACKAGE_syslog-ng
  44. default n
  45. help
  46. It adds support for logrotate functionality.
  47. config SYSLOGNG_LOGROTATE_MAXSIZE
  48. string "Maximum size of /var/log/messages log file"
  49. depends on SYSLOGNG_LOGROTATE
  50. default "1M"
  51. help
  52. Log files are rotated when they grow bigger than defined size bytes.
  53. config SYSLOGNG_LOGROTATE_ROTATE_COUNT
  54. int "Maximum rotation count for /var/log/messages log file"
  55. depends on SYSLOGNG_LOGROTATE
  56. default 1
  57. help
  58. Log files are rotated count times before being removed or mailed to
  59. the address specified in a mail directive. If count is 0, old
  60. versions are removed rather than rotated.
  61. endef
  62. define Build/Configure
  63. $(SED) 's,-I/usr/include,,' $(PKG_BUILD_DIR)/configure
  64. $(Build/Configure/Default)
  65. endef
  66. LOGROTATE_MAXSIZE:=$(call qstrip,$(CONFIG_SYSLOGNG_LOGROTATE_MAXSIZE))
  67. LOGROTATE_ROTATE:=$(call qstrip,$(CONFIG_SYSLOGNG_LOGROTATE_ROTATE_COUNT))
  68. CONFIGURE_ARGS += \
  69. --disable-afsnmp \
  70. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  71. --disable-tcp-wrapper \
  72. --disable-spoof-source \
  73. --disable-sql \
  74. --disable-linux-caps \
  75. --with-jsonc=system \
  76. --enable-json=yes \
  77. --enable-http=yes \
  78. --disable-smtp \
  79. --disable-mqtt \
  80. --disable-redis \
  81. --disable-dependency-tracking \
  82. --disable-python \
  83. --disable-geoip2 \
  84. --disable-java \
  85. --disable-java-modules \
  86. --with-librabbitmq-client=no \
  87. --with-mongoc=no
  88. CONFIGURE_VARS += \
  89. $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(PATH)) \
  90. LIBDBI_CFLAGS="-I$(STAGING_DIR)/usr/include"
  91. define Package/syslog-ng/install
  92. cd $(PKG_BUILD_DIR); make DESTDIR=$(1) install
  93. $(call libtool_remove_files,$(1)) # This removes .la files in folder (including subfolders) /usr/lib
  94. rm -rf $(1)/usr/lib/pkgconfig \
  95. $(1)/usr/lib/*.a \
  96. $(1)/usr/include \
  97. $(1)/var
  98. $(INSTALL_DIR) $(1)/etc/init.d
  99. $(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
  100. $(INSTALL_DIR) $(1)/etc/syslog-ng.d
  101. $(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
  102. touch $(1)/etc/syslog-ng.d/.keep
  103. $(INSTALL_DIR) $(1)/sbin
  104. $(INSTALL_BIN) ./files/logread $(1)/sbin
  105. $(INSTALL_DIR) $(1)/usr/share/syslog-ng/include/
  106. $(CP) -r ./files/scl $(1)/usr/share/syslog-ng/include/
  107. ifneq ($(strip $(CONFIG_SYSLOGNG_LOGROTATE)),)
  108. $(INSTALL_DIR) $(1)/etc/logrotate.d
  109. sed \
  110. -e 's#@MAXSIZE@#$(LOGROTATE_MAXSIZE)#g' \
  111. -e 's#@ROTATE@#$(LOGROTATE_ROTATE)#g' \
  112. ./files/syslog-ng.logrotate > $(1)/etc/logrotate.d/syslog-ng.conf
  113. endif
  114. endef
  115. define Package/syslog-ng/postinst
  116. #!/bin/sh
  117. [ -n "$$IPKG_INSTROOT" ] || {
  118. /etc/init.d/syslog-ng enable
  119. /etc/init.d/syslog-ng restart
  120. }
  121. endef
  122. define Package/syslog-ng/prerm
  123. #!/bin/sh
  124. [ -n "$$IPKG_INSTROOT" ] || {
  125. /etc/init.d/syslog-ng disable
  126. /etc/init.d/syslog-ng stop
  127. }
  128. endef
  129. $(eval $(call BuildPackage,syslog-ng))