[packages/c-icap] - updated to 0.5.2 - added systemd configs

baggins baggins at pld-linux.org
Mon Apr 17 00:17:45 CEST 2017


commit 66984729882bc2025122638168a0ec0f459896ec
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Apr 17 00:17:24 2017 +0200

    - updated to 0.5.2
    - added systemd configs

 c-icap-align-64bit.patch | 50 ----------------------------
 c-icap-conf.patch        | 37 ++-------------------
 c-icap-ld.patch          | 56 -------------------------------
 c-icap.service           | 11 +++++++
 c-icap.spec              | 86 +++++++++++++++++++++++++++++++++---------------
 c-icap.sysconfig         |  3 ++
 c-icap.tmpfiles          |  1 +
 7 files changed, 77 insertions(+), 167 deletions(-)
---
diff --git a/c-icap.spec b/c-icap.spec
index 29d3a33..abe9c7f 100644
--- a/c-icap.spec
+++ b/c-icap.spec
@@ -1,19 +1,30 @@
-#
 Summary:	C implementation of an ICAP server
 Name:		c-icap
-Version:	0.1.4
-Release:	0.1
+Version:	0.5.2
+Release:	1
 License:	BSD
 Group:		Libraries
-Source0:	http://dl.sourceforge.net/c-icap/c_icap-%{version}.tar.gz
-# Source0-md5:	e1ce94fe7beaaa9318c3595694b10709
+Source0:	http://downloads.sourceforge.net/c-icap/c_icap-%{version}.tar.gz
+# Source0-md5:	c0ad392336eb401d1630174cc67c0f71
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
 Source3:	%{name}.logrotate
-Patch0:		%{name}-ld.patch
-Patch1:		%{name}-align-64bit.patch
-Patch2:		%{name}-conf.patch
+Source4:	%{name}.service
+Source5:	%{name}.tmpfiles
+Patch0:		c-icap-conf.patch
 URL:		http://c-icap.sourceforge.net/
+BuildRequires:	bzip2-devel
+BuildRequires:	db-devel
+BuildRequires:	doxygen
+BuildRequires:	libmemcached-devel
+BuildRequires:	openldap-devel
+BuildRequires:	openssl-devel
+BuildRequires:	pcre-devel
+BuildRequires:	rpmbuild(macros) >= 1.647
+BuildRequires:	zlib-devel
+Requires(post,preun):	/sbin/chkconfig
+Requires(post,preun,postun):	systemd-units >= 38
+Requires:	systemd-units >= 0.38
 Requires:	%{name}-lib = %{version}-%{release}
 Requires:	rc-scripts >= 0.4.0.12
 Conflicts:	logrotate < 3.8.0
@@ -61,30 +72,41 @@ Statyczna biblioteka c-icap.
 %prep
 %setup -q -n c_icap-%{version}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
 
 %build
-%{__autoconf}
 %configure \
+	--sysconfdir=%{_sysconfdir}/c-icap \
 	--enable-large-files \
-	--sysconfdir=%{_sysconfdir}/c-icap
-%{__automake}
+	--with-openssl \
+	--with-zlib \
+	--with-bzlib \
+	--with-bdb \
+	--with-ldap \
+	--with-memcached \
+	--with-pcre \
+	--enable-ipv6
+
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 install -d $RPM_BUILD_ROOT%{_datadir}/c_icap/templates \
 	$RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
-	$RPM_BUILD_ROOT/var/log{,/archive}/c-icap
-touch $RPM_BUILD_ROOT/var/log/c-icap/{access.log,server.log}
+	$RPM_BUILD_ROOT/var/log{,/archive}/c-icap \
+	$RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{systemdunitdir}}
+
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/c-icap
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/c-icap
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/c-icap
+touch $RPM_BUILD_ROOT/var/log/c-icap/{access.log,server.log}
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/c-icap
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/c-icap
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/c-icap
+cp -p %{SOURCE4} $RPM_BUILD_ROOT/%{systemdunitdir}/c-icap.service
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/c-icap.conf
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/c_icap/*.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -96,18 +118,21 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/chkconfig --add c-icap
 %service c-icap restart
+%systemd_post %{name}.service
 
 %preun
 if [ "$1" = "0" ]; then
 	/sbin/chkconfig --del c-icap
 	%service c-icap stop
 fi
+%systemd_preun %{name}.service
 
 %postun
 if [ "$1" = "0" ]; then
 	%userremove c-icap
 	%groupremove c-icap
 fi
+%systemd_reload
 
 %post	lib -p /sbin/ldconfig
 %postun	lib -p /sbin/ldconfig
@@ -119,8 +144,12 @@ fi
 %dir %{_sysconfdir}/c-icap
 %attr(640,root,c-icap) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/c-icap/c-icap.conf
 %attr(640,root,c-icap) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/c-icap/c-icap.magic
+%{_sysconfdir}/c-icap/c-icap.conf.default
+%{_sysconfdir}/c-icap/c-icap.magic.default
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/c-icap
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/c-icap
+%{systemdunitdir}/c-icap.service
+%{systemdtmpfilesdir}/c-icap.conf
 %attr(754,root,root) /etc/rc.d/init.d/c-icap
 %attr(755,root,root) %{_bindir}/c-icap
 %attr(755,root,root) %{_bindir}/c-icap-client
@@ -131,13 +160,16 @@ fi
 %attr(755,root,root) %{_libdir}/c_icap/ldap_module.so
 %attr(755,root,root) %{_libdir}/c_icap/srv_echo.so
 %attr(755,root,root) %{_libdir}/c_icap/sys_logger.so
-%{_mandir}/man8/c-icap.8.gz
-%{_mandir}/man8/c-icap-client.8.gz
-%{_mandir}/man8/c-icap-config.8.gz
-%{_mandir}/man8/c-icap-libicapapi-config.8.gz
-%{_mandir}/man8/c-icap-mkbdb.8.gz
-%{_mandir}/man8/c-icap-stretch.8.gz
-%attr(755,root,root) %dir %{_datadir}/c_icap
+%attr(755,root,root) %{_libdir}/c_icap/memcached_cache.so
+%attr(755,root,root) %{_libdir}/c_icap/shared_cache.so
+%attr(755,root,root) %{_libdir}/c_icap/srv_ex206.so
+%{_mandir}/man8/c-icap.8*
+%{_mandir}/man8/c-icap-client.8*
+%{_mandir}/man8/c-icap-config.8*
+%{_mandir}/man8/c-icap-libicapapi-config.8*
+%{_mandir}/man8/c-icap-mkbdb.8*
+%{_mandir}/man8/c-icap-stretch.8*
+%dir %{_datadir}/c_icap
 %attr(750,c-icap,c-icap) %dir /var/run/c-icap
 %attr(770,root,c-icap) %dir /var/log/archive/c-icap
 %attr(770,root,c-icap) %dir /var/log/c-icap
@@ -146,7 +178,7 @@ fi
 %files lib
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libicapapi.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libicapapi.so.0
+%attr(755,root,root) %ghost %{_libdir}/libicapapi.so.5
 
 %files devel
 %defattr(644,root,root,755)
diff --git a/c-icap-align-64bit.patch b/c-icap-align-64bit.patch
deleted file mode 100644
index dfc2f0a..0000000
--- a/c-icap-align-64bit.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Align 64 Bit Patch
---- a/stats.c
-+++ b/stats.c
-@@ -29,10 +29,11 @@
- struct stat_area *STATS = NULL;
- 
- #define STEP 128
-+#define ALIGN64(val) ((val+7)&~7)
- 
- int ci_stat_memblock_size(void)
- {
--   return sizeof(struct stat_memblock)+STAT_INT64.entries_num*sizeof(uint64_t)+STAT_KBS.entries_num*sizeof(kbs_t);
-+   return ALIGN64(sizeof(struct stat_memblock))+STAT_INT64.entries_num*sizeof(uint64_t)+STAT_KBS.entries_num*sizeof(kbs_t);
- }
- 
- int stat_entry_by_name(struct stat_entry_list *list, const char *label);
-@@ -202,8 +203,8 @@
-      ci_thread_mutex_init(&(area->mtx));
-      area->mem_block = mem_block;
-      area->release_mem = release_mem;
--     area->mem_block->counters64 = mem_block + sizeof(struct stat_memblock);
--     area->mem_block->counterskbs = mem_block + sizeof(struct stat_memblock) + STAT_INT64.entries_num*sizeof(uint64_t);
-+     area->mem_block->counters64 = mem_block + ALIGN64(sizeof(struct stat_memblock));
-+     area->mem_block->counterskbs = mem_block + ALIGN64(sizeof(struct stat_memblock)) + STAT_INT64.entries_num*sizeof(uint64_t);
-      area->mem_block->counters64_size =  STAT_INT64.entries_num;
-      area->mem_block->counterskbs_size = STAT_KBS.entries_num;
-      ci_stat_area_reset(area);
-@@ -267,17 +268,17 @@
-      assert(mem_block->sig == MEMBLOCK_SIG);
-      mem_block->counters64_size =  STAT_INT64.entries_num;
-      mem_block->counterskbs_size = STAT_KBS.entries_num;
--     mem_block->counters64 = (void *)mem_block + sizeof(struct stat_memblock);
--     mem_block->counterskbs = (void *)mem_block + sizeof(struct stat_memblock)
--                              + mem_block->counters64_size*sizeof(uint64_t);
-+     mem_block->counters64 = (void *)mem_block + ALIGN64(sizeof(struct stat_memblock));
-+     mem_block->counterskbs = (void *)mem_block + ALIGN64(sizeof(struct stat_memblock))
-+                               + mem_block->counters64_size*sizeof(uint64_t);
- }
- 
- /*Reconstruct a memblock which is located to a continues memory block*/
- void stat_memblock_reconstruct(struct stat_memblock *mem_block)
- {
-      assert(mem_block->sig == MEMBLOCK_SIG);
--     mem_block->counters64 = (void *)mem_block + sizeof(struct stat_memblock);
--     mem_block->counterskbs = (void *)mem_block + sizeof(struct stat_memblock)
-+     mem_block->counters64 = (void *)mem_block + ALIGN64(sizeof(struct stat_memblock));
-+     mem_block->counterskbs = (void *)mem_block + ALIGN64(sizeof(struct stat_memblock))
-                               + mem_block->counters64_size*sizeof(uint64_t);
- }
- 
diff --git a/c-icap-conf.patch b/c-icap-conf.patch
index 9c3c07b..b2d68fc 100644
--- a/c-icap-conf.patch
+++ b/c-icap-conf.patch
@@ -28,46 +28,15 @@ diff -ur c_icap-0.1.4.orig//c-icap.conf.in c_icap-0.1.4.mod//c-icap.conf.in
  
  # TAG: MaxMemObject
  # Format: MaxMemObject bytes
-@@ -173,23 +175,23 @@
+@@ -173,7 +175,7 @@
  #	The acceptable range of levels is between 0 and 10.
  # Default:
  #	DebugLevel 1
 -DebugLevel 1
 +DebugLevel 0
  
- # TAG: ModulesDir
- # Format: ModulesDir dir
- # Description:
- #	The location of modules
- # Default:
--#	ModulesDir @prefix@/lib/c_icap
--ModulesDir @prefix@/lib/c_icap
-+#	ModulesDir @libdir@/c_icap
-+ModulesDir @libdir@/c_icap
- 
- # TAG: ServicesDir
- # Format: ServicesDir dir
- # Description:
- #	The location of services
- # Default:
--#	ServicesDir @prefix@/lib/c_icap
--ServicesDir @prefix@/lib/c_icap
-+#	ServicesDir @libdir@/c_icap
-+ServicesDir @libdir@/c_icap
- 
- # TAG: TemplateDir
- # Format: TemplateDir dir
-@@ -221,8 +223,8 @@
- #	for more informations.
- #	It can be used more than once to use multiple magic files.
- # Default:
--#	LoadMagicFile @prefix@/etc/c-icap.magic
--LoadMagicFile @prefix@/etc/c-icap.magic
-+#	LoadMagicFile /etc/c-icap/c-icap.magic
-+LoadMagicFile /etc/c-icap/c-icap.magic
- 
- # TAG: RemoteProxyUsers
- # Format: RemoteProxyUsers onoff
+ # TAG: Pipelining
+ # Format: Pipelining on|off
 @@ -289,7 +291,7 @@
  # Default:
  #	No value
diff --git a/c-icap-ld.patch b/c-icap-ld.patch
deleted file mode 100644
index 6c8280b..0000000
--- a/c-icap-ld.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff -ur c_icap-0.1.4.orig//Makefile.am c_icap-0.1.4.mod//Makefile.am
---- c_icap-0.1.4.orig//Makefile.am	2010-06-28 08:38:02.000000000 +0200
-+++ c_icap-0.1.4.mod//Makefile.am	2011-03-18 14:24:30.432337377 +0100
-@@ -37,7 +37,7 @@
- # libicapapi ......
- libicapapi_la_CFLAGS= -Iinclude/ @ZLIB_ADD_FLAG@ -DCI_BUILD_LIB
- 
--libicapapi_la_LIBADD = @ZLIB_ADD_LDFLAG@
-+libicapapi_la_LIBADD = @ZLIB_ADD_LDFLAG@ @DL_ADD_FLAG@ @THREADS_LDADD@
- libicapapi_la_LDFLAGS= -shared -version-info @CICAPLIB_VERSION@
- 
- 
-@@ -47,7 +47,7 @@
-                           -DSERVDIR=\"$(SERVICESDIR)\" -DLOGDIR=\"$(LOGDIR)\"  \
-                           -DDATADIR=\"$(DATADIR)\"
- 
--c_icap_LDADD = @THREADS_LDADD@ libicapapi.la @DL_ADD_FLAG@
-+c_icap_LDADD = libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@
- c_icap_LDFLAGS = -rdynamic -rpath @libdir@ @THREADS_LDFLAGS@
- 
- 
-diff -ur c_icap-0.1.4.orig//tests/Makefile.am c_icap-0.1.4.mod//tests/Makefile.am
---- c_icap-0.1.4.orig//tests/Makefile.am	2010-02-28 16:59:18.000000000 +0100
-+++ c_icap-0.1.4.mod//tests/Makefile.am	2011-03-18 14:22:26.226656185 +0100
-@@ -6,7 +6,7 @@
- #CONFIGDIR=$(sysconfdir)/
- AM_CFLAGS= -I../include/
- AM_LDFLAGS = -rdynamic -rpath @libdir@ @THREADS_LDFLAGS@
--LIBS=@THREADS_LDADD@ ../libicapapi.la @DL_ADD_FLAG@
-+LIBS = ../libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@
- 
- 
- noinst_PROGRAMS = test_cache test_tables test_headers
-diff -ur c_icap-0.1.4.orig//utils/Makefile.am c_icap-0.1.4.mod//utils/Makefile.am
---- c_icap-0.1.4.orig//utils/Makefile.am	2010-02-22 23:13:50.000000000 +0100
-+++ c_icap-0.1.4.mod//utils/Makefile.am	2011-03-18 14:24:42.852905494 +0100
-@@ -16,16 +16,16 @@
- #other .....
- c_icap_client_SOURCES = c-icap-client.c
- c_icap_client_CFLAGS= -I../include/
--c_icap_client_LDADD= @THREADS_LDADD@ ../libicapapi.la @DL_ADD_FLAG@
-+c_icap_client_LDADD= ../libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@
- c_icap_client_LDFLAGS = -rdynamic -rpath @libdir@ @THREADS_LDFLAGS@
- 
- c_icap_mkbdb_SOURCES = c-icap-mkbdb.c
- c_icap_mkbdb_CFLAGS= -I../include/  @BDB_ADD_FLAG@
--c_icap_mkbdb_LDADD= @THREADS_LDADD@ ../libicapapi.la @DL_ADD_FLAG@  @BDB_ADD_LDFLAG@
-+c_icap_mkbdb_LDADD= ../libicapapi.la @DL_ADD_FLAG@  @BDB_ADD_LDFLAG@ @THREADS_LDADD@
- c_icap_mkbdb_LDFLAGS = -rdynamic -rpath @libdir@ @THREADS_LDFLAGS@ 
- 
- c_icap_stretch_SOURCES = c-icap-stretch.c
- c_icap_stretch_CFLAGS= -I../include/
--c_icap_stretch_LDADD = @THREADS_LDADD@ ../libicapapi.la @DL_ADD_FLAG@
-+c_icap_stretch_LDADD = ../libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@
- c_icap_stretch_LDFLAGS= @THREADS_LDFLAGS@
- 
diff --git a/c-icap.service b/c-icap.service
new file mode 100644
index 0000000..4223d91
--- /dev/null
+++ b/c-icap.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=C-ICAP Server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/c-icap
+ExecStart=/usr/sbin/c-icap $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/c-icap.sysconfig b/c-icap.sysconfig
index 5ad9fed..c5fe25a 100644
--- a/c-icap.sysconfig
+++ b/c-icap.sysconfig
@@ -1,4 +1,7 @@
 # c-icap startup configuration file
 
+# Add extra daemon options here
+OPTIONS="-f /etc/c-icap/c-icap.conf"
+
 # Try to define nice-level for running c-icap
 SERVICE_RUN_NICE_LEVEL="+5"
diff --git a/c-icap.tmpfiles b/c-icap.tmpfiles
new file mode 100644
index 0000000..fcc5cf6
--- /dev/null
+++ b/c-icap.tmpfiles
@@ -0,0 +1 @@
+d /var/run/c-icap/ 0750 c-icap c-icap
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/c-icap.git/commitdiff/66984729882bc2025122638168a0ec0f459896ec



More information about the pld-cvs-commit mailing list