* Added the build requirement systemd-units (macro %%_unitdir)
https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd * Dropped the redefinition of the %%_localstatedir macro * Use %%global instead of %%define * Minor modifications of the %%post, %%preun and %%postun scripts https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd * Expanded tabs to spaces (also added a vim modeline)
This commit is contained in:
parent
c09f0f395d
commit
9d4f221523
107
syslog-ng.spec
107
syslog-ng.spec
|
@ -1,13 +1,11 @@
|
||||||
%define evtlog_ver 0.2.12
|
%global evtlog_ver 0.2.12
|
||||||
|
|
||||||
%define _sbindir /sbin
|
%global _sbindir /sbin
|
||||||
%define _localstatedir /var/lib/syslog-ng
|
%global _libdir /%{_lib}
|
||||||
%define _libdir /%{_lib}
|
|
||||||
%define system_service /lib/systemd/system
|
|
||||||
|
|
||||||
Name: syslog-ng
|
Name: syslog-ng
|
||||||
Version: 3.2.3
|
Version: 3.2.3
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Next-generation syslog server
|
Summary: Next-generation syslog server
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
|
@ -21,6 +19,7 @@ Source4: syslog-ng.logrotate
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
BuildRequires: systemd-units
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
|
@ -75,21 +74,21 @@ developing applications that use %{name}.
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure \
|
%configure \
|
||||||
--prefix=/ \
|
--prefix=/ \
|
||||||
--libdir=/%{_lib} \
|
--libdir=/%{_lib} \
|
||||||
--includedir=%{_includedir} \
|
--includedir=%{_includedir} \
|
||||||
--enable-ipv6 \
|
--sysconfdir=%{_sysconfdir}/%{name} \
|
||||||
--sysconfdir=%{_sysconfdir}/%{name} \
|
--with-module-dir=/%{_lib}/%{name} \
|
||||||
--enable-tcp-wrapper \
|
--enable-ipv6 \
|
||||||
--enable-pcre \
|
--enable-tcp-wrapper \
|
||||||
--enable-shared \
|
--enable-pcre \
|
||||||
--disable-static \
|
--enable-spoof-source \
|
||||||
--disable-sql \
|
--disable-sql \
|
||||||
--disable-ssl \
|
--disable-ssl \
|
||||||
--with-module-dir=/%{_lib}/%{name} \
|
--enable-shared \
|
||||||
--enable-spoof-source \
|
--disable-static \
|
||||||
--enable-dynamic-linking \
|
--enable-dynamic-linking \
|
||||||
--enable-systemd
|
--enable-systemd
|
||||||
|
|
||||||
# remove rpath
|
# remove rpath
|
||||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||||
|
@ -106,7 +105,7 @@ make DESTDIR=%{buildroot} install
|
||||||
%{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf
|
%{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf
|
||||||
|
|
||||||
# install the service script
|
# install the service script
|
||||||
%{__install} -p -D -m 644 %{SOURCE2} %{buildroot}/%{system_service}/%{name}.service
|
%{__install} -p -D -m 644 %{SOURCE2} %{buildroot}/%{_unitdir}/%{name}.service
|
||||||
|
|
||||||
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
|
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
|
||||||
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||||||
|
@ -115,59 +114,65 @@ make DESTDIR=%{buildroot} install
|
||||||
%{__install} -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/syslog
|
%{__install} -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/syslog
|
||||||
|
|
||||||
# make local state dir
|
# make local state dir
|
||||||
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}
|
%{__install} -d -m 755 %{buildroot}/%{_sharedstatedir}/%{name}
|
||||||
|
|
||||||
# fix authors file
|
# fix authors file
|
||||||
/usr/bin/iconv -f iso8859-1 -t utf-8 AUTHORS > AUTHORS.conv && \
|
/usr/bin/iconv -f iso8859-1 -t utf-8 AUTHORS > AUTHORS.conv && \
|
||||||
%{__mv} -f AUTHORS.conv AUTHORS
|
%{__mv} -f AUTHORS.conv AUTHORS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# install vim files
|
# install vim files
|
||||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/%{name}
|
%{__install} -d -m 755 %{buildroot}%{_datadir}/%{name}
|
||||||
%{__install} -p -m 644 contrib/syslog-ng.vim %{buildroot}%{_datadir}/%{name}
|
%{__install} -p -m 644 contrib/syslog-ng.vim %{buildroot}%{_datadir}/%{name}
|
||||||
for vimver in 70 71 72 73 ; do
|
for vimver in 70 71 72 73 ; do
|
||||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
%{__install} -d -m 755 %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
||||||
cd %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
cd %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
||||||
ln -s ../../../%{name}/syslog-ng.vim .
|
ln -s ../../../%{name}/syslog-ng.vim .
|
||||||
cd -
|
cd -
|
||||||
done
|
done
|
||||||
|
|
||||||
ldconfig -N -n %{buildroot}/%{_lib}
|
ldconfig -N -n %{buildroot}/%{_lib}
|
||||||
|
|
||||||
find %{buildroot} -name *.la -exec rm -f '{}' \;
|
find %{buildroot} -name *.la -exec rm -f '{}' \;
|
||||||
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
/bin/systemctl daemon-reload || :
|
if [ $1 -eq 1 ] ; then
|
||||||
|
# Initial installation
|
||||||
%preun
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
if [ "$1" = 0 ]; then
|
|
||||||
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
|
|
||||||
/bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 -eq 0 ] ; then
|
||||||
|
# Package removal, not upgrade
|
||||||
|
/bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
if [ "$1" -ge 1 ]; then
|
if [ $1 -ge 1 ] ; then
|
||||||
/bin/systemctl condrestart %{name}.service >/dev/null 2>&1 || :
|
# Package upgrade, not uninstall
|
||||||
|
/bin/systemctl condrestart %{name}.service >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
%triggerun -- syslog-ng < 3.2.3
|
%triggerun -- syslog-ng < 3.2.3
|
||||||
if /sbin/chkconfig --level 3 %{name} ; then
|
if /sbin/chkconfig --level 3 %{name} ; then
|
||||||
/bin/systemctl enable %{name}.service >/dev/null 2>&1 || :
|
/bin/systemctl enable %{name}.service >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
%triggerin -- vim-common
|
%triggerin -- vim-common
|
||||||
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
||||||
[ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
|
[ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
|
||||||
cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
|
cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
|
||||||
ln -sf ../../../%{name}/syslog-ng.vim . || :
|
ln -sf ../../../%{name}/syslog-ng.vim . || :
|
||||||
|
|
||||||
%triggerun -- vim-common
|
%triggerun -- vim-common
|
||||||
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
||||||
|
@ -177,10 +182,10 @@ VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head -n 1 |
|
||||||
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
||||||
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail -n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
|
||||||
if [ $1 = 1 ]; then
|
if [ $1 = 1 ]; then
|
||||||
rm -f %{_datadir}/vim/vim${VIMVEROLD}/syntax/syslog-ng.vim || :
|
rm -f %{_datadir}/vim/vim${VIMVEROLD}/syntax/syslog-ng.vim || :
|
||||||
[ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
|
[ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
|
||||||
cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
|
cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
|
||||||
ln -sf ../../../%{name}/syslog-ng.vim . || :
|
ln -sf ../../../%{name}/syslog-ng.vim . || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,9 +201,9 @@ fi
|
||||||
%config(noreplace) %{_sysconfdir}/%{name}/scl.conf
|
%config(noreplace) %{_sysconfdir}/%{name}/scl.conf
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
|
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
|
||||||
%{system_service}/%{name}.service
|
%{_unitdir}/%{name}.service
|
||||||
|
|
||||||
%dir %{_localstatedir}
|
%dir %{_sharedstatedir}/%{name}
|
||||||
%{_sbindir}/%{name}
|
%{_sbindir}/%{name}
|
||||||
%{_sbindir}/syslog-ng-ctl
|
%{_sbindir}/syslog-ng-ctl
|
||||||
%{_bindir}/loggen
|
%{_bindir}/loggen
|
||||||
|
@ -225,6 +230,15 @@ fi
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 9 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.3-3
|
||||||
|
- Added the build requirement systemd-units (macro %%_unitdir)
|
||||||
|
https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd
|
||||||
|
- Dropped the redefinition of the %%_localstatedir macro
|
||||||
|
- Use %%global instead of %%define
|
||||||
|
- Minor modifications of the %%post, %%preun and %%postun scripts
|
||||||
|
https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
|
||||||
|
- Expanded tabs to spaces (also added a vim modeline)
|
||||||
|
|
||||||
* Fri May 6 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.3-2
|
* Fri May 6 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.3-2
|
||||||
- Fix systemd-related scriptlets (Bill Nottingham)
|
- Fix systemd-related scriptlets (Bill Nottingham)
|
||||||
- Explicitly add --enable-systemd to configure's command line
|
- Explicitly add --enable-systemd to configure's command line
|
||||||
|
@ -578,3 +592,4 @@ fi
|
||||||
* Sun Dec 08 2002 Richard E. Perlotto II <richard@perlotto.com> 1.5.23-1
|
* Sun Dec 08 2002 Richard E. Perlotto II <richard@perlotto.com> 1.5.23-1
|
||||||
- Updated file with notes and PGP signatures
|
- Updated file with notes and PGP signatures
|
||||||
|
|
||||||
|
# vim:set ai ts=4 sw=4 sts=4 et:
|
||||||
|
|
Loading…
Reference in New Issue