[packages/monkey] Up to 1.8.5

arekm arekm at pld-linux.org
Fri May 8 22:20:49 CEST 2026


commit cd732d8d31a3c3a8715b70928dbe3ff0cac6ae5f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri May 8 22:01:16 2026 +0200

    Up to 1.8.5

 monkey-cmake-install-paths.patch |  86 +++++++++++++++++++++++
 monkey-pld.patch                 |  11 ---
 monkey-security.patch            |  12 ----
 monkey.service                   |  12 ++++
 monkey.spec                      | 144 +++++++++++++++++++++++++--------------
 monkey.tmpfiles                  |   1 +
 6 files changed, 190 insertions(+), 76 deletions(-)
---
diff --git a/monkey.spec b/monkey.spec
index 104369a..4cd1c1a 100644
--- a/monkey.spec
+++ b/monkey.spec
@@ -1,89 +1,127 @@
-# TODO
-# - httpdir conflicts with apache2
-# - ghost and verify to index.html
-Summary:	Small WebServer
-Summary(pl.UTF-8):	Mały serwer WWW
+Summary:	A fast and lightweight web server for Linux
+Summary(pl.UTF-8):	Szybki i lekki serwer WWW dla Linuksa
 Name:		monkey
-Version:	0.9.2
+Version:	1.8.5
 Release:	1
-License:	GPL
+License:	Apache v2
 Group:		Networking/Daemons
-Source0:	http://monkeyd.sourceforge.net/versions/%{name}-%{version}.tar.gz
-# Source0-md5:	1ee81de2c8f34398ad1e096212058a7b
-Source1:	%{name}d.init
-Patch0:		%{name}-pld.patch
-Patch1:		%{name}-security.patch
-URL:		http://monkeyd.sourceforge.net/
+Source0:	https://github.com/monkey/monkey/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	8b8d68b8517163443abdf4718a3855c3
+Source1:	%{name}.service
+Source2:	%{name}.tmpfiles
+Source3:	monkeyd.init
+Patch0:		%{name}-cmake-install-paths.patch
+URL:		https://monkey-project.com/
+BuildRequires:	cmake >= 3.20
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post,preun):	/sbin/chkconfig
-Requires:	rc-scripts
+Requires(post,preun,postun):	systemd-units >= 38
+Requires(pre):	/bin/id
+Requires(pre):	/usr/bin/getgid
+Requires(pre):	/usr/sbin/groupadd
+Requires(pre):	/usr/sbin/useradd
+Requires:	systemd-units >= 38
 Provides:	webserver
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_bindir		/usr/sbin
-%define		_sysconfdir	/etc/httpd
-# FIXME apache owns that dir too. conflict or choose other dir. imho
-%define		httpdir		/home/services/httpd
+%define		_sysconfdir	/etc/monkey
+%define		_webdir		/var/www/monkey
 
 %description
-Monkey is a small WebServer written 100% in C.
+Monkey is a fast and lightweight web server for Linux. It has been
+designed to be very scalable with low memory and CPU consumption, the
+perfect solution for embedded and high production environments.
 
 %description -l pl.UTF-8
-Monkey to mały serwer WWW napisany w 100% w języku C.
+Monkey to szybki i lekki serwer WWW dla Linuksa. Został zaprojektowany
+jako bardzo skalowalny przy niskim zużyciu pamięci i procesora - idealne
+rozwiązanie dla środowisk wbudowanych i produkcyjnych.
+
+%package devel
+Summary:	Header files for Monkey HTTP server plugin development
+Summary(pl.UTF-8):	Pliki nagłówkowe do tworzenia wtyczek dla serwera Monkey
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header files for building plugins against the Monkey HTTP server.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe do tworzenia wtyczek dla serwera HTTP Monkey.
 
 %prep
 %setup -q
 %patch -P0 -p1
-%patch -P1 -p1
 
 %build
-./configure \
-	--cgibin=%{httpdir}/cgi-bin \
-	--sysconfdir=%{_sysconfdir} \
-	--datadir=%{httpdir}/html \
-	--logdir=/var/log/monkey \
-	--lang=en
+install -d build
+cd build
+%cmake .. \
+	-DCMAKE_INSTALL_SBINDIR=%{_sbindir} \
+	-DINSTALL_SYSCONFDIR=%{_sysconfdir} \
+	-DINSTALL_WEBROOTDIR=%{_webdir} \
+	-DINSTALL_LOGDIR=%{_var}/log/monkey \
+	-DPID_PATH=%{_var}/run/monkey \
+	-DDEFAULT_USER=http \
+	-DDEFAULT_PORT=80
 
-%{__make} \
-	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags}"
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_bindir}} \
-	$RPM_BUILD_ROOT{%{httpdir}/cgi-bin,%{httpdir}/html/{imgs,php,docs}} \
-	$RPM_BUILD_ROOT%{_var}/log/monkey
+%{__make} -C build install DESTDIR=$RPM_BUILD_ROOT
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/monkeyd
-install bin/monkey $RPM_BUILD_ROOT%{_bindir}
-install cgi-bin/* $RPM_BUILD_ROOT%{httpdir}/cgi-bin
-install conf/*.* $RPM_BUILD_ROOT%{_sysconfdir}
-install htdocs/*.* $RPM_BUILD_ROOT%{httpdir}/html
-install htdocs/imgs/*.* $RPM_BUILD_ROOT%{httpdir}/html/imgs
-install htdocs/php/*.* $RPM_BUILD_ROOT%{httpdir}/html/php
-install htdocs/docs/*.* $RPM_BUILD_ROOT%{httpdir}/html/docs
+install -d $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir},%{_webdir},/etc/rc.d/init.d}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/monkey.service
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/monkey.conf
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/monkey
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -r -g 51 http
+%useradd -r -u 214 -d %{_webdir} -s /bin/false -c "Monkey HTTP Server" -g http monkey
+
 %post
-/sbin/chkconfig --add monkeyd
-%service monkeyd restart
+/sbin/chkconfig --add monkey
+%systemd_post monkey.service
 
 %preun
 if [ "$1" = "0" ]; then
-	%service monkeyd stop
-	/sbin/chkconfig --del monkeyd
+	%service monkey stop
+	/sbin/chkconfig --del monkey
 fi
+%systemd_preun monkey.service
+
+%postun
+%systemd_reload
 
 %files
 %defattr(644,root,root,755)
-%doc ChangeLog.txt HowItWorks.txt MODULES README
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
-%attr(755,root,root) %{_bindir}/*
-%attr(754,root,root) /etc/rc.d/init.d/*
-%attr(000,root,root) %{httpdir}/cgi-bin/*
-# FIXME index.html would be replaced/removed with the package!!!
-%{httpdir}/html/*
-%{_var}/log/monkey
+%doc ChangeLog README.md
+%dir %{_sysconfdir}
+%dir %{_sysconfdir}/plugins
+%dir %{_sysconfdir}/sites
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monkey.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monkey.mime
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins.load
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sites/default
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/dirlisting/dirhtml.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/mandril/mandril.conf
+%{_sysconfdir}/plugins/dirlisting/themes
+%attr(755,root,root) %{_sbindir}/monkey
+%attr(755,root,root) %{_libdir}/monkey-dirlisting.so
+%attr(755,root,root) %{_libdir}/monkey-mandril.so
+%{systemdunitdir}/monkey.service
+%attr(754,root,root) /etc/rc.d/init.d/monkey
+%{_mandir}/man1/monkey.1*
+%dir %attr(750,monkey,http) %{_var}/log/monkey
+%dir %attr(750,monkey,http) %{_var}/run/monkey
+%{systemdtmpfilesdir}/monkey.conf
+%dir %attr(755,root,root) %{_webdir}
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/monkey
diff --git a/monkey-cmake-install-paths.patch b/monkey-cmake-install-paths.patch
new file mode 100644
index 0000000..5bc4869
--- /dev/null
+++ b/monkey-cmake-install-paths.patch
@@ -0,0 +1,86 @@
+--- monkey-1.8.5.orig/CMakeLists.txt	2025-09-10 21:39:58.000000000 +0200
++++ monkey-1.8.5/CMakeLists.txt	2026-05-08 20:56:17.175740550 +0200
+@@ -263,6 +263,45 @@
+   set(CMAKE_MACOSX_RPATH ${CMAKE_MACOSX_RPATH};${CMAKE_INSTALL_FULL_LIBDIR}/monkey)
+ endif()
+ 
++# Install path definitions
++if(BUILD_LOCAL)
++  set(MK_PATH_CONF     "${CMAKE_CURRENT_BINARY_DIR}/conf/")
++  set(MK_PATH_PIDPATH  "${CMAKE_CURRENT_BINARY_DIR}")
++  set(MK_PATH_WWW      "${CMAKE_CURRENT_SOURCE_DIR}/htdocs/")
++  set(MK_PATH_LOG      "${CMAKE_CURRENT_BINARY_DIR}/log/")
++  file(MAKE_DIRECTORY  ${MK_PATH_LOG})
++else()
++  if(NOT INSTALL_SYSCONFDIR)
++    set(MK_PATH_CONF ${CMAKE_INSTALL_FULL_SYSCONFDIR}/monkey/ CACHE STRING "Server configuration")
++  else()
++    set(MK_PATH_CONF ${INSTALL_SYSCONFDIR}/ CACHE STRING "Server configuration")
++  endif()
++
++  if(NOT INSTALL_LOGDIR)
++    set(MK_PATH_LOG ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/monkey CACHE STRING "Server logs")
++  else()
++    set(MK_PATH_LOG ${INSTALL_LOGDIR} CACHE STRING "Server logs")
++  endif()
++
++  if(NOT PID_PATH)
++    set(MK_PATH_PIDPATH ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/ CACHE STRING "Server PID path")
++  else()
++    set(MK_PATH_PIDPATH ${PID_PATH} CACHE STRING "Server PID path")
++  endif()
++
++  if(NOT INSTALL_WEBROOTDIR)
++    set(MK_PATH_WWW ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/www/monkey CACHE STRING "Server Web documents")
++  else()
++    set(MK_PATH_WWW ${INSTALL_WEBROOTDIR} CACHE STRING "Server Web documents")
++  endif()
++
++  if(NOT INSTALL_INCLUDEDIR)
++    set(MK_PATH_HEADERS ${CMAKE_INSTALL_INCLUDEDIR}/monkey CACHE STRING "Server header files (development)")
++  else()
++    set(MK_PATH_HEADERS ${INSTALL_INCLUDEDIR} CACHE STRING "Server header files (development)")
++  endif()
++endif()
++
+ if(DEFAULT_PORT)
+   set(MK_CONF_LISTEN  ${DEFAULT_PORT})
+ endif()
+--- monkey-1.8.5.orig/include/CMakeLists.txt	2025-09-10 21:39:58.000000000 +0200
++++ monkey-1.8.5/include/CMakeLists.txt	2026-05-08 20:56:20.515948174 +0200
+@@ -1,11 +1,6 @@
+-# MK_CORE
+-if(NOT WITHOUT_HEADERS)
+-  install(FILES "mk_core.h"
+-    DESTINATION include/
+-    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+-
+-  file(GLOB headers "mk_core/*.h")
+-  install(FILES ${headers}
+-    DESTINATION include/mk_core
+-    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
++if(NOT BUILD_LOCAL)
++  install(DIRECTORY
++      ${CMAKE_CURRENT_SOURCE_DIR}/monkey/
++    DESTINATION
++      ${MK_PATH_HEADERS})
+ endif()
+--- monkey-1.8.5.orig/conf/CMakeLists.txt	2025-09-10 21:39:58.000000000 +0200
++++ monkey-1.8.5/conf/CMakeLists.txt	2026-05-08 20:56:56.686503265 +0200
+@@ -15,3 +15,16 @@
+   "${PROJECT_SOURCE_DIR}/conf/sites/default.in"
+   "${PROJECT_BINARY_DIR}/conf/sites/default"
+   )
++
++if(NOT BUILD_LOCAL)
++  install(FILES
++      ${PROJECT_BINARY_DIR}/conf/monkey.conf
++      ${PROJECT_BINARY_DIR}/conf/monkey.mime
++      ${PROJECT_BINARY_DIR}/conf/plugins.load
++    DESTINATION
++      ${MK_PATH_CONF})
++  install(FILES
++      ${PROJECT_BINARY_DIR}/conf/sites/default
++    DESTINATION
++      ${MK_PATH_CONF}/sites/)
++endif()
diff --git a/monkey-pld.patch b/monkey-pld.patch
deleted file mode 100644
index df8557c..0000000
--- a/monkey-pld.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- monkey-0.7.0/configure.orig	Mon May 12 18:07:36 2003
-+++ monkey-0.7.0/configure	Mon May 12 18:07:50 2003
-@@ -343,7 +343,7 @@
- create_info()
- {
- cat > $INCDIR/info.h <<EOF
--#define OS "$SYSNAME"
-+#define OS "PLD/$SYSNAME"
- #define VERSION "$VERSION" /* Version de Monkey */
- #define MONKEY_PATH_CONF "$sysconfdir"
- EOF
diff --git a/monkey-security.patch b/monkey-security.patch
deleted file mode 100644
index cb0a919..0000000
--- a/monkey-security.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -burN monkey-0.7.1-orig/htdocs/php/index.php monkey-0.7.1/htdocs/php/index.php
---- monkey-0.7.1-orig/htdocs/php/index.php	Sat May 31 05:40:40 2003
-+++ monkey-0.7.1/htdocs/php/index.php	Mon Jun  9 13:15:34 2003
-@@ -6,7 +6,7 @@
- // Your PHP support is not working...
- //
- //
--	echo phpinfo();
-+	echo 'PHP works!';
- ?>
- 
- </BODY>
diff --git a/monkey.service b/monkey.service
new file mode 100644
index 0000000..ebe3997
--- /dev/null
+++ b/monkey.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Monkey HTTP Server
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/monkey --daemon
+PIDFile=/var/run/monkey/monkey.pid
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/monkey.tmpfiles b/monkey.tmpfiles
new file mode 100644
index 0000000..ba541f9
--- /dev/null
+++ b/monkey.tmpfiles
@@ -0,0 +1 @@
+d /var/run/monkey 0750 monkey http -
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/monkey.git/commitdiff/cd732d8d31a3c3a8715b70928dbe3ff0cac6ae5f



More information about the pld-cvs-commit mailing list