forked from pool/dictd
WIP: upgrade to the latest commit
Add FTBFS-servparse.patch to fix gh#cheusov/dictd#21 (WIP)
This commit is contained in:
parent
c0d0a8c0c7
commit
282f441d84
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
.osc
|
||||
/dictd/
|
||||
/dictd-*+git.*/
|
||||
|
80
FTBFS-servparse.patch
Normal file
80
FTBFS-servparse.patch
Normal file
@ -0,0 +1,80 @@
|
||||
---
|
||||
dictd/dictd.c | 4 ++--
|
||||
dictd/plugin.c | 5 +++--
|
||||
dictd/plugin.h | 4 ++--
|
||||
dictdplugins/dictdplugin_dbi/dictdplugin_dbi.c | 2 ++
|
||||
4 files changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/dictd/dictd.c
|
||||
+++ b/dictd/dictd.c
|
||||
@@ -766,7 +766,7 @@ static int init_mime_db_list (const void
|
||||
static int init_plugin( const void *datum )
|
||||
{
|
||||
#ifdef USE_PLUGIN
|
||||
- dictDatabase *db = (dictDatabase *)datum;
|
||||
+ const dictDatabase *db = (const dictDatabase *)datum;
|
||||
dict_plugin_init(db);
|
||||
#endif
|
||||
|
||||
@@ -1001,7 +1001,7 @@ static int init_database_short (const vo
|
||||
static int close_plugin(const void *datum)
|
||||
{
|
||||
#ifdef USE_PLUGIN
|
||||
- dictDatabase *db = (dictDatabase *)datum;
|
||||
+ const dictDatabase *db = (const dictDatabase *)datum;
|
||||
dict_plugin_destroy (db);
|
||||
#endif
|
||||
|
||||
--- a/dictd/plugin.c
|
||||
+++ b/dictd/plugin.c
|
||||
@@ -16,6 +16,7 @@
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
+#include "common.h"
|
||||
#include "dictd.h"
|
||||
#include "plugin.h"
|
||||
#include "strategy.h"
|
||||
@@ -555,7 +556,7 @@ static dictPlugin *create_plugin (
|
||||
return plugin;
|
||||
}
|
||||
|
||||
-int dict_plugin_init(dictDatabase *db)
|
||||
+int dict_plugin_init(const dictDatabase *db)
|
||||
{
|
||||
int ret = 0;
|
||||
lst_List list;
|
||||
@@ -604,7 +605,7 @@ int dict_plugin_init(dictDatabase *db)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void dict_plugin_destroy ( dictDatabase *db )
|
||||
+void dict_plugin_destroy (const dictDatabase *db )
|
||||
{
|
||||
int ret;
|
||||
|
||||
--- a/dictd/plugin.h
|
||||
+++ b/dictd/plugin.h
|
||||
@@ -24,9 +24,9 @@
|
||||
#include "dictdplugin.h"
|
||||
|
||||
/* initialize the plugin associated with db*/
|
||||
-extern int dict_plugin_init (dictDatabase *db);
|
||||
+extern int dict_plugin_init (const dictDatabase *db);
|
||||
/* destroy the plugin associated with db*/
|
||||
-extern void dict_plugin_destroy (dictDatabase *db);
|
||||
+extern void dict_plugin_destroy (const dictDatabase *db);
|
||||
|
||||
/* search */
|
||||
extern int dict_search_plugin (
|
||||
--- a/dictdplugins/dictdplugin_dbi/dictdplugin_dbi.c
|
||||
+++ b/dictdplugins/dictdplugin_dbi/dictdplugin_dbi.c
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <dbi/dbi.h>
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <assert.h>
|
||||
|
||||
#define BUFSIZE 4096
|
||||
|
4
_scmsync.obsinfo
Normal file
4
_scmsync.obsinfo
Normal file
@ -0,0 +1,4 @@
|
||||
mtime: 1710531037
|
||||
commit: c0d0a8c0c724fd03940c87631cf5f31a9e44a88acd66db9b855d739332c20ce5
|
||||
url: https://src.opensuse.org/pool/dictd
|
||||
revision: factory
|
16
_service
Normal file
16
_service
Normal file
@ -0,0 +1,16 @@
|
||||
<services>
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="versionprefix">1.13.1+git</param>
|
||||
<param name="url">https://github.com/cheusov/dictd.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="exclude">.git*</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
<param name="changesauthor">mcepl@cepl.eu</param>
|
||||
</service>
|
||||
<service name="tar" mode="buildtime"/>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">*.tar</param>
|
||||
<param name="compression">gz</param>
|
||||
</service>
|
||||
<service name="set_version" mode="manual" />
|
||||
</services>
|
4
_servicedata
Normal file
4
_servicedata
Normal file
@ -0,0 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/cheusov/dictd.git</param>
|
||||
<param name="changesrevision">c480a4c25f5a24f77f438690db4084cbc4d96bfa</param></service></servicedata>
|
@ -1,85 +0,0 @@
|
||||
--- a/dictd.c
|
||||
+++ b/dictd.c
|
||||
@@ -332,6 +332,7 @@ static void xsigprocmask (int how, const
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
static void block_signals (void)
|
||||
{
|
||||
sigset_t set;
|
||||
@@ -353,6 +354,7 @@ static void unblock_signals (void)
|
||||
|
||||
xsigprocmask (SIG_UNBLOCK, &set, NULL);
|
||||
}
|
||||
+*/
|
||||
|
||||
static void handler( int sig )
|
||||
{
|
||||
@@ -1266,21 +1268,22 @@ static void release_root_privileges( voi
|
||||
* -- Bob Hilliard
|
||||
*/
|
||||
{
|
||||
+ int unused __attribute__((unused));
|
||||
if (geteuid() == 0) {
|
||||
struct passwd *pwd;
|
||||
|
||||
if ((pwd = getpwnam("dictd"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("dictd",pwd->pw_gid);
|
||||
- setuid(pwd->pw_uid);
|
||||
+ unused = setuid(pwd->pw_uid);
|
||||
} else if ((pwd = getpwnam("nobody"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("nobody",pwd->pw_gid);
|
||||
- setuid(pwd->pw_uid);
|
||||
+ unused = setuid(pwd->pw_uid);
|
||||
} else {
|
||||
- setgid(GID_NOGROUP);
|
||||
+ unused = setgid(GID_NOGROUP);
|
||||
initgroups("nobody", GID_NOGROUP);
|
||||
- setuid(UID_NOBODY);
|
||||
+ unused = setuid(UID_NOBODY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1464,6 +1467,7 @@ static void pid_file_write ()
|
||||
static void reopen_012 (void)
|
||||
{
|
||||
int fd = open ("/dev/null", O_RDWR);
|
||||
+ int unused __attribute__((unused));
|
||||
if (fd == -1)
|
||||
err_fatal_errno (__func__, ":E: can't open /dev/null");
|
||||
|
||||
@@ -1471,9 +1475,9 @@ static void reopen_012 (void)
|
||||
close (1);
|
||||
close (2);
|
||||
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ unused = dup (fd);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv, char **envp)
|
||||
@@ -1489,6 +1493,7 @@ int main (int argc, char **argv, char **
|
||||
int i;
|
||||
|
||||
int errno_accept = 0;
|
||||
+ int unused __attribute__((unused));
|
||||
|
||||
const char * default_strategy_arg = "???";
|
||||
|
||||
@@ -1707,7 +1712,7 @@ int main (int argc, char **argv, char **
|
||||
|
||||
if (detach){
|
||||
/* become a daemon */
|
||||
- daemon (0, 1);
|
||||
+ unused = daemon (0, 1);
|
||||
reopen_012 ();
|
||||
|
||||
/* after fork from daemon(3) */
|
BIN
dictd-1.13.1+git.1714073710.c480a4c.obscpio
(Stored with Git LFS)
Normal file
BIN
dictd-1.13.1+git.1714073710.c480a4c.obscpio
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a00bfa802354217d355bef2846b69bf81628af9a137651da74a8366ef55ecc16
|
||||
size 338581
|
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu May 09 12:55:59 UTC 2024 - mcepl@cepl.eu
|
||||
|
||||
- Update to version 1.13.1+git.1714073710.c480a4c:
|
||||
* remove use of deprecated inet_aton and inet_ntoa
|
||||
* dictd: install dictd*.conf files to ${DATADIR}/examples/dictd by default
|
||||
* Fix problems with DICT_CONFIG_PATH and other defined came from Makefile
|
||||
* dict/Makefile: do not copy man page to ${BINDIR} :-)
|
||||
* dict/Makefile: formatting
|
||||
* dict: install samples dict.conf and dict2.conf to ${EGDIR}
|
||||
* Move examples/dict1.conf to dict/
|
||||
* Rename makefile to Makefile
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 7 18:18:01 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
name: dictd
|
||||
version: 1.12.1.git.1520674574.9a2f53e
|
||||
mtime: 1520674574
|
||||
commit: 9a2f53ec26ec7eb1880437f1cafae6291634c98d
|
||||
|
||||
version: 1.13.1+git.1714073710.c480a4c
|
||||
mtime: 1714073710
|
||||
commit: c480a4c25f5a24f77f438690db4084cbc4d96bfa
|
||||
|
55
dictd.spec
55
dictd.spec
@ -17,25 +17,30 @@
|
||||
|
||||
|
||||
Name: dictd
|
||||
Version: 1.13.1
|
||||
Version: 1.13.1+git.1714073710.c480a4c
|
||||
Release: 0
|
||||
Summary: DICT protocol (RFC 2229) server and command-line client
|
||||
License: BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
|
||||
Group: Productivity/Office/Dictionary
|
||||
URL: https://github.com/cheusov/dictd
|
||||
Source0: https://github.com/cheusov/dictd/archive/%{version}.tar.gz#/dictd-%{version}.tar.gz
|
||||
# Source0: https://github.com/cheusov/dictd/archive/%%{version}.tar.gz#/dictd-%%{version}.tar.gz
|
||||
Source0: dictd-%{version}.tar.gz
|
||||
Source1: colorit.conf
|
||||
Source2: dictd.service
|
||||
Source99: dictd-rpmlintrc
|
||||
Patch0: dictd-1.12.1-unused-return.patch
|
||||
# PATCH-FIX-UPSTREAM FTBFS-servparse.patch gh#cheusov/dictd#21 mcepl@suse.com
|
||||
# remove warnings leading to build failures
|
||||
Patch0: FTBFS-servparse.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
BuildRequires: gawk
|
||||
BuildRequires: gcc
|
||||
BuildRequires: judy-devel
|
||||
BuildRequires: libdbi-devel
|
||||
BuildRequires: libmaa-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: mk-configure
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
@ -56,8 +61,6 @@ dictd for details.
|
||||
%setup -q
|
||||
%autopatch -p1
|
||||
|
||||
autoreconf -fv
|
||||
|
||||
%package devel
|
||||
Summary: Development files for dictd
|
||||
Group: Development/Languages/C and C++
|
||||
@ -75,12 +78,22 @@ This package contains development files for the dictd package.
|
||||
|
||||
%build
|
||||
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC"
|
||||
%configure --enable-dictorg --with-plugin-dbi
|
||||
# --disable-plugin
|
||||
%make_build
|
||||
export PREFIX=%{_prefix}
|
||||
export MANDIR=%{_mandir}
|
||||
export SYSCONFDIR=%{_sysconfdir}
|
||||
export DESTDIR=%{buildroot}
|
||||
export COPTS="${CPPFLAGS}"
|
||||
export USE_PLUGIN=1
|
||||
mkc_compiler_settings
|
||||
mkcmake all
|
||||
|
||||
%install
|
||||
%make_install
|
||||
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC"
|
||||
export PREFIX=%{_prefix}
|
||||
export MANDIR=%{_mandir}
|
||||
export SYSCONFDIR=%{_sysconfdir}
|
||||
export DESTDIR=%{buildroot}
|
||||
mkcmake install
|
||||
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/colorit.conf
|
||||
cat <<EOF >%{buildroot}/%{_sysconfdir}/dictd.conf
|
||||
global {
|
||||
@ -101,14 +114,14 @@ install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/dictd.service
|
||||
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcdictd
|
||||
|
||||
# Makefile doesn't work correctly with libdir
|
||||
if [ "x%{_libdir}" != "x%{_libexecdir}" ] ; then
|
||||
mkdir -p %{buildroot}%{_libdir}/
|
||||
install -p -v -m 0755 %{buildroot}%{_libexecdir}/dictdplugin* \
|
||||
%{buildroot}%{_libdir}/
|
||||
rm -rv %{buildroot}%{_libexecdir}
|
||||
fi
|
||||
rm -fv %{buildroot}%{_libdir}/*.{la,a}
|
||||
# # Makefile doesn't work correctly with libdir
|
||||
# if [ "x%%{_libdir}" != "x%%{_libexecdir}" ] ; then
|
||||
# mkdir -p %%{buildroot}%%{_libdir}/
|
||||
# install -p -v -m 0755 %%{buildroot}%%{_libexecdir}/dictdplugin* \
|
||||
# %%{buildroot}%%{_libdir}/
|
||||
# rm -rv %%{buildroot}%%{_libexecdir}
|
||||
# fi
|
||||
# rm -fv %%{buildroot}%%{_libdir}/*.{la,a}
|
||||
|
||||
%pre
|
||||
%service_add_pre dictd.service
|
||||
@ -124,9 +137,13 @@ chmod 644 %{_localstatedir}/log/dictd
|
||||
%postun
|
||||
%service_del_postun dictd.service
|
||||
|
||||
tumbleweed-pkg:dictd-1.13.1+git.1714073710.c480a4c $ ls doc
|
||||
ANNOUNCE COPYING dicf.ms INITSCRIPT INSTALL.pod Makefile.in NEWS rfc.ms rfc.sh rfc2229.txt security.doc toc.ms TODO
|
||||
tumbleweed-pkg:dictd-1.13.1+git.1714073710.c480a4c $
|
||||
|
||||
%files
|
||||
%license COPYING
|
||||
%doc ANNOUNCE NEWS README example*
|
||||
%license doc/COPYING
|
||||
%doc doc/ANNOUNCE doc/NEWS README.pod
|
||||
%doc doc/dicf.ms doc/rfc.ms doc/rfc2229.txt doc/security.doc
|
||||
%{_bindir}/dict*
|
||||
%{_bindir}/colorit
|
||||
|
Loading…
x
Reference in New Issue
Block a user