%global gitdate 20121109 %global gitrev 4e8107 Name: linuxptp Version: 0 Release: 0.3.%{gitdate}git%{gitrev}%{?dist} Summary: PTP implementation for Linux Group: System Environment/Base License: GPLv2+ URL: http://linuxptp.sourceforge.net/ # git clone git://git.code.sf.net/p/linuxptp/code linuxptp; cd linuxptp # git archive --prefix=linuxptp/ %{gitrev} | gzip > linuxptp-%{gitdate}git%{gitrev}.tar.gz Source0: %{name}-%{gitdate}git%{gitrev}.tar.gz Source1: phc2sys.service Source2: ptp4l.service BuildRequires: systemd-units Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %description This software is an implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux. The dual design goals are to provide a robust implementation of the standard and to use the most relevant and modern Application Programming Interfaces (API) offered by the Linux kernel. Supporting legacy APIs and other platforms is not a goal. %prep %setup -q -n %{name} %build make %{?_smp_mflags} \ INC="" \ EXTRA_CFLAGS="$RPM_OPT_FLAGS -pie -fpie" \ EXTRA_LDFLAGS="-Wl,-z,relro,-z,now" %install %makeinstall mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir}} install -m 644 -p default.cfg $RPM_BUILD_ROOT%{_sysconfdir}/ptp4l.conf install -m 644 -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir} echo 'OPTIONS="-f /etc/ptp4l.conf -i eth0"' > \ $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l echo 'OPTIONS="-d /dev/pps0"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys %post %if 0%{?systemd_post:1} %systemd_post ptp4l.service phc2sys.service %else /bin/systemctl daemon-reload &> /dev/null || : %endif %preun %if 0%{?systemd_preun:1} %systemd_preun phc2sys.service ptp4l.service %else if [ "$1" -eq 0 ]; then /bin/systemctl --no-reload disable \ phc2sys.service ptp4l.service &> /dev/null /bin/systemctl stop phc2sys.service ptp4l.service &> /dev/null fi : %endif %postun %if 0%{?systemd_postun_with_restart:1} %systemd_postun_with_restart ptp4l.service phc2sys.service %else /bin/systemctl daemon-reload &> /dev/null if [ "$1" -ge 1 ]; then /bin/systemctl try-restart ptp4l.service phc2sys.service &> /dev/null fi : %endif %files %doc COPYING README.org default.cfg gPTP.cfg %config(noreplace) %{_sysconfdir}/ptp4l.conf %config(noreplace) %{_sysconfdir}/sysconfig/phc2sys %config(noreplace) %{_sysconfdir}/sysconfig/ptp4l %{_unitdir}/phc2sys.service %{_unitdir}/ptp4l.service %{_sbindir}/hwstamp_ctl %{_sbindir}/phc2sys %{_sbindir}/pmc %{_sbindir}/ptp4l %{_mandir}/man8/*.8* %changelog * Fri Nov 09 2012 Miroslav Lichvar 0-0.3.20121109git4e8107 - update to 20121109git4e8107 - install unchanged default.cfg as ptp4l.conf - drop conflicts from phc2sys service * Fri Sep 21 2012 Miroslav Lichvar 0-0.2.20120920git6ce135 - fix issues found in package review (#859193) * Thu Sep 20 2012 Miroslav Lichvar 0-0.1.20120920git6ce135 - initial release