From c7d02484d2e81a3c53f1f3a1ab8ae5398d31e3060d635ab4e82bdc637500cabe Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Fri, 20 Mar 2015 19:32:59 +0000 Subject: [PATCH] Accepting request 291321 from home:pluskalm:branches:network - Do not install service and socket file as executable * change to 0644 - Cleanup spec file with spec-cleaner OBS-URL: https://build.opensuse.org/request/show/291321 OBS-URL: https://build.opensuse.org/package/show/network/atftp?expand=0&rev=24 --- atftp.changes | 7 +++++ atftp.spec | 74 +++++++++++++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 38 deletions(-) diff --git a/atftp.changes b/atftp.changes index 9ac4b26..904b26d 100644 --- a/atftp.changes +++ b/atftp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 18 15:23:17 UTC 2015 - mpluskal@suse.com + +- Do not install service and socket file as executable + * change to 0644 +- Cleanup spec file with spec-cleaner + ------------------------------------------------------------------- Mon Feb 16 13:06:57 UTC 2015 - p.drouand@gmail.com diff --git a/atftp.spec b/atftp.spec index bf48287..8088504 100644 --- a/atftp.spec +++ b/atftp.spec @@ -1,7 +1,7 @@ # # spec file for package atftp # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,15 +17,14 @@ # -%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services +%define _fwdefdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services %define pkg_version 0.7 - Name: atftp +Version: 0.7.0 +Release: 0 Summary: Advanced TFTP Server and Client License: GPL-2.0+ Group: System/Daemons -Version: 0.7.0 -Release: 0 Url: ftp://ftp.mamalinux.com/pub/atftp/ Source: %{name}-%{pkg_version}.tar.bz2 Source1: atftpd.init @@ -51,24 +50,24 @@ Patch12: atftp-0.7-ack_heuristic.patch Patch13: atftp-0.7-default_user_man.patch # PATCH-FIX-SUSE update default directory in man (bnc#507011) Patch14: atftp-0.7-default_dir_man.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Provides: tftp(client) -Provides: tftp(server) -%if 0%{?suse_version} >= 1210 -BuildRequires: systemd-rpm-macros -%{?systemd_requires} -%else -PreReq: %insserv_prereq -%endif -PreReq: %fillup_prereq -PreReq: pwdutils BuildRequires: autoconf BuildRequires: automake BuildRequires: pcre-devel BuildRequires: readline-devel BuildRequires: tcpd-devel -Conflicts: tftp +Requires(pre): %fillup_prereq +Requires(pre): pwdutils Recommends: logrotate +Conflicts: tftp +Provides: tftp(client) +Provides: tftp(server) +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if 0%{?suse_version} >= 1210 +BuildRequires: systemd-rpm-macros +%{?systemd_requires} +%else +Requires(pre): %insserv_prereq +%endif %description atftp stands for Advanced Trivial File Transfer Protocol. It is called @@ -101,22 +100,22 @@ autoreconf -fi make %{?_smp_mflags} %install -%makeinstall +make DESTDIR=%{buildroot} install %{?_smp_mflags} # SuSE rc %if 0%{?suse_version} >= 1210 -%{__install} -D -m 0755 %{S:5} %{buildroot}/%{_unitdir}/atftpd.service -%{__install} -D -m 0755 %{S:6} %{buildroot}/%{_unitdir}/atftpd.socket -ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcatftpd +install -D -m 0644 %{SOURCE5} %{buildroot}/%{_unitdir}/atftpd.service +install -D -m 0644 %{SOURCE6} %{buildroot}/%{_unitdir}/atftpd.socket +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcatftpd %else -%{__install} -D -m 0755 %{S:1} %{buildroot}/etc/init.d/atftpd -%{__ln_s} -f ../../etc/init.d/atftpd %{buildroot}%{_sbindir}/rcatftpd +install -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/atftpd +ln -s -f ../..%{_initddir}/atftpd %{buildroot}%{_sbindir}/rcatftpd %endif -%{__install} -D -m 0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.atftpd -%{__install} -D -m 0644 %{S:3} %{buildroot}/etc/logrotate.d/%{name} -%{__mkdir} -p %{buildroot}/%{_fwdefdir} -%{__install} -m 0644 %{S:4} %{buildroot}/%{_fwdefdir}/atftp -%{__install} -d -m 0750 %{buildroot}/srv/tftpboot -%{__install} -d -m 0750 %{buildroot}/var/log/atftpd +install -D -m 0644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.atftpd +install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +mkdir -p %{buildroot}/%{_fwdefdir} +install -m 0644 %{SOURCE4} %{buildroot}/%{_fwdefdir}/atftp +install -d -m 0750 %{buildroot}/srv/tftpboot +install -d -m 0750 %{buildroot}%{_localstatedir}/log/atftpd %pre # This group/user is shared with tftp, so please @@ -127,9 +126,9 @@ ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcatftpd %{_sbindir}/useradd -c "TFTP account" -d /srv/tftpboot -G tftp -g tftp \ -r -s /bin/false tftp 2>/dev/null || : # fix sysconfig to get new defaults on Update -if [ -f /etc/sysconfig/atftpd ]; then - %{__sed} -i -e "s@^\(ATFTPD_OPTIONS=\"--daemon \"\)@#\1@" /etc/sysconfig/atftpd - %{__sed} -i -e "s@^\(ATFTPD_DIRECTORY=\"/tftpboot\"\)@#\1@" /etc/sysconfig/atftpd +if [ -f %{_sysconfdir}/sysconfig/atftpd ]; then + sed -i -e "s@^\(ATFTPD_OPTIONS=\"--daemon \"\)@#\1@" %{_sysconfdir}/sysconfig/atftpd + sed -i -e "s@^\(ATFTPD_DIRECTORY=\"/tftpboot\"\)@#\1@" %{_sysconfdir}/sysconfig/atftpd fi %if 0%{?suse_version} >= 1210 %service_add_pre atftpd.service atftpd.socket @@ -153,7 +152,7 @@ fi %service_del_postun atftpd.service atftpd.socket %else %restart_on_update atftpd -%{insserv_cleanup} +%insserv_cleanup %endif %files @@ -167,16 +166,15 @@ fi %{_unitdir}/atftpd.service %{_unitdir}/atftpd.socket %else -/etc/init.d/atftpd +%{_initddir}/atftpd %endif -%config /etc/logrotate.d/%{name} -/var/adm/fillup-templates/sysconfig.atftpd +%config %{_sysconfdir}/logrotate.d/%{name} +%{_localstatedir}/adm/fillup-templates/sysconfig.atftpd %{_mandir}/man1/atftp.1.gz %{_mandir}/man8/atftpd.8.gz %{_mandir}/man8/in.tftpd.8.gz %config %{_fwdefdir}/atftp %dir %attr(0750,tftp,tftp) /srv/tftpboot -%dir %attr(0750,tftp,tftp) /var/log/atftpd/ -#ghost %dir /var/run/atftpd +%dir %attr(0750,tftp,tftp) %{_localstatedir}/log/atftpd/ %changelog