Skip to content

Commit 16a0a69

Browse files
committed
Fixing LDAP support
1 parent 005cf3d commit 16a0a69

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

SPECS/opendkim.spec

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%global systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7)
1+
%global systemd (0%{?fedora} >= 18) || (0%{?rhel} >= 7)
22
%global upname OpenDKIM
33
%global bigname OPENDKIM
44

@@ -11,21 +11,18 @@ License: BSD and Sendmail
1111
URL: http://%{name}.org/
1212
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
1313

14+
# https://sourceforge.net/p/opendkim/tickets/###/
15+
#Patch0: %{name}.ticket###.patch
16+
1417
# Required for all versions
1518
Requires: lib%{name}%{?_isa} = %{version}-%{release}
16-
BuildRequires: sendmail-devel, openssl-devel, libtool, pkgconfig, libbsd, libbsd-devel, opendbx-devel, openldap-devel
19+
BuildRequires: sendmail-devel, openssl-devel, libtool, pkgconfig, libbsd, libbsd-devel, opendbx-devel
1720
Requires(pre): shadow-utils
1821

19-
%if 0%{?rhel} && 0%{?rhel} == 5
20-
Requires(post): policycoreutils
21-
%endif
22-
2322
%if %systemd
2423
# Required for systemd
25-
Requires(post): systemd-units
26-
Requires(preun): systemd-units
27-
Requires(postun): systemd-units
28-
Requires(post): systemd-sysv
24+
%{?systemd_requires}
25+
BuildRequires: systemd
2926
BuildRequires: libdb-devel, libmemcached-devel
3027
%else
3128
# Required for SysV
@@ -35,7 +32,11 @@ Requires(postun): initscripts
3532
BuildRequires: db4-devel
3633
%endif
3734

38-
#Patch0: %{name}.init.patch
35+
%if 0%{?rhel} == 5
36+
Requires(post): policycoreutils
37+
%else
38+
BuildRequires: openldap-devel
39+
%endif
3940

4041
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
4142

@@ -65,6 +66,8 @@ required for developing applications against libopendkim.
6566

6667
%prep
6768
%setup -q
69+
# Apply Global patches
70+
#%patch0 -p1
6871
%if %systemd
6972
# Apply systemd patches
7073
#%patch0 -p1
@@ -87,24 +90,24 @@ required for developing applications against libopendkim.
8790
%endif
8891

8992
# Remove rpath
90-
%{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
91-
%{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
93+
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
94+
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
9295

9396
%install
94-
%{__make} DESTDIR=%{buildroot} install %{?_smp_mflags}
95-
%{__install} -d %{buildroot}%{_sysconfdir}
96-
%{__install} -d %{buildroot}%{_sysconfdir}/sysconfig
97-
%{__install} -m 0755 contrib/init/redhat/%{name}-default-keygen %{buildroot}%{_sbindir}/%{name}-default-keygen
97+
make DESTDIR=%{buildroot} install %{?_smp_mflags}
98+
install -d %{buildroot}%{_sysconfdir}
99+
install -d %{buildroot}%{_sysconfdir}/sysconfig
100+
install -m 0755 contrib/init/redhat/%{name}-default-keygen %{buildroot}%{_sbindir}/%{name}-default-keygen
98101

99102
%if %systemd
100-
%{__install} -d -m 0755 %{buildroot}%{_unitdir}
101-
%{__install} -m 0644 contrib/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
103+
install -d -m 0755 %{buildroot}%{_unitdir}
104+
install -m 0644 contrib/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
102105
%else
103-
%{__install} -d %{buildroot}%{_initrddir}
104-
%{__install} -m 0755 contrib/init/redhat/%{name} %{buildroot}%{_initrddir}/%{name}
106+
install -d %{buildroot}%{_initrddir}
107+
install -m 0755 contrib/init/redhat/%{name} %{buildroot}%{_initrddir}/%{name}
105108
%endif
106109

107-
%{__cat} > %{buildroot}%{_sysconfdir}/%{name}.conf << 'EOF'
110+
cat > %{buildroot}%{_sysconfdir}/%{name}.conf << 'EOF'
108111
## BASIC %{bigname} CONFIGURATION FILE
109112
## See %{name}.conf(5) or %{_defaultdocdir}/%{name}/%{name}.conf.sample for more
110113

@@ -245,8 +248,8 @@ DKIM_SELECTOR=default
245248
DKIM_KEYDIR=%{_sysconfdir}/%{name}/keys
246249
EOF
247250

248-
%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name}
249-
%{__cat} > %{buildroot}%{_sysconfdir}/%{name}/SigningTable << 'EOF'
251+
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
252+
cat > %{buildroot}%{_sysconfdir}/%{name}/SigningTable << 'EOF'
250253
# %{bigname} SIGNING TABLE
251254
# This table controls how to apply one or more signatures to outgoing messages based
252255
# on the address found in the From: header field. In simple terms, this tells
@@ -274,7 +277,7 @@ EOF
274277
#example.com default._domainkey.example.com
275278
EOF
276279

277-
%{__cat} > %{buildroot}%{_sysconfdir}/%{name}/KeyTable << 'EOF'
280+
cat > %{buildroot}%{_sysconfdir}/%{name}/KeyTable << 'EOF'
278281
# %{bigname} KEY TABLE
279282
# To use this file, uncomment the #KeyTable option in %{_sysconfdir}/%{name}.conf,
280283
# then uncomment the following line and replace example.com with your domain
@@ -283,7 +286,7 @@ EOF
283286
#default._domainkey.example.com example.com:default:%{_sysconfdir}/%{name}/keys/default.private
284287
EOF
285288

286-
%{__cat} > %{buildroot}%{_sysconfdir}/%{name}/TrustedHosts << 'EOF'
289+
cat > %{buildroot}%{_sysconfdir}/%{name}/TrustedHosts << 'EOF'
287290
# %{bigname} TRUSTED HOSTS
288291
# To use this file, uncomment the #ExternalIgnoreList and/or the #InternalHosts
289292
# option in %{_sysconfdir}/%{name}.conf then restart %{upname}. Additional hosts
@@ -295,7 +298,7 @@ EOF
295298
#192.168.1.0/24
296299
EOF
297300

298-
%{__cat} > README.fedora << 'EOF'
301+
cat > README.fedora << 'EOF'
299302
#####################################
300303
#FEDORA-SPECIFIC README FOR %{bigname}#
301304
#####################################
@@ -401,25 +404,25 @@ Official documentation for %{upname} is available at http://%{name}.org/
401404
###
402405
EOF
403406

404-
%{__install} -p -d %{buildroot}%{_sysconfdir}/tmpfiles.d
405-
%{__cat} > %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf <<'EOF'
407+
install -p -d %{buildroot}%{_sysconfdir}/tmpfiles.d
408+
cat > %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf <<'EOF'
406409
D %{_localstatedir}/run/%{name} 0700 %{name} %{name} -
407410
EOF
408411

409-
%{__rm} -r %{buildroot}%{_prefix}/share/doc/%{name}
410-
%{__rm} %{buildroot}%{_libdir}/*.a
411-
%{__rm} %{buildroot}%{_libdir}/*.la
412+
rm -r %{buildroot}%{_prefix}/share/doc/%{name}
413+
rm %{buildroot}%{_libdir}/*.a
414+
rm %{buildroot}%{_libdir}/*.la
412415

413-
%{__mkdir} -p %{buildroot}%{_localstatedir}/spool/%{name}
414-
%{__mkdir} -p %{buildroot}%{_localstatedir}/run/%{name}
415-
%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name}
416-
%{__mkdir} %{buildroot}%{_sysconfdir}/%{name}/keys
416+
mkdir -p %{buildroot}%{_localstatedir}/spool/%{name}
417+
mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
418+
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
419+
mkdir %{buildroot}%{_sysconfdir}/%{name}/keys
417420

418-
%{__install} -m 0755 stats/%{name}-reportstats %{buildroot}%{_prefix}/sbin/%{name}-reportstats
419-
%{__sed} -i 's|^%{bigname}STATSDIR="/var/db/%{name}"|%{bigname}STATSDIR="%{_localstatedir}/spool/%{name}"|g' %{buildroot}%{_prefix}/sbin/%{name}-reportstats
420-
%{__sed} -i 's|^%{bigname}DATOWNER="mailnull:mailnull"|%{bigname}DATOWNER="%{name}:%{name}"|g' %{buildroot}%{_prefix}/sbin/%{name}-reportstats
421+
install -m 0755 stats/%{name}-reportstats %{buildroot}%{_prefix}/sbin/%{name}-reportstats
422+
sed -i 's|^%{bigname}STATSDIR="/var/db/%{name}"|%{bigname}STATSDIR="%{_localstatedir}/spool/%{name}"|g' %{buildroot}%{_prefix}/sbin/%{name}-reportstats
423+
sed -i 's|^%{bigname}DATOWNER="mailnull:mailnull"|%{bigname}DATOWNER="%{name}:%{name}"|g' %{buildroot}%{_prefix}/sbin/%{name}-reportstats
421424

422-
%{__chmod} 0644 contrib/convert/convert_keylist.sh
425+
chmod 0644 contrib/convert/convert_keylist.sh
423426

424427
%pre
425428
getent group %{name} >/dev/null || groupadd -r %{name}
@@ -469,14 +472,10 @@ exit 0
469472
%postun -n libopendkim -p /sbin/ldconfig
470473

471474
%clean
472-
%{__rm} -rf %{buildroot}
475+
rm -rf %{buildroot}
473476

474477
%files
475-
%if 0%{?_licensedir:1}
476478
%license LICENSE LICENSE.Sendmail
477-
%else
478-
%doc LICENSE LICENSE.Sendmail
479-
%endif
480479
%doc FEATURES KNOWNBUGS RELEASE_NOTES RELEASE_NOTES.Sendmail INSTALL
481480
%doc contrib/convert/convert_keylist.sh %{name}/*.sample
482481
%doc %{name}/%{name}.conf.simple-verify %{name}/%{name}.conf.simple
@@ -524,7 +523,8 @@ exit 0
524523

525524
%changelog
526525
* Wed Jul 20 2016 Steve Jenkins <[email protected]> - 2.10.3-5
527-
- Fixed OpenLDAP support
526+
- Fixed OpenLDAP support for all targets except EL5 (required version not available)
527+
- Updated spec file to more modern conventions
528528

529529
* Thu Feb 04 2016 Fedora Release Engineering <[email protected]> - 2.10.3-4
530530
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

0 commit comments

Comments
 (0)