Skip to contentSkip to conversation

bugfix: SuSE handling in openvpn.spec

Openvpn-devel Stefan Engel 3 participants 6 messages Dec 3, 2004 – Dec 6, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

The appended patch should fix this.

Regards,

Stefan

openvpn.spec renamed from openvpn.spec.19 +4 -0
@@ -91,7 +91,11 @@
 %{_sbindir}/%{name}
 %{_datadir}/%{name}
 %dir /etc/%{name}
+%if "%{VENDOR}" == "SuSE"
+/etc/init.d/%{name}
+%else
 /etc/rc.d/init.d/%{name}
+%endif
 
 %changelog
 
#1 lore raw
Quoted 7 lines · Stefan Engel

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

Quoted 6 lines

The appended patch should fix this.

Regards,

Stefan

What gives "rpm --eval '%{_initrddir}'" on SuSE? In RH/FC it gives
"/etc/rc.d/init.d", which I use in my .spec file:
--- cut ---

# to fix later: '--program-suffix 2' is optional, so use * here
%{_initrddir}/*
--- cut ---
    instead of
--- cut ---
/etc/rc.d/init.d/%{name}
--- cut ---
    If accepted then
--- cut ---
%if "%{VENDOR}" == "SuSE"
%__install -c -d -m 755 %{buildroot}/etc/init.d
%__install -c -m 755 suse/%{name}.init %{buildroot}/etc/init.d/%{name}
%else
%__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d
%__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name}
%endif
--- cut ---
    should be just one line :)
--- cut ---
%__install -c -d -m 755 %{buildroot}%{_initrddir}
--- cut ---
Signature · 4 lines
Regards,
  Doncho N. Gunchev    Registered Linux User #291323 at counter.li.org
  GPG-Key-ID: 1024D/DA454F79                        http://pgp.mit.edu
  Key fingerprint = 684F 688B C508 C609 0371  5E0F A089 CB15 DA45 4F79
#2 lore raw
Quoted 32 lines · Doncho N. Gunchev
Quoted 7 lines · Stefan Engel

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

Quoted 6 lines

The appended patch should fix this.

Regards,

Stefan

What gives "rpm --eval '%{_initrddir}'" on SuSE? In RH/FC it gives
"/etc/rc.d/init.d", which I use in my .spec file:
--- cut ---

# to fix later: '--program-suffix 2' is optional, so use * here
%{_initrddir}/*
--- cut ---
    instead of
--- cut ---
/etc/rc.d/init.d/%{name}
--- cut ---
    If accepted then
--- cut ---
%if "%{VENDOR}" == "SuSE"
%__install -c -d -m 755 %{buildroot}/etc/init.d
%__install -c -m 755 suse/%{name}.init %{buildroot}/etc/init.d/%{name}
%else
Quoted 9 lines
%__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d
%__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name}
%endif
--- cut ---
    should be just one line :)
--- cut ---
%__install -c -d -m 755 %{buildroot}%{_initrddir}
--- cut ---

Using %{_initrddir} would be fine, if all rpm installation would treat it correctly.

SuSE 9.2 correctly reports /etc/init.d, but SuSE 9.1 doesn't :-(

rpm --eval '%{_initrddir}' results, _initrddir is defined in /usr/lib/rpm/i386-linux/macros:

SuSE 9.1: /etc/rc.d/init.d
%_initrddir %{_sysconfdir}/rc.d/init.d

SuSE 9.2: /etc/init.d
%_initrddir %{_sysconfdir}/init.d

SuSE 9.1 has no directory /etc/rc.d/init.d. Instead /etc/rc.d is a link to /etc/init.d thus resulting in /etc/init.d/init.d. This messes up the installation of the init-script.

The tests for SuSE in the spec file are correct in sections %description, %install, %post and %preun, they are only missing in the %files section.

#3 lore raw

(ops... I missed openvpn-devel, sorry)

Quoted 9 lines · Stefan Engel
Quoted 8 lines · Doncho N. Gunchev
Quoted 6 lines · Stefan Engel

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

...

Quoted 7 lines
Quoted 7 lines

    What gives "rpm --eval '%{_initrddir}'" on SuSE? In RH/FC it gives "/etc/rc.d/init.d", which I use in my .spec file:
--- cut ---

# to fix later: '--program-suffix 2' is optional, so use * here
%{_initrddir}/*
--- cut ---

...

Quoted 15 lines

Using %{_initrddir} would be fine, if all rpm installation would treat it correctly.

SuSE 9.2 correctly reports /etc/init.d, but SuSE 9.1 doesn't :-(

rpm --eval '%{_initrddir}' results, _initrddir is defined in /usr/lib/rpm/i386-linux/macros:

SuSE 9.1: /etc/rc.d/init.d
%_initrddir             %{_sysconfdir}/rc.d/init.d

SuSE 9.2: /etc/init.d
%_initrddir             %{_sysconfdir}/init.d

Quoted 8 lines

SuSE 9.1 has no directory /etc/rc.d/init.d. Instead /etc/rc.d is a link to /etc/init.d thus resulting in /etc/init.d/init.d. This messes up the installation of the init-script.

The tests for SuSE in the spec file are correct in sections %description, %install, %post and %preun, they are only missing in the %files section.

    I stilt hink %{_initrddir}/openvpn is the 'right(tm) thing' to use. Wouldn't it be better to override %_initrddir for SuSE 9.1 (or any SuSE) instead of branching %files (%define _initrddir %{_sysconfdir}/init.d)? I wish rpm was much more compatible between distros, but Mandrake's rpm differs too :(
    Can someone check these on mandrake? I verified %_initrddir is fine for FC1, FC2 and FC3 (most likely for RH9 and ASP Linux too).

Signature · 4 lines
Regards,
  Doncho N. Gunchev    Registered Linux User #291323 at counter.li.org
  GPG-Key-ID: 1024D/DA454F79                        http://pgp.mit.edu
  Key fingerprint = 684F 688B C508 C609 0371  5E0F A089 CB15 DA45 4F79
#4 lore raw
In reply to Stefan Engel
Quoted 7 lines · Stefan Engel

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

Quoted 6 lines

The appended patch should fix this.

Regards,

Stefan

Does this patch deal correctly with SuSE 9.1/9.2 differences?

James

#5 lore raw
Quoted 15 lines · James Yonan
Quoted 11 lines · Stefan Engel

Hi,

there is a minor bug in openvpn.spec (v2.0_beta19). In the %files section the init script is always taken from /etc/rc.d/init.d instead of /etc/init.d in case of a SuSE distribution. This results in an rpm build error on SuSE systems.

The appended patch should fix this.

Regards,

Quoted 8 lines
Quoted 2 lines

Stefan

Does this patch deal correctly with SuSE 9.1/9.2 differences?

James

SuSE 9.1 and SuSE 9.2 use the same location for storing init-scripts, i.e. /etc/init.d. Whereas the rpm variable %{_initrddir} seems to be broken in 9.1 (pointing to the wrong directory), this is fixed in 9.2.

Stefan